Source: https://usedataowl.com/docs/api
Markdown source: https://usedataowl.com/docs/api.md
Description: Read analytics, list visitors, report payments and crawler requests from your own backend, scripts or AI agents.

# Get started with the DataOwl API

Use the DataOwl API to read analytics and send server-side events from your backend, scripts or AI agents. The [MCP server](/docs/mcp-introduction) exposes the same operations as tools.

| Token | Use it for |
| --- | --- |
| `ds_sk_` website key | Read one website's analytics, visitors and errors, and report its payments |
| `ds_at_` account token | Read any of your websites (or a chosen few) with the permissions you pick; AI agents and scripts |

Read [authentication and scopes](/docs/api/authentication) before giving a token to an agent.

## Base URL

`https://usedataowl.com/api/v1/`

## Authenticate requests

```http
Authorization: Bearer YOUR_TOKEN
```

Create website keys in a website's **Settings → API**, and account tokens in [**API & MCP**](/dashboard/api). Keep both secret: never put them in frontend code or public repositories.

## Endpoints

| Endpoint | Description |
| --- | --- |
| [`GET /api/v1/account`](/docs/api/account/account/retrieve) | The caller's name, email and plan, with the plan's limits. |
| [`GET /api/v1/websites`](/docs/api/account/websites/list) | The websites this credential can access, with their names, domains, timezones and icons. |
| [`GET /api/v1/websites/{websiteId}`](/docs/api/account/websites/retrieve) | One website's settings: timezone, tracking mode, session replay, plan features and when its last event arrived. |
| [`GET /api/v1/analytics/metadata`](/docs/api/website/analytics/metadata) | Website display metadata: name, domain, timezone and reporting currency. |
| [`GET /api/v1/analytics/overview`](/docs/api/website/analytics/overview) | Visitors, pageviews, sessions, bounce rate, session duration, revenue and conversion rate for a range, with the previous period of the same length and the change. The headline numbers on the dashboard. |
| [`GET /api/v1/analytics/timeseries`](/docs/api/website/analytics/timeseries) | Visitors, pageviews and revenue per minute, hour, day, week or month. |
| [`GET /api/v1/analytics/realtime`](/docs/api/website/analytics/realtime) | Visitors online in the last 5 minutes, their top pages, referrers and countries, pageviews per minute for the last 30 minutes, and the latest pageviews and goals. |
| [`GET /api/v1/analytics/realtime-map`](/docs/api/website/analytics/realtime-map) | Visitors per country over the last 30 minutes, as on the live map. |
| [`GET /api/v1/analytics/pages`](/docs/api/website/breakdowns/pages) | Top pages by visitors, with the revenue of sessions that landed on them. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/referrers`](/docs/api/website/breakdowns/referrers) | Traffic sources: referrer domains, with Direct for visits without one. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/campaigns`](/docs/api/website/breakdowns/campaigns) | UTM campaigns (utm_campaign) by visitors and revenue. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/countries`](/docs/api/website/breakdowns/countries) | Visitors by country, as ISO codes. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/regions`](/docs/api/website/breakdowns/regions) | Visitors by region or state, labelled CC:Name. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/cities`](/docs/api/website/breakdowns/cities) | Visitors by city, labelled CC:Name. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/browsers`](/docs/api/website/breakdowns/browsers) | Visitors by browser. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/operating-systems`](/docs/api/website/breakdowns/operating-systems) | Visitors by operating system. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/devices`](/docs/api/website/breakdowns/devices) | Visitors by device type: Desktop, Mobile or Tablet. Each row has visitors, pageviews and revenue attributed to sessions that started there. |
| [`GET /api/v1/analytics/goals`](/docs/api/website/goals) | Goals and custom events with completions, unique visitors and conversion rate. |
| [`GET /api/v1/errors`](/docs/api/website/errors) | JavaScript errors grouped by message, most frequent first, with counts, affected visitors, pages, browsers and the latest stack. Covers the website's latest 100 errors. |
| [`GET /api/v1/bot-traffic/summary`](/docs/api/website/bot-traffic/summary) | AI answer, indexing, training and other crawler requests, IP verification, providers and crawlers for a range. Pro and Team plans. |
| [`GET /api/v1/bot-traffic/pages`](/docs/api/website/bot-traffic/pages) | The pages crawlers request most, the discovery files they read (robots.txt, llms.txt, sitemaps, .md pages) and the pages that returned 404. Pro and Team plans. |
| [`GET /api/v1/visitors`](/docs/api/website/visitors/list) | Visitors in a range with their pageviews, sessions, time on site, source, location, device and lifetime revenue. Segment, sort and search them. Names and emails need the visitors:details permission. |
| [`GET /api/v1/visitors/{visitorId}`](/docs/api/website/visitors/retrieve) | One visitor's profile: first touch, totals, goals, top pages and their latest sessions with every pageview, goal, outbound link click, payment and error. Identity needs visitors:details. |
| [`GET /api/v1/replays`](/docs/api/website/replays/list) | The website's latest session recordings, newest first: when, how long, the pages visited, clicks, and who it was. |
| [`GET /api/v1/replays/{sessionId}`](/docs/api/website/replays/retrieve) | One recording, ready to play: its pages in order, each with short-lived signed URLs of the rrweb event chunks (gzipped JSON) to download from storage. Play them with rrweb's Replayer. |
| [`GET /api/v1/forms`](/docs/api/website/forms/list) | The website's forms and surveys with their status, views, responses and completions. |
| [`GET /api/v1/forms/{formId}`](/docs/api/website/forms/retrieve) | One form's questions and how they were answered: averages and spread for stars, counts per choice, answer counts for text. |
| [`GET /api/v1/forms/{formId}/responses`](/docs/api/website/forms/responses) | A form's responses, newest first, with every answer. With visitors:read also who answered (visitor, location, device) and whether the session was recorded; names and emails need visitors:details. |
| [`POST /api/v1/payments`](/docs/api/website/payments/create) | Record a payment for revenue attribution. |
| [`DELETE /api/v1/payments`](/docs/api/website/payments/delete) | Delete a payment. |
| [`POST /api/crawls`](/docs/api/website/bot-traffic/report) | Report a crawler request for bot traffic tracking. |

## Responses

Successful requests return `200 OK`:

```json
{
  "status": "success",
  "data": { … }
}
```

## Errors

```json
{
  "status": "error",
  "error": { "code": 403, "message": "This credential is missing the visitors:read permission." }
}
```

| Code | Meaning | Common causes |
| --- | --- | --- |
| `400` | Bad request | Invalid parameter, invalid date, startAt without endAt, missing websiteId |
| `401` | Unauthorized | Missing Authorization header, unknown or deleted token, an OAuth token used outside MCP |
| `402` | Payment required | This month's events are used up, so reports are locked until the 1st |
| `403` | Forbidden | Missing permission, a feature not on the plan, a website key used for another website |
| `404` | Not found | Unknown endpoint, or a website or visitor this token can't access |
| `429` | Rate limited | More than 60 requests a minute; see the X-RateLimit-* and Retry-After headers |
| `500` | Server error | Unexpected; retry shortly |

The Payments API predates `/api/v1` envelopes and answers `{ "message": … }` or `{ "error": "…" }`; see its pages.
