Documentation · API reference
GET
/api/v1/sites/{site}/stats.csvFigures for a period, as CSV
This page as Markdown, or in an AI chatMore ways to read this page
The same answer as comma-separated text: any panel as a file (RP-04). Who took what out is written down.
# Figures for a period, as CSV
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-sites-site-stats-csv
`GET /api/v1/sites/{site}/stats.csv`
The same answer as comma-separated text: any panel as a file (RP-04). Who took what out is written down.
## Parameters
- `site` (in path, needed): A site's id or name
## The answer
200, a file
## Asking
```sh
curl -G https://tidekeeper.eu/api/v1/sites/example.org/stats.csv \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-d metrics=visitors,views -d by=page -d period=30d
```
Parameters
- sitein the address
- neededA site's id or name
The answer
Status 200, with a file
Asking
curl -G https://tidekeeper.eu/api/v1/sites/example.org/stats.csv \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -d metrics=visitors,views -d by=page -d period=30d
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/stats.csv?metrics=visitors,views&by=page&period=30d", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.text());