---
title: "Live count of visitors active in the last 5 minutes"
method: GET
path: "/current-visitors"
tags: ["Stats"]
---

# Live count of visitors active in the last 5 minutes

`GET /current-visitors`

## Request

- Base URL: `https://statable.com/api/v1`
- URL: `https://statable.com/api/v1/current-visitors`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/statable/apis/statable-stats-api/docs/current-visitors/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `site_id` integer

## Response `200`

Realtime unique-visitor count.

- object
  - `site_id` integer
  - `visitors` integer

## Other responses

- `400`: Invalid request. Branch on the stable `code`: invalid_request, metrics_required, unknown_metric, too_many_dimensions, unknown_dimension, invalid_date_range, invalid_interval, metric_not_available, invalid_filter, event_filter_required, invalid_compare, compare_length_mismatch, site_id_required, limit_offset_misuse.
- `401`: Missing/malformed/invalid/revoked bearer token (`unauthorized`), or a key past its expiry (`key_expired`; the message names the expiry time).
- `403`: `insufficient_scope` (the key lacks the `read` scope every endpoint here requires), `key_not_scoped` (single-site key asked for a different site), `tracking_inactive` (the site's tracking has stopped) or `plan_expired` (the site owner's plan has expired: tracking may still run through the grace period, but reports are closed until the owner chooses a plan).
- `404`: `unknown_site` — the `site_id` does not exist OR the key's owner has no access. Deliberately indistinguishable (same status AND code) so a key cannot enumerate which site_ids exist. `unknown_funnel` (funnel endpoints only) — the funnel id is not found for the resolved site.
- `429`: Hourly account (default 2000/h) or per-key (default 600/h) limit hit (`rate_limited`). Retry after the `Retry-After` seconds. The X-RateLimit-* headers report the window that tripped (account on an account limit).
- `500`: Unexpected server error (`internal`). Report it with the `request_id` from the body or the X-Request-ID header: it is what lets the exact log entry be found, and without it a 500 can only be matched by guessing at a time window.

---

[API](https://skmtc.dev/statable/apis/statable-stats-api.md) - [All operations](https://skmtc.dev/statable/apis/statable-stats-api/llms.txt) - [OpenAPI document](https://skmtc.dev/statable/apis/statable-stats-api/revisions/352b6d47c186?raw)
