> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crispstats.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> CrispStats is a hosted, privacy-first web analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing, no mobile SDKs and no data import except a site's history from a Plausible export (Settings, Import and export).
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> There is no npm package to install. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Download your raw events

> Download every event CrispStats recorded for a site, one month at a time, as CSV or JSON lines: who can, every column and its unit, the 500,000-row file limit and the API for more.

A raw events file holds every event CrispStats recorded for a site in one month, one row per event, as it was recorded: pageviews, custom events, revenue events, identify calls, web vitals and errors. Use it to keep your own copy, to load your data into another tool, or to answer a question no report answers. The [CSV export](https://docs.crispstats.com/share/csv-export.md) gives totals; this gives the rows behind them.

Only owners and admins of the site's workspace can download raw events, because the rows carry the user ids you send with [identify](https://docs.crispstats.com/track/identify-users.md). Members and viewers see `Owners and admins can download raw events.` The demo site has no raw events.

## Download a month

**1. Open Import and export**

Open your site, then **Settings** and the **Import and export** tab. **Raw events** is the last row of the **Export** group.

**2. Pick the month and format**

Choose a month in the first menu, newest first. Months follow the site's timezone. Each month shows about how many events it holds, counted from daily totals, so the real count can differ a little. Choose **CSV** or **JSON lines** in the second menu.

**3. Download**

Select **Download**. The file streams as it is written, so a large month takes a moment to finish.

Files are named after your domain and the month, for example `example.com-events-2026-10.csv` or `example.com-events-2026-10.ndjson`.

## Formats

| | CSV | JSON lines |
| - | - | - |
| Best for | Spreadsheets | Code and data tools |
| Layout | A header row, then one row per event. UTF-8 with a byte order mark, CRLF line endings. | One JSON object per line, with the same keys as the CSV columns. |
| `revenue` | Major units, such as `49` for \$49.00 | Integer minor units, such as `4900`, as the [REST API](https://docs.crispstats.com/api-reference/introduction.md) writes it |
| `props` | The properties as JSON text | The properties as a JSON object |
| Empty values | An empty cell | `null` |

In CSV files, text that a spreadsheet would run as a formula, because it starts with `=`, `+`, `-`, `@`, a tab or a carriage return, gets a leading apostrophe, as in the [CSV export](https://docs.crispstats.com/share/csv-export.md#file-format).

Rows are in time order, oldest first.

## Columns

Every file has these 29 columns, in this order.

| Column | Meaning |
| - | - |
| `timestamp` | When the event happened, as an ISO 8601 timestamp in UTC. |
| `type` | `pageview`, `event` (a custom event), `revenue`, `identify`, `vitals` or `error`. |
| `name` | The custom event's name. Empty for pageviews. |
| `hostname` | The hostname of the page. |
| `path` | The path of the page. |
| `referrer_host` | The host of the referrer, empty for direct visits. |
| `channel` | The [traffic channel](https://docs.crispstats.com/concepts/metrics.md#traffic-channels) of the visit. |
| `source` | The source of the visit, such as `Google` or `Direct`. |
| `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content` | The visit's UTM tags, when it had them. |
| `country` | The visitor's country code. |
| `region` | The visitor's region, when known. |
| `city` | The visitor's city, when known. |
| `device` | `desktop`, `mobile` or `tablet`. |
| `browser` | The browser's name. |
| `os` | The operating system's name. |
| `language` | The browser's language. |
| `duration` | Seconds the page was visible. |
| `scroll` | How far down the page the visitor scrolled, from `0` to `100`. |
| `revenue` | The amount of a revenue event: major units in CSV, minor units in JSON lines. |
| `currency` | The currency of `revenue`, such as `USD`. |
| `props` | The event's properties. |
| `session_id` | The visit the event belongs to. |
| `visitor_id` | The anonymous visitor id. It changes every day unless the site uses [persistent visitors](https://docs.crispstats.com/privacy/persistent-visitors.md). |
| `user_id` | The id you sent with `crispstats.identify`, when there is one. |
| `event_id` | The event's own id. Unique within the site. |

Latitude and longitude are not in the file, and neither is the internal fingerprint that groups errors. CrispStats stores no IP addresses or User-Agents, so there are none to export. See [data collected](https://docs.crispstats.com/privacy/data-collected.md).

## Limits

* **500,000 events per file.** A month with more shows `October 2026 has about 1,400,000 events, more than one file holds (500,000). Use the API to page through it.`, and its **Download** button becomes **Open API docs**. The events are counted again when you download, so a month listed just under the limit that turns out to be over it returns `October 2026 has more than 500,000 events, more than one file holds. Use the API to page through it.` instead of a file. The [raw events endpoint](https://docs.crispstats.com/api-reference/raw-events.md) pages through any period.
* **20 files per person per hour.** Over that, the download returns `You have downloaded 20 files in the last hour. Try again after 14:20.` with the time on the site's clock.
* **No imported days.** Raw events are what CrispStats recorded. Days [imported from Plausible](https://docs.crispstats.com/switch/import-from-plausible.md) are daily totals, not events, so they are not in the file.
* **Your plan's retention.** Only months your plan still keeps can be downloaded. See [plans and limits](https://docs.crispstats.com/account/plans-and-limits.md).

If a page of events cannot be read while the file is being written, the download fails instead of ending early, so a file that finished downloading is always complete. If the months cannot be listed, the row says `The months could not be loaded. Check your connection and reload the page.`

## Next steps

> [card] [Raw events API](https://docs.crispstats.com/api-reference/raw-events.md)
>
> Page through any period with an admin key.

> [card] [CSV export](https://docs.crispstats.com/share/csv-export.md)
>
> Totals and breakdowns, ready for a spreadsheet.

> [card] [Reset stats](https://docs.crispstats.com/account/reset-stats.md)
>
> Download first, then start a site's numbers from zero.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.