Events

Export Events

Downloads a site's raw events as a CSV or NDJSON file.

GET /api/sites/:site/export/events

Streams every event in a date range as a file, one row per event, oldest first. Covers pageviews, custom events, outbound clicks, errors, web vitals and autocaptured interactions. IP addresses are never included.

Needs a role on the site (any role, including viewer) or an API key with the events:read scope. Public-site and private-link visitors cannot call it. The same export is available in the dashboard under Site Settings → Export.

Limits: one request returns at most 2,000,000 events. Larger ranges get 413 before any data is sent, so fetch long histories month by month (or day by day for very busy sites). Rate limit: 10 requests per minute per user (per organization for organization API keys), on top of the standard API limits.

Path Parameters

Prop

Type

Query Parameters

Accepts all Common Parameters (time and filters). With no time parameters, exports all time.

Prop

Type

Response

The response body is the file itself, not JSON: text/csv with a header row, or application/x-ndjson. Content-Disposition names the file, and X-Export-Rows gives the number of events counted just before streaming began (events arriving meanwhile can make the file slightly longer). Stream it to disk rather than buffering it.

Events are ordered oldest first, to the millisecond.

In CSV, text cells that start with =, +, -, @, a tab or a carriage return get a leading ' so spreadsheets show them as text instead of running them as formulas. NDJSON values are exactly as stored.

If the export fails after the file has started (a server limit is hit mid-stream), the connection is cut before the end, so your HTTP client reports an incomplete download. Treat any download that does not complete normally as failed and retry it.

Columns

Prop

Type

Errors before the file starts come back as JSON: 400 for malformed time parameters, filters or format; 403 for a site that doesn't exist or that you can't access; 413 when the range holds more than 2,000,000 events (the body includes rows and maxRows); 429 when rate limited.

Counting first

GET /api/sites/:site/export/events/count takes the same parameters and returns { "data": { "rows": 48210, "maxRows": 2000000 } }, so a script can check a range before downloading it. It is rate limited to 30 requests per minute.

Request
curl --fail "https://app.rybbit.io/api/sites/123/export/events?start_date=2026-01-01&end_date=2026-01-31&time_zone=UTC&format=csv" \
  -H "Authorization: Bearer your_api_key_here" \
  -o events-2026-01.csv
Request
import { createWriteStream } from 'node:fs';
import { Readable } from 'node:stream';
import { pipeline } from 'node:stream/promises';

const response = await fetch(
  'https://app.rybbit.io/api/sites/123/export/events?start_date=2026-01-01&end_date=2026-01-31&time_zone=UTC&format=ndjson',
  { headers: { Authorization: 'Bearer your_api_key_here' } }
);
if (!response.ok) throw new Error((await response.json()).error);

await pipeline(Readable.fromWeb(response.body), createWriteStream('events-2026-01.ndjson'));
Request
import requests

with requests.get(
    'https://app.rybbit.io/api/sites/123/export/events',
    params={
        'start_date': '2026-01-01',
        'end_date': '2026-01-31',
        'time_zone': 'UTC',
        'format': 'csv',
    },
    headers={'Authorization': 'Bearer your_api_key_here'},
    stream=True,
) as response:
    response.raise_for_status()
    with open('events-2026-01.csv', 'wb') as f:
        for chunk in response.iter_content(chunk_size=1 << 20):
            f.write(chunk)
Request
req, _ := http.NewRequest("GET", "https://app.rybbit.io/api/sites/123/export/events?start_date=2026-01-01&end_date=2026-01-31&time_zone=UTC&format=csv", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")

resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()

out, _ := os.Create("events-2026-01.csv")
defer out.Close()
io.Copy(out, resp.Body)
Response (CSV, first rows)
"timestamp","type","event_name","props","session_id","user_id",...
"2026-01-01T00:00:04.212Z","pageview","","{}","8f3c…","a91e…",...
"2026-01-01T00:00:19.870Z","custom_event","signup","{""plan"":""pro""}","8f3c…","a91e…",...