Skip to content

Documentation

Account analytics

GET/v1/statsAnalytics

Every link in the account summed: totals, by UTC day, the busiest links, and the top countries, referring hosts and devices. Optional country, referrer, device and channel filters apply to every total and breakdown. Free shows 30 days; Pro shows 365. hours (clicks by hour of the UTC day) is present on Pro. Also available as the MCP tool get_account_stats.

Parameters

ParameterTypeRequiredDescription
daysintegeroptionalHow 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.
countrystringoptionalExact two-letter country code, or unknown for missing country.
referrerstringoptionalExact referring hostname, or direct for no referrer. No URL path.
devicestringoptionalExact device class: desktop, mobile or tablet.
channelstringoptionalqr for marked QR scans, link for ordinary link clicks. Omit for both.
linksintegeroptionalHow many of the busiest links to list. Default 10.

Example request

Terminal
curl "https://snip.link/v1/stats?days=30" \
  -H "Authorization: Bearer $SNIP_KEY"

Example response

Response
{
  "days_requested": 30,
  "max_days": 30,
  "filter_options": {
    "countries": ["CA", "US"],
    "referrers": ["direct", "instagram.com"],
    "devices": ["desktop", "mobile"]
  },
  "total": 412,
  "via_qr": 377,
  "days": [
    {
      "day": "2026-10-18",
      "clicks": 61,
      "scans": 58
    },
    {
      "day": "2026-10-19",
      "clicks": 74,
      "scans": 70
    }
  ],
  "countries": [
    {
      "key": "US",
      "clicks": 390
    },
    {
      "key": "CA",
      "clicks": 14
    }
  ],
  "referrers": [
    {
      "key": "direct",
      "clicks": 401
    },
    {
      "key": "instagram.com",
      "clicks": 11
    }
  ],
  "devices": [
    {
      "key": "mobile",
      "clicks": 388
    },
    {
      "key": "desktop",
      "clicks": 24
    }
  ],
  "operating_systems": [
    {
      "key": "ios",
      "clicks": 251
    },
    {
      "key": "android",
      "clicks": 137
    },
    {
      "key": "windows",
      "clicks": 24
    }
  ],
  "browsers": [
    {
      "key": "safari",
      "clicks": 240
    },
    {
      "key": "chrome",
      "clicks": 150
    },
    {
      "key": "instagram",
      "clicks": 22
    }
  ],
  "links": [
    {
      "id": "lnk_7f0c2a2b4bb04a8b",
      "code": "spring-menu",
      "short_url": "https://go.snip.link/spring-menu",
      "title": "Spring menu",
      "url": "https://example.com/menus/spring-2026",
      "clicks": 412,
      "scans": 377
    }
  ],
  "links_total": 23,
  "activeLinkCount": 1
}

Response fields

FieldTypeDescription
days_requestedinteger
max_daysintegerThe longest range the plan allows.
totalintegerClicks in the range, QR scans included.
via_qrintegerHow many of them were QR scans.
daysobject[]One row per UTC day with at least one click, oldest first.
hoursobject[]Clicks by hour of the UTC day (0 to 23), summed over the range. Plans with time-of-day analytics only.
countriesobject[]Top ten ISO country codes.
referrersobject[]Top ten referring hosts; direct when there was none.
devicesobject[]mobile, tablet or desktop.
operating_systemsobject[]ios, android, windows, macos, linux, chromeos or other, read from the user agent at the click (never stored); unknown for clicks before October 2026.
browsersobject[]chrome, safari, firefox, edge, samsung, opera, the in-app browsers instagram, facebook and tiktok, or other; unknown for clicks before October 2026.
filter_optionsobjectAvailable exact values in this account or link and time range, before filters. Unknown country is unknown; absent referrer is direct.
linksobject[]The busiest links in the range, most clicks first (up to 100).
links_totalintegerLinks in the account.
activeLinkCountintegerDistinct links with clicks matching the filters and range, independent of the busiest-links limit.

Errors

StatusMeaning
400The body or query is invalid. details names each field.
401The API key is missing, malformed or revoked.
429Either the key exceeded its requests-per-second limit (honor Retry-After), or a daily or plan quota is used up (details.reason).

Back to getting started