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 in days (default 14), capped at your plan's history: Starter 90, Business 365, Professional 730, Enterprise unlimited

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": { "https://t.co/": 40, "https://www.facebook.com/": 28 },
  "plan": "business",
  "requested_days": 30,
  "history_limit_days": 365,
  "locked": []
}

On the Starter plan by_country, by_device and by_browser are null and listed in locked (they come with Business and above), and a days value beyond 90 is shortened to 90 with a history_note.

FieldDescription
totals.clicksTotal clicks in the window
totals.uniquesUnique visitors (first click per visitor per day, by anonymised IP)
timelinePer-day clicks and uniques (UTC days), gap-filled across the window
by_countryClicks per ISO-3166 alpha-2 country code
by_devicemobile / desktop / tablet
by_browserBrowser family
by_referrerReferring URL as sent by the browser (often just the origin, e.g. https://t.co/)

Clicks with no value for a dimension (for example no Referer header, or a country that couldn't be detected) count towards totals and timeline but are left out of that breakdown, so a breakdown can sum to less than totals.clicks. Clicks from known bots and crawlers are not counted at all.

Clicks are always unlimited. Link previews (WhatsApp, iMessage, Telegram, Slack...), crawlers and prefetches are never counted.

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