---
title: "Get click analytics for a link"
method: GET
path: "/urls/{code}/stats"
tags: ["Analytics"]
---

# Get click analytics for a link

`GET /urls/{code}/stats`

## Request

- Base URL: `https://gajo.io/api/v1`
- URL: `https://gajo.io/api/v1/urls/{code}/stats`
- Auth: API key in header `x-api-key`

Click analytics for one of your links; bot and link-preview traffic is excluded. Free plans get `totalClicks`, `historyDays` (7) and 7 days of `clicksByDay`. Basic gets 90 days of history and Pro every day since the link was created, plus `topReferrers`, `deviceBreakdown`, `topCountries` and `topRegions`; those four fields are only present on Basic and Pro.

## Response `200`

Click analytics.

- UrlStatsResult: Envelope shared by every response.
  - `success` true, required: `true` when the request succeeded.
  - `message` string, nullable: Human-readable status or error message. Often `null` on reads.
  - `data` object, required: Click analytics for one link. Bot traffic (crawlers, link-preview unfurlers, AI fetchers, HTTP libraries) is excluded. Free plans receive `totalClicks`, `historyDays` (7) and `clicksByDay`. Basic receives 90 days of history and Pro every day since the link was created, plus `topReferrers`, `deviceBreakdown`, `topCountries` and `topRegions`, which are omitted entirely on Free.
    - `totalClicks` integer, required: All-time human clicks.
    - `historyDays` integer, required: Days covered by `clicksByDay`: 7 on Free, 90 on Basic, and on Pro every day since the link was created.
    - `clicksByDay` object[], required: Daily click counts, oldest first. Days with no clicks are omitted.
      - `date` string, date, required
      - `clicks` integer, required
    - `topReferrers` object[]: Basic and Pro only. Top 10 referrers; `Direct` when no referrer was sent.
      - `source` string, required
      - `count` integer, required
    - `deviceBreakdown` object[]: Basic and Pro only. Share of clicks per device class, as percentages (0-100) summing to 100.
      - `device` string, required
      - `percentage` number, double, required
    - `topCountries` object[]: Basic and Pro only. Top 10 countries by clicks (country name, or ISO code when the name is unknown).
      - `country` string, required
      - `count` integer, required
    - `topRegions` object[]: Basic and Pro only. Top 10 states/provinces, labelled `Region, CC`. May be empty.
      - `region` string, required
      - `count` integer, required

## Other responses

- `401`: The `x-api-key` header is missing, or the key is unknown or revoked.
- `404`: No link with this code on your account (links belonging to other accounts answer the same way).
- `429`: Per-minute rate limit exceeded. Wait `Retry-After` seconds.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/gajo/apis/gajo-api.md) · [All operations](https://skmtc.dev/gajo/apis/gajo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gajo/apis/gajo-api/revisions/de6fe920cc26?raw)
