---
title: "Get site analytics"
---

`GET https://app.specly.xyz/api/sites/{id}/analytics`

Returns the site's analytics for the last 7, 30 or 90 days, as JSON: one row a day for the whole site, the top
100 pages over the range, and the top 20 searches that found nothing. Needs a key with the `analytics:read` scope. A key
may make 60 calls a minute.

## Authorization

- `Authorization` (header): Bearer token

## Path parameters

- `id` (string, required): The site's ID, which is in its dashboard address.

## Query parameters

- `days` (enum<integer>, default: 30): How many days to include, counting today. Any other value gives 30. One of: `7`, `30`, `90`.

## Responses

### 200

The site's analytics.

`application/json`

- `site` (string, required): The site's ID.
- `days` (integer, required): The number of days in the range.
- `since` (string<date>, required): The first day in the range (UTC).
- `daily` (object[], required): One row for each day that has data, oldest first.
  - `day` (string<date>)
  - `views` (integer): Page views.
  - `readers` (integer): Readers
  - `agent_reads` (object): Reads by AI agents, as a count for each agent.
  - `searches` (integer)
  - `searches_found` (integer): Searches that found a page.
  - `helpful` (integer): "Yes" answers to "Was this helpful?".
  - `not_helpful` (integer): "No" answers to "Was this helpful?".
- `pages` (object[], required): The 100 most viewed pages over the range.
  - `path` (string)
  - `views` (integer)
  - `agent_reads` (integer)
  - `helpful` (integer)
  - `not_helpful` (integer)
- `searches_without_results` (object[], required): The 20 most searched queries that found nothing.
  - `query` (string)
  - `searches` (integer)
  - `last_day` (string<date>)

### 401

The key is missing, malformed, unknown or revoked.

`application/json`

- `error` (string, required): What went wrong.

### 403

The key can't be used on this site, or doesn't have the scope this call needs.

`application/json`

- `error` (string, required): What went wrong.

### 429

Too many requests from your address, or with this key. Wait a minute.

`application/json`

- `error` (string, required): What went wrong.

## Example request

```bash
curl --request GET \
  --url 'https://app.specly.xyz/api/sites/{id}/analytics?days=30' \
  --header 'Authorization: Bearer <token>'
```

## Example response (200)

```json
{
  "site": "2f6c1b8e-7d3a-4e55-b1c9-3a9d0c4e8f12",
  "days": 7,
  "since": "2026-10-20",
  "daily": [
    {
      "day": "2026-10-25",
      "views": 412,
      "readers": 138,
      "agent_reads": {
        "ChatGPT": 12
      },
      "searches": 40,
      "searches_found": 36,
      "helpful": 9,
      "not_helpful": 1
    }
  ],
  "pages": [
    {
      "path": "/get-started/quickstart",
      "views": 190,
      "agent_reads": 5,
      "helpful": 6,
      "not_helpful": 0
    }
  ],
  "searches_without_results": [
    {
      "query": "sso",
      "searches": 4,
      "last_day": "2026-10-24"
    }
  ]
}
```
