---
title: "Read API: stats, visitors, funnels and insights"
description: "Read your DataPocket analytics over HTTPS with an API key: sites, overview, time series, breakdowns, goals, funnels, visitors, journeys, bots, realtime, annotations and the latest insights report. Parameters, limits and errors."
url: "https://datapocket.vo1d.studio/reference/read-api"
lang: "en"
updated: "2026-11-16"
---

# Read API: stats, visitors, funnels and insights

Call `GET /api/v1/stats/overview`, `/stats/breakdown?dim=source` and the other read endpoints with `Authorization: Bearer dpk_…` (or an account token `dpt_…` plus `site_id`). They take the dashboard's `period`, `from`/`to`, `g` and `f` parameters and answer `{"status": "success", "data": …}`. Any team member's key with the read scope works; keys are read-only by default.

## Authentication

Every endpoint is `GET` and needs a key with the read scope (all keys have it). A site key (`dpk_…`) reads its own site. An account token (`dpt_…`) reads any site you're a member of: pass the site's public id as `?site_id=dp_…`, and list them with `GET /api/v1/sites`. Your membership and role are checked on every request, so a key stops working on a site as soon as you leave it. Keys see what the dashboard shows any team member, viewers included.

```bash
curl https://datapocket.vo1d.studio/api/v1/stats/overview?period=7d \
  -H "Authorization: Bearer dpk_…"
```

## Untrusted text in responses

Page paths, referrers, UTM values, goal names and properties, link targets, visitor identity names and emails, annotation text and parts of insight findings come from your visitors' browsers or your own calls, and anyone can put any text in them. They're returned as separate JSON fields and never joined into sentences, but if you hand responses to an AI model, treat those fields as data, not instructions.

## Period and filters

Endpoints that read a period take the same parameters as the dashboard URL. Invalid values are a 400 with a message, never a silent fallback.

| Parameter | Notes |
|---|---|
| `period` | `now`, `today`, `yesterday`, `24h`, `7d`, `30d` (default), `wtd`, `mtd`, `90d`, `180d`, `12m`, `ytd`, `all`, or `custom`. Periods are in the site's timezone. |
| `from`, `to` | `YYYY-MM-DD`, inclusive, for `period=custom` (`from` alone implies it; `to` defaults to `from`). At most 1,098 days. |
| `g` | Bucket size for series: `minute`, `hour`, `day`, `week`, `month`. Ignored when the period doesn't allow it; `range.allowed_granularities` in the response says which do. |
| `f` | Filters as `dim:op:value`, several values joined with `|`, several filters with `,` (at most 20). Operators `is`, `is_not`, `contains`, `not_contains`. URI-encode values that contain `,` `:` `|`. Example: `f=country:is:US|DE,page:contains:%2Fblog`. |

Filter dimensions: `channel`, `source`, `referrer`, `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `ref`, `via`, `country`, `region`, `city`, `browser`, `os`, `device`, `hostname`, `page`, `entry_page`, `exit_page`, `goal`, `visit_count`, `goal_prop` (`goal:key=value`).

Responses for a period carry `range`: `period`, `label`, `from` and `to` (ISO 8601, `to` exclusive), `granularity`, `allowed_granularities` and `timezone`. Money is in the site's `currency`, in its ISO minor units (cents for USD and EUR, yen for JPY, fils for KWD).

## Endpoints

| Endpoint | Returns |
|---|---|
| `GET /api/v1/sites` | Sites the key can read: `site_id`, `name`, `domain`, `timezone`, `currency`, `role`. One site for a site key. |
| `GET /api/v1/site` | The same fields for one site. |
| `GET /api/v1/stats/overview` | Visitors, visits, pageviews, bounce rate, visit duration, revenue, customers and conversion rate for the period, with the previous period and the number online now. |
| `GET /api/v1/stats/timeseries` | The same metrics per bucket (`g`). |
| `GET /api/v1/stats/breakdown?dim=source` | Top values of one dimension (the filter dimensions except `goal`, `visit_count`, `goal_prop`). `limit` 1-500 (default 10), `sort=visitors|revenue`, `search`. |
| `GET /api/v1/stats/goals` | Goals with visitors, completions and conversion rate. `limit` 1-200 (default 50). For a goal over time use `/stats/timeseries?f=goal:is:signup`. |
| `GET /api/v1/stats/goal-properties?goal=signup` | Up to 10 property keys of a goal with their 10 most common values. |
| `GET /api/v1/stats/funnels` | Saved funnels and their steps. |
| `GET /api/v1/stats/funnels/{id}` | Visitors at each step of one funnel in the period. |
| `GET /api/v1/stats/visitors` | Visitors active in the period, latest first, with identity when known. `goal`, `customers=1`, `search`, `limit` 1-200 (default 25), `offset`; page while `more` is true. |
| `GET /api/v1/stats/journeys?goal=signup` | Visitors who completed a goal and how long it took. `limit` 1-100 (default 20). |
| `GET /api/v1/stats/goal-users` | Visitors who completed the most goals. `limit` 1-100 (default 20). |
| `GET /api/v1/stats/exit-links` | Outbound links clicked. `limit` 1-500 (default 10). |
| `GET /api/v1/stats/bots?category=answer` | Crawler hits per category (`answer`, `index`, `training`, `other`) and the top 12 providers and pages of one. |
| `GET /api/v1/stats/realtime` | Visitors active in the last 5 minutes, the latest 40 events, top sources, countries and devices. No period. |
| `GET /api/v1/annotations` | Chart notes and uptime outages on days in the period (up to 200). |
| `GET /api/v1/insights` | The latest insights report as your team sees it, findings marked `dismissed` where hidden. `data` is null before the first report. Reading never starts an analysis. |

```bash
curl "https://datapocket.vo1d.studio/api/v1/stats/breakdown?dim=utm_campaign&period=custom&from=2026-10-01&to=2026-10-31&sort=revenue&limit=20&site_id=dp_…" \
  -H "Authorization: Bearer dpt_…"
```

## GET /api/v1/sites

```json
{"status": "success", "data": {"sites": [{"site_id": "dp_ab12cd34", "name": "Shop", "domain": "shop.example", "timezone": "Europe/Berlin", "currency": "EUR", "role": "owner"}]}}
```

## Errors and limits

Errors share the write API's shape: `{"status": "error", "error": {"code": 400, "message": "dim must be one of: …"}}`.

| Status | When |
|---|---|
| 400 | A parameter is invalid, a required one (`dim`, `goal`) is missing, or `site_id` is missing with an account token. |
| 401 | Missing or invalid API key. |
| 403 | The key has no read scope. |
| 404 | No site for this key (or you're no longer a member), or no funnel with that id. |
| 429 | More than 3 requests per second per key on average (bursts up to 120), shared with the write endpoints. |
| 500 | The query failed. Retry later. |

No list is longer than 500 rows, and defaults are small: ask for more with `limit`.

## Questions

### Can a key read every site I have?

An account token (`dpt_…`) can, one site per request with `site_id`. A site key reads only its site.

### Can a viewer's key read visitors and insights?

Yes. A key reads what its owner sees in the dashboard, and every team member, viewers included, sees visitors and insights there.

## Related

- [MCP server: your analytics in Claude, Cursor and other AI assistants](https://datapocket.vo1d.studio/reference/mcp)
- [REST API: payments and goals](https://datapocket.vo1d.studio/reference/rest-api)
- [Tracking script reference](https://datapocket.vo1d.studio/reference/tracking-script)
- [All reference](https://datapocket.vo1d.studio/reference)
