API reference

Analytics

The same click data as your dashboard: totals, unique visitors, devices, operating systems, browsers, countries, referrers, UTM campaigns, and a daily series.

What a click measures

A click is a request to your short link. Known bots and link-preview fetchers are recorded but excluded from every figure here. A click doesn’t prove that the app opened, or that someone installed, subscribed, or purchased. Use your destination’s analytics for those outcomes. Smart Link forwards utm_* parameters to help. See how app opening works for more detail.

Choosing a range

Both endpoints accept the same range parameters. A range can span at most 366 days. Longer or reversed ranges return 400 VALIDATION_ERROR. All buckets use UTC.

Range parameters
NameTypeDescription
daysintegerLook back this many days, 1-366. Default 30.
fromstring (ISO 8601)Start of the range. When set, days is ignored.
tostring (ISO 8601)End of the range. Default now. A date like 2026-09-30 includes that whole day (UTC).

totalClicks, clicksToday, clicksThisWeek, and clicksThisMonth are fixed windows and ignore the range. Everything else, including the breakdown percentages, is relative to clicksInPeriod.

Analytics across all links

GET/api/v1/analytics

Returns the same fields as above without url and clicksByHour. It adds totalUrls, activeUrls, and topUrls, which lists your 10 most-clicked links in the range.

curl "https://smartlink.sh/api/v1/analytics?days=30" \
  -H "Authorization: Bearer $SMARTLINK_API_KEY"