API ReferenceLinks API
Analytics
Read click analytics for a link - /v1/analytics/{id}.
Read clicks and scans for one of your links, broken down over time and by country, device, browser and referrer. Reads are served from pre-aggregated rollups, so they're fast even on high-volume links.
Get link analytics
GET https://links.esmsafrica.io/v1/analytics/{link_id}| Query | Type | Description |
|---|---|---|
days | int | Window size, 1–365 (default 14) |
Response - 200
{
"link_id": "0f5c84e2-7a1e-43d2-8aa1-c0ce93114605",
"range_days": 30,
"totals": { "clicks": 128, "uniques": 96 },
"timeline": [
{ "day": "2026-08-01", "clicks": 10, "uniques": 8 },
{ "day": "2026-08-02", "clicks": 22, "uniques": 17 }
],
"by_country": { "NG": 48, "KE": 34, "GH": 21 },
"by_device": { "mobile": 105, "desktop": 20, "tablet": 3 },
"by_browser": { "Chrome": 88, "Safari": 30, "Firefox": 10 },
"by_referrer": { "twitter.com": 40, "direct": 60, "facebook.com": 28 }
}| Field | Description |
|---|---|
totals.clicks | Total clicks in the window |
totals.uniques | Unique visitors (first sighting per visitor per day) |
timeline | Per-day clicks and uniques, gap-filled across the window |
by_country | Clicks per ISO-3166 country code |
by_device | mobile / desktop / tablet |
by_browser | Browser family |
by_referrer | Referring host (direct when none) |
Clicks are always unlimited. The analytics endpoints accept a days window of up to 365.
Errors
| Status | Description |
|---|---|
404 | The link isn't yours or doesn't exist |
Example
curl "https://links.esmsafrica.io/v1/analytics/0f5c84e2-7a1e-43d2-8aa1-c0ce93114605?days=30" \
-H "Authorization: Bearer esms_l_your_key"