Documentation · API reference
GET
/api/v1/sites/{site}/seriesFigures over time
This page as Markdown, or in an AI chatMore ways to read this page
The same metrics over time: one point for every day or hour.
# Figures over time
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-sites-site-series
`GET /api/v1/sites/{site}/series`
The same metrics over time: one point for every day or hour.
## Parameters
- `site` (in path, needed): A site's id or name
- `grain` (in query): `day` or `hour`. Follows the period when left out
## The answer
200, `SeriesResponse`
- `annotations` (list of AnnotationView, needed): Notes on the chart that fall in the period.
- `caveats` (list of CaveatView, needed)
- `compare` (PeriodView or null)
- `grain` (string, needed): `day` or `hour`.
- `metrics` (list of string, needed)
- `period` (PeriodView, needed)
- `points` (list of Point, needed): One point for every day or hour of the period. A point with `null` values is a time nothing was being counted: a gap, not a zero.
- `previous` (list of Point or null)
- `previous_totals` (list of number or null or null)
- `site` (string, needed)
- `totals` (list of number or null, needed)
## Asking
```sh
curl -G https://tidekeeper.eu/api/v1/sites/example.org/series \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-d metrics=visitors -d period=30d
```
Parameters
- sitein the address
- neededA site's id or name
- grainin the query
- `day` or `hour`. Follows the period when left out
The answer
Status 200
SeriesResponse
- annotations
- list of AnnotationViewneededNotes on the chart that fall in the period.
- caveats
- list of CaveatViewneeded
- compare
- PeriodView or null
- grain
- stringneeded`day` or `hour`.
- metrics
- list of stringneeded
- period
- PeriodViewneeded
- points
- list of PointneededOne point for every day or hour of the period. A point with `null` values is a time nothing was being counted: a gap, not a zero.
- previous
- list of Point or null
- previous_totals
- list of number or null or null
- site
- stringneeded
- totals
- list of number or nullneeded
Asking
curl -G https://tidekeeper.eu/api/v1/sites/example.org/series \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -d metrics=visitors -d period=30d
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/series?metrics=visitors&period=30d", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());