Back to Docs

Analytics

Every link you create tracks clicks automatically. Here's what data is available and how to use it.

Click Tracking

Every time someone visits your short link, LinkSnap records a click event with metadata — timestamp, country, device type, browser, and referrer. No JavaScript snippets or extra setup required.

View stats in the dashboard or via the API:

GET /api/v1/links/:id/stats

# CLI
linksnap stats my-link

Country Breakdown

See where your clicks come from. Country is determined from the visitor's IP address using GeoIP lookup. The response includes a map of country codes to click counts:

"countries": {
  "US": 450,
  "ID": 320,
  "GB": 210,
  "DE": 95,
  "JP": 78
}

Device & Browser Stats

Understand how visitors access your links. Device type (mobile, desktop, tablet) and browser are parsed from the User-Agent header.

"devices": {
  "mobile": 580,
  "desktop": 420,
  "tablet": 53
}

"browsers": {
  "Chrome": 510,
  "Safari": 340,
  "Firefox": 120,
  "Edge": 83
}

Referrer Tracking

See which websites and platforms are sending traffic to your links. The referrer is extracted from the HTTP Referer header. Direct visits (no referrer) are grouped as "direct".

"referrers": {
  "twitter.com": 230,
  "direct": 180,
  "linkedin.com": 95,
  "facebook.com": 72,
  "google.com": 41
}

Date Range Filtering

Filter analytics to a specific time period using the from and to query parameters (ISO 8601 dates).

GET /api/v1/links/:id/stats?from=2026-03-01&to=2026-03-31

The response includes a timeSeries array with daily click counts within the range:

"timeSeries": [
  { "date": "2026-03-01", "clicks": 12 },
  { "date": "2026-03-02", "clicks": 18 },
  { "date": "2026-03-03", "clicks": 9 }
]

Exporting Analytics

On Pro and Business plans, you can export raw click data as CSV or JSON:

GET /api/v1/links/:id/stats/export?format=csv
GET /api/v1/links/:id/stats/export?format=json&from=2026-01-01&to=2026-03-31