---
title: "List the sites this key can read"
method: GET
path: "/sites"
tags: ["Stats"]
---

# List the sites this key can read

`GET /sites`

## Request

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

Returns the sites the authenticating key may read — useful for discovering `site_id` values and token introspection. An all-sites key returns every accessible site (sorted by name); a single-site key returns just its one site (or an empty list if access was removed).

## Query parameters

- `date_range` string

## Response `200`

The accessible sites.

- SitesResponse
  - `sites` SiteSummary[], required
    - `site_id` integer, required: The numeric id you pass as `site_id` to /query.
    - `name` string, required: The site's domain. For the configured public demo site this is masked to `example.com` — see "The demo site is masked" in docs/public-api-v1.md; breakdown values carrying the host are masked the same way.
    - `hash` string, required: The site's public token, used by widget script URLs and the shared dashboard link. Integrations need it and previously had to parse it out of a widget snippet URL — which only worked for hobby sites, since a paid site's tracker URL is keyed by the numeric id.
    - `timezone` string, required: The site's reporting timezone.
    - `hobby` boolean, required: True for a site on the free plan. It decides how the site counts at all: a hobby site is tracked by the bundled `/t/` build (widget plus counter) carrying a `data-id` attribute, and an event reaching us from any other build is refused. Install `GET /sites/{id}/snippet` verbatim and this is handled for you; branch on it only if you build the tag yourself.
    - `stats_start_date` string, date, nullable: Stored value only (not computed on the fly); null if not yet computed.
    - `created_at` string, date-time
    - `stats` SiteStats
      - `date_range` string
      - `metrics` object

## Other responses

- `401`: Missing/malformed/invalid/revoked bearer token (`unauthorized`), or a key past its expiry (`key_expired`; the message names the expiry time).
- `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)
