# Export your analytics

> Take your analytics out as CSV or JSON, on any plan, from the dashboard, the API or your AI agent.

Your analytics are yours. Every plan can export them, and nothing about the export is gated: how far back it reaches is your plan's analytics history, the same as every other read.

You get one dataset per download, as CSV or JSON.

## From the dashboard

**Insights → Export your analytics.** Pick the data and the format, then Download.

## From the API

```bash
curl "https://api.nordva.dev/v1/analytics/export?dataset=visitors&format=csv" \
  -H "Authorization: Bearer $NORDVA_SECRET_KEY"
```

You get back a link rather than the file:

```json
{
  "data": {
    "dataset": "visitors",
    "period_days": 90,
    "download_url": "https://api.nordva.dev/v1/analytics/export/download/…",
    "expires_at": "2026-09-20T21:15:00.000Z",
    "row_count": 1840,
    "format": "csv",
    "truncated": false
  },
  "error": null
}
```

The link needs no API key, which is what lets you hand it to a script or a colleague. That also makes it worth treating as a secret: anyone who has it can download the file until it expires, fifteen minutes after it was made.

Requires a secret key. A publishable key is refused.

## From an AI agent

With the MCP server connected, ask for it in words: "export my visitors as CSV". The tool is `export_analytics`.

## The datasets

| `dataset` | One row per |
|---|---|
| `daily` | day, with page views, visits, engaged seconds, second pages and new visitors |
| `visitors` | person, with their visits, days, longest run, where they came from and which goals they reached |
| `goals` | goal name, with completions |
| `channel` `referrer` `utm_source` `utm_medium` `utm_campaign` | where visits came from |
| `path` | page |
| `country` `city` | place |
| `device` `browser` `os` | what they used |

`period_days` defaults to your plan's full history (Free 30 days, Indie 1 year, Builder 2 years). Ask for fewer to make a smaller file. Days older than 90 come from the daily totals kept after raw events expire ([how far back](/guides/web-analytics/#how-far-back)): the answer then has `from_rollups: true`, and a breakdown ends in an `(other)` row holding each day's values beyond its top ones. The `visitors` dataset follows single visitors, so it reaches back 90 days and defaults to that.

## Two things the file will not tell you, so the answer does

**A breakdown stops at 1,000 rows.** When it does, `truncated` is `true`. A site with more than a thousand distinct pages gets its busiest thousand, not a quiet failure. Narrow the period if you need a different slice.

**The `visitors` dataset only holds visits that were allowed to carry a visitor id.** Someone who declined cookies, or who visited while your site was in cookieless mode, is counted in your totals but has no row here, because there is nothing to join their visits together with. The response says so in `note`. This is the same limit the Visitors panel carries in the dashboard.

## Opening the CSV

Cells that hold a value someone else chose, such as a referrer, a campaign name or a goal name, are written so that a spreadsheet treats them as text. A value starting with `=`, `+`, `-` or `@` is prefixed with an apostrophe, because Excel and Sheets would otherwise run it as a formula. The apostrophe is not part of your data.

## Related

- [Web analytics](/guides/web-analytics), for what is being collected in the first place
- [Attribution](/guides/attribution), for joining a source to a signup and a payment

Source: https://docs.nordva.dev/guides/analytics-export/
