Skip to content

API reference

Every route of the Stats API: what it takes, what it answers, and the errors it can give.

Every route is a GET under https://app.crustat.com/api/v1/ and answers JSON. Start with The Stats API for API keys, errors and limits.

Your sites

GET /api/v1/sites

The sites you can read, oldest first. A site’s id is the one in its tracking code: pass it as site to every stats route. timezone is the zone its days and hours are in.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/sites"

Example answer

{
  "sites": [
    {
      "id": "AbC123_-xyzXYZ01",
      "name": "Example",
      "domain": "example.com",
      "timezone": "Europe/Chisinau"
    }
  ]
}

Errors

  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

Overview

GET /api/v1/stats/overview

The headline numbers for the range and for the period before it, visitors right now, the visitors chart, the first rows of the four lists (sources, countries, pages, browsers), and the visits left out as bots.

Parameters

  • site (required) — text. The site’s ID, from its tracking code or from /sites.
  • range (optional) — today, 7d, 30d (default 7d). Today, the last 7 days or the last 30 days, in the site’s time zone.
  • host (optional) — text. One of the site’s hostnames, to see its visits only.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/stats/overview?site=AbC123_-xyzXYZ01&range=7d"

Example answer

{
  "site": "AbC123_-xyzXYZ01",
  "range": "7d",
  "current": {
    "visitors": 1240,
    "pageviews": 3100,
    "bounce": 42,
    "time": 114
  },
  "previous": {
    "visitors": 1051,
    "pageviews": 2800,
    "bounce": 45,
    "time": 98
  },
  "online": 3,
  "series": {
    "metric": "visitors",
    "points": [
      {
        "t": "2026-09-21T00:00:00.000Z",
        "value": 170
      }
    ]
  },
  "tops": {
    "channel": [
      {
        "name": "Search",
        "visitors": 508,
        "pageviews": 700
      }
    ],
    "country": [
      {
        "name": "RO",
        "visitors": 300,
        "pageviews": 500
      }
    ],
    "page": [
      {
        "name": "/pricing",
        "visitors": 600,
        "pageviews": 900
      }
    ],
    "browser": [
      {
        "name": "Chrome",
        "visitors": 700,
        "pageviews": 1800
      }
    ]
  },
  "filtered": {
    "total": 62,
    "reasons": {
      "dc": 48,
      "auto": 9,
      "host": 5
    }
  }
}

Errors

  • 400 A parameter is missing or isn’t one of its values.
  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 402 The workspace has no plan: its trial ended or it was deactivated. Choosing a plan opens the stats again.
  • 404 No such route, or no such site among the ones you can read.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

One list

GET /api/v1/stats/breakdown

Any list of the dashboard, by dim: up to limit rows, most visitors first. pageviews is the row’s own count: page views for pages, entries for entry pages, clicks for exit links. page and entry rows carry the host they’re on unless you pass host. Campaign rows carry their source and medium in sub.

Parameters

  • site (required) — text. The site’s ID, from its tracking code or from /sites.
  • range (optional) — today, 7d, 30d (default 7d). Today, the last 7 days or the last 30 days, in the site’s time zone.
  • dim (required) — channel, referrer, campaign, country, region, city, page, entry, exit, browser, os, device, event, host. Which list.
  • limit (optional) — 1 to 100 (default 10). How many rows at most.
  • q (optional) — up to 100 characters. Only rows whose name matches this search.
  • host (optional) — text. One of the site’s hostnames, to see its visits only.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/stats/breakdown?site=AbC123_-xyzXYZ01&range=7d&dim=page"

Example answer

{
  "dim": "city",
  "rows": [
    {
      "name": "Cluj",
      "visitors": 12,
      "pageviews": 30
    }
  ]
}

Errors

  • 400 A parameter is missing or isn’t one of its values.
  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 402 The workspace has no plan: its trial ended or it was deactivated. Choosing a plan opens the stats again.
  • 404 No such route, or no such site among the ones you can read.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

One number over time

GET /api/v1/stats/series

The chart of one headline number: one point an hour for today, one a day for 7d and 30d. t is the start of the hour or day in the site’s time zone, written as a UTC time.

