Documentation · API reference
GET
/api/v1/sites/{site}/whyHow a figure was made
This page as Markdown, or in an AI chatMore ways to read this page
How a figure was made: what arrived, what was left out and why, what was counted without a key.
# How a figure was made
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-sites-site-why
`GET /api/v1/sites/{site}/why`
How a figure was made: what arrived, what was left out and why, what was counted without a key.
## Parameters
- `site` (in path, needed): A site's id or name
## The answer
200, `WhyResponse`: How a figure was made (ME-12).
- `caveats` (list of CaveatView, needed)
- `daily_visitors` (list of DayCount, needed): The visitor figure day by day: it is their sum.
- `definition` (string, needed): The metric's one definition, in the words shown everywhere.
- `events` (integer, needed)
- `imported_views` (integer, needed): Views that came from an import (IV-12).
- `label` (string, needed)
- `left_out` (list of LeftOutView, needed)
- `left_out_is_site_wide` (boolean, needed): The left-out counts are for the whole site, not for the filtered slice: they are kept per site and day only.
- `metric` (string, needed)
- `no_key_views` (integer, needed): Views counted without a visitor key (VC-13).
- `period` (PeriodView, needed)
- `received` (integer, needed): Hits received in the period: counted plus left out.
- `site` (string, needed)
- `value` (number or null): The figure itself.
- `views` (integer, needed)
- `visitors` (integer, needed)
## Asking
```sh
curl https://tidekeeper.eu/api/v1/sites/example.org/why \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN"
```
Parameters
- sitein the address
- neededA site's id or name
The answer
Status 200
WhyResponse How a figure was made (ME-12).
- caveats
- list of CaveatViewneeded
- daily_visitors
- list of DayCountneededThe visitor figure day by day: it is their sum.
- definition
- stringneededThe metric's one definition, in the words shown everywhere.
- events
- integerneeded
- imported_views
- integerneededViews that came from an import (IV-12).
- label
- stringneeded
- left_out
- list of LeftOutViewneeded
- left_out_is_site_wide
- booleanneededThe left-out counts are for the whole site, not for the filtered slice: they are kept per site and day only.
- metric
- stringneeded
- no_key_views
- integerneededViews counted without a visitor key (VC-13).
- period
- PeriodViewneeded
- received
- integerneededHits received in the period: counted plus left out.
- site
- stringneeded
- value
- number or nullThe figure itself.
- views
- integerneeded
- visitors
- integerneeded
Asking
curl https://tidekeeper.eu/api/v1/sites/example.org/why \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/why", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());