eSMS AfricaeSMS Africa
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 https://links.esmsafrica.io/v1/analytics/{link_id}
QueryTypeDescription
daysintWindow 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 }
}
FieldDescription
totals.clicksTotal clicks in the window
totals.uniquesUnique visitors (first sighting per visitor per day)
timelinePer-day clicks and uniques, gap-filled across the window
by_countryClicks per ISO-3166 country code
by_devicemobile / desktop / tablet
by_browserBrowser family
by_referrerReferring host (direct when none)

Clicks are always unlimited. The analytics endpoints accept a days window of up to 365.

Errors

StatusDescription
404The 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"

On this page