Stats

Per-link stats

bash
curl "https://rzwn.link/api/links/example/stats?days=30" \
  -H "Authorization: Bearer $API_TOKEN"
daysintegerquerydefault: 30

Lookback window for the range-scoped fields below. Max 365.

jsonc
{
  "slug": "abc1234",
  "totalClicks": 42, // all-time
  "lastClickedAt": "2026-07-24T12:34:56.000Z",
  "botHitCount": 3, // link-unfurling crawler hits, never counted as clicks
  "ogFetchFailCount": 0, // consecutive failed OG scrapes of the destination URL
  "range": {
    "days": 30,
    "since": "2026-06-24T00:00:00.000Z",
    "clicks": 40, // clicks within the range
    "uniqueVisitors": 31 // distinct daily-hashed visitors within the range
  },
  "lifetime": {
    "firstDayClicks": 12, // clicks in the first 24h after the link was created
    "totalClicks": 42
  },
  "clicksByDay": [{ "date": "2026-07-20", "count": 5 } /* ... */],
  "topReferrers": [{ "referrer": "Direct", "count": 20 } /* ... */],
  "topCountries": [{ "country": "US", "count": 30 } /* ... */],
  "devices": [{ "device": "mobile", "count": 25 } /* ... */],
  "browsers": [{ "browser": "Safari", "count": 28 } /* ... */],
  "operatingSystems": [{ "os": "iOS", "count": 25 } /* ... */],
  "locales": [{ "locale": "en-US", "count": 30 } /* ... */],
  "utmSources": [{ "source": "newsletter", "count": 10 }, { "source": "None", "count": 30 }],
  "utmMediums": [{ "medium": "email", "count": 10 } /* ... */],
  "utmCampaigns": [{ "campaign": "launch", "count": 10 } /* ... */],
  "recentClicks": [
    {
      "createdAt": "2026-07-24T12:34:56.000Z",
      "referrer": "https://twitter.com/",
      "country": "US",
      "region": "CA",
      "city": "San Francisco",
      "device": "mobile",
      "browser": "Safari",
      "os": "iOS",
      "locale": "en-US",
      "utmSource": null,
      "utmMedium": null,
      "utmCampaign": null
    }
    // up to 20, most recent first
  ]
}

Global stats

bash
curl https://rzwn.link/api/stats \
  -H "Authorization: Bearer $API_TOKEN"
jsonc
{
  "totalLinks": 12,
  "totalClicks": 340,
  "totalBotHits": 25,
  "clicksToday": 7,
  "topLinks": [ /* top 5 links by clickCount */ ]
}

Campaign tracking

Append utm_source, utm_medium, and/or utm_campaign to the short link itself (e.g. https://rzwn.link/abc1234?utm_source=newsletter) to break down clicks on the same link by channel. These are read from the incoming request, not the destination URL, so the same slug can be shared in multiple places while still attributing clicks correctly.

Notes

  • No raw IP addresses are ever stored. uniqueVisitors is derived from a salted hash of IP + day, rotated daily, purely for approximate unique-visitor counts.
  • country/region/city come from Vercel's edge geolocation headers and will be null in local development.
  • locale is the primary language subtag from the visitor's Accept-Language header (e.g. en-US), and will be null if the header is absent.
  • See Redirect behavior for what does and doesn't count as a click.