Click Analytics

Retrieve detailed click event data for any link. Every click is recorded with geographic, device, and referrer information.

The Click Object

Each click event contains the following fields:

FieldTypeDescription
idstringUnique click event ID (UUID)
timestampstringISO 8601 timestamp of when the click occurred
countrystring | nullISO 3166-1 alpha-2 country code (e.g. "US", "DE", "JP")
citystring | nullCity name derived from geo-lookup
devicestring | nullDevice type: "desktop", "mobile", or "tablet"
osstring | nullOperating system (e.g. "Windows", "macOS", "iOS", "Android")
browserstring | nullBrowser name (e.g. "Chrome", "Safari", "Firefox")
referrerstring | nullThe referring URL (where the user came from)

Privacy Note

IP addresses are used only for geo-lookup during the click event and are never stored in the analytics database. Flyn is fully GDPR compliant.

Get Click Events

Returns paginated click events for a specific link, ordered newest first.

GET/api/links/:id/clicks

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe UUID of the link

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
limitnumberNoItems per page (1-1000, default: 100)
Request Example
curl "https://www.flyn.to/api/links/a1b2c3d4-.../clicks?page=1&limit=50" \
  -H "Authorization: Bearer flyn_sk_live_..."

Response (200)

Response
{
  "clicks": [
    {
      "id": "click-uuid-1",
      "timestamp": "2026-03-30T14:22:05.000Z",
      "country": "US",
      "city": "San Francisco",
      "device": "desktop",
      "os": "macOS",
      "browser": "Chrome",
      "referrer": "https://twitter.com"
    },
    {
      "id": "click-uuid-2",
      "timestamp": "2026-03-30T14:18:30.000Z",
      "country": "DE",
      "city": "Berlin",
      "device": "mobile",
      "os": "iOS",
      "browser": "Safari",
      "referrer": null
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 1423,
    "totalPages": 29,
    "hasMore": true
  }
}

Error Codes

ParameterTypeRequiredDescription
404errorNoLink not found or does not belong to your account
429errorNoRate limit exceeded (30 req/min)

Data Retention

PlanClick Data Retention
Free30 days
ProUnlimited

Real-Time Click Events

For real-time click tracking, use webhooks instead of polling. Subscribe to the link.click event to receive an HTTP POST to your endpoint within seconds of every click.

link.click Webhook Payload
{
  "event": "link.click",
  "timestamp": 1711929600000,
  "data": {
    "linkId": "a1b2c3d4-...",
    "slug": "my-campaign",
    "shortUrl": "https://flyn.to/my-campaign",
    "country": "US",
    "city": "San Francisco",
    "device": "desktop",
    "os": "macOS",
    "browser": "Chrome",
    "referrer": "https://twitter.com"
  }
}

SDK Example

TypeScript
async function getClicksCountsByCountry() {
  const res = await flyn.links.clicks('34a63508-39b3-4d43-9b91-fabf76d3ad80', {
    page: 1,
    limit: 100,
  });

  // Aggregate by country
  const byCountry = res.data.reduce((acc, c) => {
    const country = c.country || 'Unknown';
    acc[country] = (acc[country] || 0) + 1;
    return acc;
  }, {} as Record<string, number>);

  console.log(byCountry);
  // { US: 45, DE: 23, JP: 12, ... }
}

getClicksCountsByCountry();

Was this page helpful? Spotted something wrong?