Skip to Content
API ReferenceAnalyticsLink Analytics

Link Analytics

Get detailed click analytics for a specific link, including time series, geographic data, device breakdown, and referrer information.

GET /api/v1/analytics/:link_id

Authentication

Required.

Path Parameters

ParameterTypeDescription
link_idstring (UUID)The link’s unique identifier

Query Parameters

ParameterTypeRequiredDescription
startstringNoStart date (ISO 8601). Filters clicks from this date onward
endstringNoEnd date (ISO 8601). Filters clicks up to this date

Both start and end must be provided together for date filtering to apply.

Response

Returns comprehensive analytics data broken down by multiple dimensions.

Response Fields

FieldTypeDescription
link_idstringThe link ID
short_codestringThe link’s short code
total_clicksnumberTotal click count in the period
time_seriesarrayClicks per day
referrersarrayTop 10 referrer sources
countriesarrayTop 10 countries by clicks
citiesarrayTop 10 cities by clicks
devicesarrayDevice type breakdown (mobile, tablet, desktop)
browsersarrayTop 10 browsers
osarrayTop 10 operating systems

Examples

Full Analytics

curl "https://snipurl.click/api/v1/analytics/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer snip_live_your_key_here"

With Date Range

curl "https://snipurl.click/api/v1/analytics/550e8400-e29b-41d4-a716-446655440000?start=2025-06-01T00:00:00Z&end=2025-06-24T23:59:59Z" \ -H "Authorization: Bearer snip_live_your_key_here"
const linkId = '550e8400-e29b-41d4-a716-446655440000'; const start = '2025-06-01T00:00:00Z'; const end = '2025-06-24T23:59:59Z'; const response = await fetch( `https://snipurl.click/api/v1/analytics/${linkId}?start=${start}&end=${end}`, { headers: { 'Authorization': 'Bearer snip_live_your_key_here' } } ); const { data } = await response.json(); console.log(`Total clicks: ${data.total_clicks}`); console.log(`Top country: ${data.countries[0]?.country}`);
import requests link_id = '550e8400-e29b-41d4-a716-446655440000' params = { 'start': '2025-06-01T00:00:00Z', 'end': '2025-06-24T23:59:59Z', } response = requests.get( f'https://snipurl.click/api/v1/analytics/{link_id}', headers={'Authorization': 'Bearer snip_live_your_key_here'}, params=params, ) data = response.json()['data'] print(f"Total clicks: {data['total_clicks']}")

Response (200 OK):

{ "success": true, "data": { "link_id": "550e8400-e29b-41d4-a716-446655440000", "short_code": "a8Kx2m", "total_clicks": 1523, "time_series": [ {"date": "2025-06-01", "count": 45}, {"date": "2025-06-02", "count": 62}, {"date": "2025-06-03", "count": 58}, {"date": "2025-06-04", "count": 71} ], "referrers": [ {"referrer": "https://twitter.com", "count": 342}, {"referrer": "https://google.com", "count": 215}, {"referrer": null, "count": 189}, {"referrer": "https://reddit.com", "count": 87} ], "countries": [ {"country": "US", "count": 621}, {"country": "GB", "count": 198}, {"country": "DE", "count": 142}, {"country": "IN", "count": 98} ], "cities": [ {"city": "New York", "country": "US", "count": 89}, {"city": "London", "country": "GB", "count": 76}, {"city": "San Francisco", "country": "US", "count": 54} ], "devices": [ {"device_type": "desktop", "count": 845}, {"device_type": "mobile", "count": 598}, {"device_type": "tablet", "count": 80} ], "browsers": [ {"browser": "Chrome", "count": 712}, {"browser": "Safari", "count": 389}, {"browser": "Firefox", "count": 201}, {"browser": "Edge", "count": 142} ], "os": [ {"os": "Windows", "count": 534}, {"os": "macOS", "count": 312}, {"os": "iOS", "count": 298}, {"os": "Android", "count": 287}, {"os": "Linux", "count": 92} ] } }

Notes

  • A null referrer means direct traffic (no referrer header)
  • Country codes are 2-letter ISO 3166-1 alpha-2 (e.g., “US”, “GB”, “DE”)
  • Time series covers each day in the selected range that has at least 1 click
  • Results are limited to top 10 per dimension to keep response sizes manageable

Error Responses

StatusCodeDescription
404NOT_FOUNDLink not found or doesn’t belong to you
Last updated on