Migrate to the analytics query endpoint

Move from the deprecated clicks and segments endpoints to GET /analytics/query

The /clicks and /segments endpoints for accounts, workspaces, domains, tags, teammates, and links are deprecated, including the link-level calls that are not listed in the API reference. They still work today. Their data will stop updating on a date we will announce on this page, so plan your move now. Use Query click analytics (GET /v1/analytics/query, beta) instead. This page shows how each legacy call maps to the new endpoint and what is not available yet.

What changes

Legacy /clicks and /segmentsGET /analytics/query
ScopeAccount, workspace, domain, tag, teammate, or link in the pathOne workspace per request, set with the Workspace header. Narrow it with filters, for example filters[link_id]
Time rangeFixed by group: last 48 hours, last 30 days, or about 24 monthsperiod: last_24_hours to last_12_months, or start_date and end_date for up to 2 years, within your plan's analytics history
BreakdownsShare of all-time clicks per value (weight, adds up to 1)Click counts per value for the chosen period
Metricsclicks, and QR scans on some callsclicks, human_clicks, human_qr, bot_clicks
AccessAdvanced analytics on the plan (none for link-level calls)The workspace owner's plan sets how much history you see, from 30 days up to 2 years

Time series

Legacy calls without group return hourly points.

Legacy callNew request
GET /links/{link_id}/clicks?group=days (not listed in the API reference)GET /analytics/query?period=last_30_days&metrics=clicks&granularity=day&filters[link_id]={link_id}
GET /workspaces/{workspace_id}/clicks?group=hoursWorkspace: {workspace_id} and ?period=last_24_hours&metrics=clicks&granularity=hour. Returns 25 hourly points, the last one partial, instead of 48: for 48 hourly points, use period=last_7_days and keep the last 48
GET /workspaces/{workspace_id}/clicks?group=daysWorkspace: {workspace_id} and ?period=last_30_days&metrics=clicks&granularity=day
GET /workspaces/{workspace_id}/clicks?group=monthsWorkspace: {workspace_id} and ?period=last_12_months&metrics=clicks&granularity=month. For up to 730 days (about 24 months), use start_date and end_date instead of period
GET /account/clicksOne request for each workspace you own, as above. Add the results together

The legacy response is a list of { "key", "clicks" } points. The new response returns the points in rows[0].series, with an ISO 8601 period for each. Shortened example, without range, coverage, caveats, and freshnessBoundary:

{
  "granularity": "day",
  "total": { "clicks": 218 },
  "rows": [
    {
      "key": null,
      "label": null,
      "metrics": { "clicks": 218 },
      "series": [
        { "period": "2026-11-30T00:00:00Z", "metrics": { "clicks": 120 } },
        { "period": "2026-12-01T00:00:00Z", "metrics": { "clicks": 98 } }
      ]
    }
  ]
}

Breakdowns

Legacy breakdowns return the all-time share of clicks per value. The new endpoint returns counts for the period you request. To get a share, divide each row's metric by total.

Legacy groupNew dimension
countriescountry_code
regionsregion_name
citiescity_name
languagesuser_language_tag
browsersbrowser
platformsdevice_platform
devicesdevice_type (desktop or other)
sourcessource_channel, or referrer_host for the referring site
socialsreferrer_host with filters[source_channel]=social

Region and city rows carry the name only, and the same name can exist in several countries. Add filters[country_code] to tell them apart.

Social rows are referring hosts, not network names, so one network can span several hosts. Social clicks without a referrer are counted in unknown.

For a breakdown of one link, add filters[link_id]={link_id}. A breakdown of one link works up to last_30_days; longer periods can time out with 503. A link_id that does not exist or belongs to another workspace returns zero counts. For example, the top 10 countries of one link over the last 30 days:

GET /v1/analytics/query?period=last_30_days&metrics=clicks&dimension=country_code&filters[link_id]={link_id}&limit=10
apikey: YOUR_API_KEY
Workspace: YOUR_WORKSPACE_ID

Not available yet

  • Tag, domain, and teammate scope. There is no filter by tag, branded domain, or teammate. Filter by the IDs of the links in the tag or domain with filters[link_id]. Totals and time series are exact when you split many links across requests and add the counts. Top lists merged across requests are approximate, because a value outside each request's top rows can still belong in the overall top.
  • Weekday and hour-of-day breakdowns (weekdays, dayhours). Group an hourly series (granularity=hour, up to last_30_days, in UTC) by weekday or hour yourself.
  • All-time totals. Periods are limited by your plan's analytics history.
  • History beyond 2 years. The longest range is 730 days, set with start_date and end_date.

Before you switch

  • Send the Workspace header on every request. Without it, the endpoint returns 403, or 404 if your account has no default workspace.
  • Check how much history the workspace owner's plan includes, from 30 days up to 2 years. Link-level calls had no plan limit before, so a smaller plan now sees less history for a link. A plan without analytics history gets 403.
  • Some workspaces have no per-link data. There, a link_id breakdown or filter returns the per_link_excluded caveat: treat those counts as unavailable, not as zero.
  • On 429, back off and retry after the time in the Retry-After header.
  • Counts can differ from the legacy endpoints. Compare both for a few days before you switch.
  • The endpoint is in beta. Fields and limits can change before it is generally available.

Did this page help you?
// Bulk plan CTA banner: requested by Alison to promote the high-volume pricing plan. Injected in Footer HTML per ReadMe convention, but renderd at the top of the viewport via the fixed-position CSS above.
Sending 250K+ links a year? You qualify for a better rate. See high-volume pricing