Documentation
Export a link's clicks
GET
/v1/links/{link}/clicksAnalyticsEvery click and scan of one link in the range, one row each: time, country, referring host, device class and whether it was a QR scan. No IP addresses or user agents are stored, so none are exported. Needs the Pro plan (Free answers 403 forbidden with details.upgrade). A CSV carries the newest 50,000 rows of the range; narrow days or add filters for the rest.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
link | string, in the path | required | The link's id, ending, domain/ending or full short URL. URL-encode the entire reference in this path segment. Full URLs retain their namespace and never fall back to a same-ending link on another domain. |
days | integer | optional | How many UTC days back, today included. Free shows 30 days; Pro shows 365. A larger value is capped; max_days in the answer says where. Default 30. |
country | string | optional | Exact two-letter country code, or unknown for missing country. |
referrer | string | optional | Exact referring hostname, or direct for no referrer. No URL path. |
device | string | optional | Exact device class: desktop, mobile or tablet. |
channel | string | optional | qr for marked QR scans, link for ordinary link clicks. Omit for both. |
cursor | string | optional | The next_cursor from the preceding JSON page. Keep the same filters and days. Do not combine with before. |
before | integer, null | optional | Legacy exclusive timestamp. Prefer cursor for lossless pagination when timestamps tie. |
format | json | csv | optional | csv streams every row in the range as text/csv (no paging). Default json. |
Example request
Terminal
curl "https://snip.link/v1/links/spring-menu/clicks?days=30" \
-H "Authorization: Bearer $SNIP_KEY"Example response
Response
{
"clicks": [
{
"ts": "2026-10-19T18:41:03.000Z",
"code": "spring-menu",
"country": "US",
"referrer": null,
"device": "mobile",
"via_qr": true,
"os": "ios",
"browser": "safari"
}
],
"next_before": null,
"next_cursor": null
}With format=csv the answer is text/csv, one row per click, sent as a file download: ts,code,country,referrer,device,via_qr,os,browser
2026-10-19T18:41:03.000Z,spring-menu,US,,mobile,true,ios,safari
Response fields
| Field | Type | Description |
|---|---|---|
clicks | ClickRow[] | Newest first, up to 5,000 per page. |
next_cursor | string, null | Pass as cursor for the next page. Preserves clicks with identical timestamps. Null on the last page. |
next_before | integer, null | Legacy exclusive timestamp cursor. Use next_cursor instead to preserve timestamp ties. |
Errors
| Status | Meaning |
|---|---|
| 400 | The body or query is invalid. details names each field. |
| 401 | The API key is missing, malformed or revoked. |
| 403 | The plan does not include this. details.upgrade names the plan that does. |
| 404 | No link by that id or ending in this account. |
| 429 | Either the key exceeded its requests-per-second limit (honor Retry-After), or a daily or plan quota is used up (details.reason). |

