Documentation · API reference
GET
/api/v1/sites/{site}/whenWhen in the week readers come: each hour of each weekday
This page as Markdown, or in an AI chatMore ways to read this page
When in the week readers come: each hour of each weekday.
# When in the week readers come: each hour of each weekday
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-sites-site-when
`GET /api/v1/sites/{site}/when`
When in the week readers come: each hour of each weekday.
## Parameters
- `site` (in path, needed): A site's id or name
- `period` (in query): The period averaged over; four weeks unless given
- `metrics` (in query): `visitors` (the default) or `views`
## The answer
200, `WhenResponse`: When in the week readers come.
- `busiest` (WhenCell or null)
- `by_hour` (list of number or null, needed): Each hour of the day, averaged over every day.
- `caveats` (list of CaveatView): What these averages say of themselves: a stretch someone left out of comparisons is in none of them.
- `metric` (string, needed): `visitors` (counted once in each hour they came) or `views`.
- `period` (PeriodView, needed)
- `quietest` (WhenCell or null)
- `rows` (list of WhenRow, needed): Seven rows, from the day the site's week starts on.
- `site` (string, needed)
## Asking
```sh
curl https://tidekeeper.eu/api/v1/sites/example.org/when \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN"
```
Parameters
- sitein the address
- neededA site's id or name
- periodin the query
- The period averaged over; four weeks unless given
- metricsin the query
- `visitors` (the default) or `views`
The answer
Status 200
WhenResponse When in the week readers come.
- busiest
- WhenCell or null
- by_hour
- list of number or nullneededEach hour of the day, averaged over every day.
- caveats
- list of CaveatViewWhat these averages say of themselves: a stretch someone left out of comparisons is in none of them.
- metric
- stringneeded`visitors` (counted once in each hour they came) or `views`.
- period
- PeriodViewneeded
- quietest
- WhenCell or null
- rows
- list of WhenRowneededSeven rows, from the day the site's week starts on.
- site
- stringneeded
Asking
curl https://tidekeeper.eu/api/v1/sites/example.org/when \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/when", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());