Documentation · API reference
POST
/api/v1/sites/{site}/imports/matomoFetch a stretch of a Matomo's reports
This page as Markdown, or in an AI chatMore ways to read this page
Fetch a stretch of a Matomo's reports. The answer is a file: check it and import it like any other, with `source=matomo`. The token is used for this one request and not kept.
# Fetch a stretch of a Matomo's reports
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-sites-site-imports-matomo
`POST /api/v1/sites/{site}/imports/matomo`
Fetch a stretch of a Matomo's reports. The answer is a file: check it and import it like any other, with `source=matomo`. The token is used for this one request and not kept.
## Parameters
- `site` (in path, needed): The site's id or name
## What to send
`MatomoFetch`: Which Matomo to ask for its reports, and for which days. The token is used for the one request this is and is never kept.
- `id_site` (integer): Matomo's number for the site: `idSite` in its address.
- `since` (string or null): The first day, `2025-01-03`. Left out: a year before the last.
- `token` (string): A token of Matomo's with view access to that site.
- `until` (string or null): The last day. Left out: yesterday.
- `url` (string): Where Matomo answers: `https://matomo.example.org`.
## The answer
200, `string`
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports/matomo \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
```
Parameters
- sitein the address
- neededThe site's id or name
What to send
MatomoFetch Which Matomo to ask for its reports, and for which days. The token is used for the one request this is and is never kept.
- id_site
- integerMatomo's number for the site: `idSite` in its address.
- since
- string or nullThe first day, `2025-01-03`. Left out: a year before the last.
- token
- stringA token of Matomo's with view access to that site.
- until
- string or nullThe last day. Left out: yesterday.
- url
- stringWhere Matomo answers: `https://matomo.example.org`.
The answer
Status 200
string
Asking
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports/matomo \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/imports/matomo", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({}), }).then((r) => r.json());