Analytics API

Per-link and account-level click statistics

The Analytics API lets you retrieve click statistics for individual short links or across your entire account. All analytics endpoints require a Pro plan or higher.

Link Statistics

GET /api/analytics/:shortCode?period=7

Returns click statistics for a single short link over a specified time period.

Path parameters

Parameter Description
shortCode The slug of the short link (the shortUrl value returned when creating)

Query parameters

Parameter Type Description
period integer Number of days to include (1–90, default 7)
country string Filter by ISO 3166-1 alpha-2 country code (e.g. US, GB)
device string Filter by device type: mobile, desktop, or tablet

Response fields

Field Type Description
clicks integer Total clicks in the period
uniqueClicks integer Unique visitors in the period
topCountries array Top countries by click count: [{ country, clicks }]
topDevices array Device breakdown: [{ device, clicks }]
topReferrers array Top referrer domains: [{ referrer, clicks }]
clicksByDay array Daily click counts: [{ date, clicks }]

curl example

curl "https://awsys.co/api/analytics/abc123?period=30" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

{
  "clicks": 1842,
  "uniqueClicks": 1204,
  "topCountries": [
    { "country": "US", "clicks": 940 },
    { "country": "GB", "clicks": 312 },
    { "country": "CA", "clicks": 198 }
  ],
  "topDevices": [
    { "device": "mobile", "clicks": 1100 },
    { "device": "desktop", "clicks": 692 },
    { "device": "tablet", "clicks": 50 }
  ],
  "topReferrers": [
    { "referrer": "twitter.com", "clicks": 601 },
    { "referrer": "direct", "clicks": 480 }
  ],
  "clicksByDay": [
    { "date": "2026-05-18", "clicks": 87 },
    { "date": "2026-05-19", "clicks": 103 }
  ]
}

Account-Level Statistics

GET /api/analytics/account?period=30

Returns aggregate statistics across all links in your account.

Query parameters

Parameter Type Description
period integer Number of days to include (1–90, default 30)

Response fields

In addition to the per-link fields above, the account endpoint includes:

Field Type Description
totalLinks integer Total number of short links in your account
topLinks array Top performing links: [{ shortCode, url, clicks }]

curl example

curl "https://awsys.co/api/analytics/account?period=7" \
  -H "Authorization: Bearer YOUR_API_KEY"