Read analytics

THE CALL, PART BY PART

method

GET

host

strait.link

version

/v1

resource

/analytics

GET /v1/analytics

Auth: secret key as Authorization: Bearer. Server-side only.

Request

Taps, app opens, installs, conversions and revenue for your workspace in [from, to), for every link or one, optionally grouped by day, channel, link, platform, campaign, country or one of the five UTM tags. The numbers use the same definitions as the dashboard. Each item counts at its own time (a tap at its tap time, an install at its install time); days are UTC. Secret key only (a publishable key gets 401). At most 92 days per call and 30 calls a minute per workspace (429 with Retry-After).

Parameters

from string query
Inclusive start: ISO date (2026-10-01, UTC), ISO date-time or epoch ms. Default: 30 days before to.
to string query
Exclusive end, same formats. Default: now.
link string query
Only this link: an active link's slug, e.g. summer.
group "none" | "day" | "channel" | "link" | "platform" | "campaign" | "country" | "utm_source" | "utm_medium" | "utm_campaign" | "utm_term" | "utm_content" | "app_version" | "sdk_version" query
Split the numbers into rows. Default none (totals only). campaign is the link's campaign (as in the dashboard). country is the visitor's country from their network address (2-letter code; taps since 5 Nov 2026). utm_source, utm_medium, utm_campaign, utm_term, utm_content are the tap's UTM tags: the ones on the tapped link (?utm_medium=story), else the ones in its destination URL (taps since 5 Nov 2026; utm_source as tagged, where channel is cleaned and also uses the app or site the tap came from). App opens, installs and conversions take the country and UTM tags of the tap they came from. app_version and sdk_version are the app's and the Strait SDK's version an app open or install itself reported (appVersion / sdkVersion, accepted since 5 Nov 2026 from SDKs that send them); taps and conversions have no version, so they count under null, as do opens that sent none.

Response

  • 200 Totals, plus one row per group value (biggest first; by date for group=day). rows is empty for group=none.
  • 400 Bad from / to (or a range over 92 days), unknown group, malformed link
  • 401 Missing or invalid secret key, or a publishable key
  • 404 No active link with this slug in the key's workspace
  • 429 Over 30 calls a minute for this workspace
Request · curl
curl -X GET https://strait.link/v1/analytics \
  -H "Authorization: Bearer $SECRET_KEY"

The response, printed

Response 200
{
  "from": "2026-09-01T00:00:00.000Z",
  "to": "2026-10-01T00:00:00.000Z",
  "timezone": "UTC",
  "link": null,
  "group": "channel",
  "totals": {
    "taps": 1840,
    "billableTaps": 1795,
    "appOpens": 1210,
    "installs": 312,
    "conversions": 96,
    "revenue": {
      "INR": 48210
    }
  },
  "rows": [
    {
      "key": "whatsapp",
      "taps": 1320,
      "billableTaps": 1290,
      "appOpens": 905,
      "installs": 241,
      "conversions": 71,
      "revenue": {
        "INR": 35400
      }
    },
    {
      "key": "instagram",
      "taps": 380,
      "billableTaps": 368,
      "appOpens": 221,
      "installs": 52,
      "conversions": 19,
      "revenue": {
        "INR": 10010
      }
    },
    {
      "key": "direct",
      "taps": 140,
      "billableTaps": 137,
      "appOpens": 84,
      "installs": 19,
      "conversions": 6,
      "revenue": {
        "INR": 2800
      }
    }
  ]
}