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.
Data retention
Click records are kept as long as the link exists. How far back the statistics endpoints and CSV exports return clicks depends on the plan: 1 year on Free, 2 years on Starter, 3 years on Pro, 5 years on Builder and Team, and unlimited on Enterprise. Older records are hidden, not deleted. After 90 days, personal fields are removed from each click on every plan (IP address, city, postal code, coordinates, time zone, ISP, user agent string, request headers, full referrer URL); those clicks still report country, region, device, browser, OS and the referrer's domain, and the missing fields come back as null. One aggregate query covers at most 365 days.
After a downgrade, records older than the new plan's period are hidden from the statistics endpoints and exports. They are not deleted and are returned again after an upgrade.
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"