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. 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.
linksintegeroptionalHow many of the busiest links to list. Default 10.

Example request

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

Example response

{
  "days_requested": 30,
  "max_days": 30,
  "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
    }
  ],
  "links": [
    {
      "id": "lnk_7f0c2a2b4bb04a8b",
      "code": "spring-menu",
      "short_url": "https://snip.link/spring-menu",
      "title": "Spring menu",
      "url": "https://example.com/menus/spring-2026",
      "clicks": 412,
      "scans": 377
    }
  ],
  "links_total": 23
}

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.
linksobject[]The busiest links in the range, most clicks first (up to 100).
links_totalintegerLinks in the account.

Errors

StatusMeaning
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 the guide