Parameters

  • site (required) — text. The site’s ID, from its tracking code or from /sites.
  • range (optional) — today, 7d, 30d (default 7d). Today, the last 7 days or the last 30 days, in the site’s time zone.
  • metric (required) — visitors, pageviews, bounce, time. Which number: visitors, page views, bounce rate (whole %) or average time on site (seconds).
  • host (optional) — text. One of the site’s hostnames, to see its visits only.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/stats/series?site=AbC123_-xyzXYZ01&range=7d&metric=visitors"

Example answer

{
  "metric": "visitors",
  "points": [
    {
      "t": "2026-09-21T00:00:00.000Z",
      "value": 42
    }
  ]
}

Errors

  • 400 A parameter is missing or isn’t one of its values.
  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 402 The workspace has no plan: its trial ended or it was deactivated. Choosing a plan opens the stats again.
  • 404 No such route, or no such site among the ones you can read.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

When people came

GET /api/v1/stats/hours

Visitors in each local hour of each day of the range, in the site’s time zone: 24 numbers a day, midnight first. weekday is 0 (Sunday) to 6 (Saturday).

Parameters

  • site (required) — text. The site’s ID, from its tracking code or from /sites.
  • range (optional) — today, 7d, 30d (default 7d). Today, the last 7 days or the last 30 days, in the site’s time zone.
  • host (optional) — text. One of the site’s hostnames, to see its visits only.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/stats/hours?site=AbC123_-xyzXYZ01&range=7d"

Example answer

{
  "days": [
    {
      "day": "2026-09-27",
      "weekday": 0,
      "hours": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        3,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    }
  ]
}

Errors

  • 400 A parameter is missing or isn’t one of its values.
  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 402 The workspace has no plan: its trial ended or it was deactivated. Choosing a plan opens the stats again.
  • 404 No such route, or no such site among the ones you can read.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

Right now

GET /api/v1/stats/live

People with a page view in the last 5 minutes, with the pages they’re on, where they came from and their countries. A source of "" is Direct.

Parameters

  • site (required) — text. The site’s ID, from its tracking code or from /sites.
  • host (optional) — text. One of the site’s hostnames, to see its visits only.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/stats/live?site=AbC123_-xyzXYZ01"

Example answer

{
  "visitors": 3,
  "pages": [
    {
      "name": "/pricing",
      "visitors": 2,
      "pageviews": 2
    }
  ],
  "sources": [
    {
      "name": "",
      "visitors": 2,
      "pageviews": 2
    }
  ],
  "countries": [
    {
      "name": "DE",
      "visitors": 3,
      "pageviews": 3
    }
  ]
}

Errors

  • 400 A parameter is missing or isn’t one of its values.
  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 402 The workspace has no plan: its trial ended or it was deactivated. Choosing a plan opens the stats again.
  • 404 No such route, or no such site among the ones you can read.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

The last 30 minutes

GET /api/v1/stats/live/minutes

People on the site in each of the last 30 minutes, oldest first; the last point is this minute.

Parameters

  • site (required) — text. The site’s ID, from its tracking code or from /sites.
  • host (optional) — text. One of the site’s hostnames, to see its visits only.

Example request

curl -H "Authorization: Bearer $CRUSTAT_API_KEY" \
  "https://app.crustat.com/api/v1/stats/live/minutes?site=AbC123_-xyzXYZ01"

Example answer

{
  "points": [
    {
      "t": "2026-09-27T14:29:00.000Z",
      "value": 0
    },
    {
      "t": "2026-09-27T14:30:00.000Z",
      "value": 2
    }
  ]
}

Errors

  • 400 A parameter is missing or isn’t one of its values.
  • 401 No valid API key and not signed in, the key was revoked, or the person it belongs to is no longer in the workspace.
  • 402 The workspace has no plan: its trial ended or it was deactivated. Choosing a plan opens the stats again.
  • 404 No such route, or no such site among the ones you can read.
  • 429 More than 120 requests in a minute. Wait the seconds in Retry-After.
  • 5XX Something went wrong on our side (500), or the stats couldn’t be loaded (502). Try again in a moment.

Still stuck? Write to hello@crustat.com.

All articles
The mascot waiting

Almost ready

We're opening to everyone soon.

Crustat is in its final checks before we open sign-ups. Leave your email and we'll write once, the day it opens, with your 14 days free waiting.

One email when we open. No newsletter. See our privacy page.