Query click analytics (beta)

Beta. Replaces the deprecated /clicks and /segments endpoints. Fields and limits
can change while it is in beta. See
Migrate to the analytics query endpoint for how each
legacy call maps to this one.

Returns click counts for one workspace, set with the Workspace header. For account-wide
numbers, send one request per workspace and add the results.

What you can ask for:

  • Totals for a period: all clicks, clicks from people, QR scans, and bot clicks.
  • Breakdowns by link, referrer, channel, UTM parameter, location, language, device,
    platform, or browser, with sorting and pages of up to 100 rows.
  • Time series per hour, day, or month.
  • Filters on any of those dimensions, for example one link or one country.

Periods: from the last 24 hours to the last 12 months, or a custom range of up to
2 years with start_date and end_date, in UTC, within the analytics history on the
workspace owner's plan.

Access: owner, admin, user, or viewer of the workspace. The owner's plan must include
analytics history.

Examples:

  • Daily clicks for one link over 30 days:
    ?period=last_30_days&metrics=clicks,human_clicks,bot_clicks&granularity=day&filters[link_id]=<link_id>
  • Top 10 countries for the workspace over 30 days (the response example below):
    ?period=last_30_days&metrics=clicks&dimension=country_code&limit=10
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
enum

Required unless start_date and end_date are sent. The span to count, in UTC. Day periods end today, today included. Month periods are
whole calendar months ending with the current one. last_24_hours runs from the start
of the current hour minus 24 hours to the end of the current hour, so it has 25
hourly points and the last one is partial. A period longer than the plan's analytics
history gets 403. The response's range shows the exact span, which can start a few
days later than the first day of a month period when the plan's history is shorter.

Allowed:
date

First day of a custom range, used instead of period. Send it with end_date, and
not with period. A date (2026-11-01) or a date-time with a time zone, counted as
its UTC day. Send a + offset as %2B. Refused with 403 when it is after today,
after end_date, or before the plan's analytics history.

date

Last day of a custom range, included. Same format as start_date. A date after
today counts as today. The range can be at most 730 days.

metrics
array of strings, unique
required
length ≥ 1

Counts to return, as a comma-separated list or repeated as metrics[].

  • clicks: all clicks.
  • human_clicks: clicks from people.
  • human_qr: QR code scans from people.
  • bot_clicks: clicks from bots.
string
enum

Splits the counts into one row per value. Leave it out for one row covering the whole
workspace. Cannot be combined with granularity.

  • link_id rows carry link (shortUrl, destination) for links of this
    workspace; any other ID is labeled "Deleted link". Some workspaces have no
    per-link data; see the per_link_excluded caveat.
  • referrer_host rows carry channel: social, direct, email, search, or
    referral. unknown counts clicks with no referrer.
  • source_channel rows are those channel classes.
  • country_code rows are labeled with the country name, user_language_tag rows
    with the English language name, device_type rows with "Desktop" or "Other
    devices".
string
enum

Returns a series of counts per period. Only without dimension; hour only with
last_24_hours, last_7_days, last_30_days, or a custom range of 31 days or less.

Allowed:
filters
object

Limits the counts to the given values. Keys are the dimension values above.
Send several values by repeating the key:
filters[country_code][]=US&filters[country_code][]=PL. Commas are not separators.
A single value can be sent without []. Values of one key match any of them;
different keys must all match. device_type takes desktop or other;
source_channel takes social, direct, email, search, or referral. Keep the
URL short: for many links, split the IDs across requests.

sort
object

sort[metric] (one of the requested metrics) and sort[direction]. Defaults to the
first metric, descending. Only with dimension.

integer
1 to 100
Defaults to 10

Rows per page. Only with dimension.

integer
0 to 1000000
Defaults to 0

Rows to skip, for the next page. Only with dimension.

Headers
string
required

Workspace ID. The response covers this workspace only.

string
required

API key for authentication

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
// 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