Analytics
Get link analytics
Click analytics for a single link: totals plus breakdowns by country, device, browser, referrer, and operating system. Requires a plan with Analytics API access (Advanced plan or above).
GET https://u2l.ai/api/v1/analytics/{domain}/{slug}
Authorizations
Authorizationstringrequired
Bearer authentication header of the form Bearer <token>, where <token> is your U2L API key (u2l_live_...). Create one in the dashboard under Settings > API.
Path Parameters
domainstringrequired
The link's domain (e.g. u.gy or u2l.ai).
slugstringrequired
The link's slug (the part after the domain).
Query Parameters
timeRangeinteger
Number of days to include in clicksInRange and the breakdowns. Use 0 for all time. Defaults to 30.
Response 200
totalClicksinteger
All-time clicks.
clicksInRangeinteger
Clicks within timeRange.
clicksTodayinteger
clicksThisWeekinteger
timeRangeinteger
The requested range in days (0 = all time).
countriesobject[]
countries[].countrystring
countries[].clicksinteger
devicesobject
Clicks per device type (mobile / desktop / tablet).
browsersobject[]
browsers[].browserstring
browsers[].clicksinteger
referrersobject[]
referrers[].referrerstring
referrers[].clicksinteger
osobject[]
os[].osstring
os[].clicksinteger
Errors
401 Missing or invalid API key.
403 Your plan does not include this feature, or a limit was reached.
404 The resource does not exist or is not yours.
429 Rate limit exceeded. Check X-RateLimit-Reset for when the window resets.
See Rate Limits & Errors for the error envelope and per-plan limits.