Documentation · API reference
POST/api/v1/sites/{site}/imports/matomo

Fetch a stretch of a Matomo's reports

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

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

With your token from Settings
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports/matomo \
    -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{}'
With your token from Settings
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());