const res = await fetch("https://api.openrevenue.com/v1/projects/example.com/export?period=30d", {
headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})
const csv = await res.text()
curl "https://api.openrevenue.com/v1/projects/example.com/export?period=30d" \
-H "Authorization: Bearer openrevenue_your_key" \
-o openrevenue-example.com-30d.csv
# A custom range (days in your project's time zone)
curl "https://api.openrevenue.com/v1/projects/example.com/export?period=custom&from=2026-10-01&to=2026-10-31&limit=500" \
-H "Authorization: Bearer openrevenue_your_key" \
-o openrevenue-example.com-october.csv
# OpenRevenue export — example.com — period 30d
# Range 2026-04-25 10:00 UTC to 2026-05-25 10:00 UTC
# Generated 2026-05-25T10:00:00.000Z
# Overview
metric,value
visitors,35
pageviews,130
sessions,48
avg_duration_seconds,94
# Pages
path,pageviews,visitors
/,80,25
...
Export CSV
Downloads analytics as a CSV file (Content-Type: text/csv). Sections include overview, pages, referrers, countries, browsers, and operating systems. Works with an API key.
GET
/
v1
/
projects
/
{domain}
/
export
const res = await fetch("https://api.openrevenue.com/v1/projects/example.com/export?period=30d", {
headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})
const csv = await res.text()
curl "https://api.openrevenue.com/v1/projects/example.com/export?period=30d" \
-H "Authorization: Bearer openrevenue_your_key" \
-o openrevenue-example.com-30d.csv
# A custom range (days in your project's time zone)
curl "https://api.openrevenue.com/v1/projects/example.com/export?period=custom&from=2026-10-01&to=2026-10-31&limit=500" \
-H "Authorization: Bearer openrevenue_your_key" \
-o openrevenue-example.com-october.csv
# OpenRevenue export — example.com — period 30d
# Range 2026-04-25 10:00 UTC to 2026-05-25 10:00 UTC
# Generated 2026-05-25T10:00:00.000Z
# Overview
metric,value
visitors,35
pageviews,130
sessions,48
avg_duration_seconds,94
# Pages
path,pageviews,visitors
/,80,25
...
Time period. See Periods on Account API page. Defaults to 30d. Also accepts
all (since your first event), yesterday and custom; those two use your project’s time zone.First day to include,
YYYY-MM-DD, with period=custom. Days are in your project’s time zone. A range is capped at 366 days.Max rows per section. Maximum 500, default 100. A section that reaches the limit is marked
# Top N rows only.Response
Errors
| Status | Error | Description |
|---|---|---|
401 | Invalid or missing API key | The Authorization header is missing or the Bearer token is invalid. |
404 | Project not found | No project with that domain exists for the authenticated user. |
429 | Too many requests | Rate limit exceeded. |
const res = await fetch("https://api.openrevenue.com/v1/projects/example.com/export?period=30d", {
headers: { Authorization: `Bearer ${OPENREVENUE_API_KEY}` },
})
const csv = await res.text()
curl "https://api.openrevenue.com/v1/projects/example.com/export?period=30d" \
-H "Authorization: Bearer openrevenue_your_key" \
-o openrevenue-example.com-30d.csv
# A custom range (days in your project's time zone)
curl "https://api.openrevenue.com/v1/projects/example.com/export?period=custom&from=2026-10-01&to=2026-10-31&limit=500" \
-H "Authorization: Bearer openrevenue_your_key" \
-o openrevenue-example.com-october.csv
# OpenRevenue export — example.com — period 30d
# Range 2026-04-25 10:00 UTC to 2026-05-25 10:00 UTC
# Generated 2026-05-25T10:00:00.000Z
# Overview
metric,value
visitors,35
pageviews,130
sessions,48
avg_duration_seconds,94
# Pages
path,pageviews,visitors
/,80,25
...
Was this page helpful?