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

What an import would do

What an import would do. The file is the request's body; nothing is written.

Parameters

sitein the address
neededThe site's id or name
sourcein the address
needed`plausible`, `umami`, `goatcounter`, `matomo` or `tidekeeper`.
namein the address
neededThe file's name, to show beside the import.

The answer

Status 200

ImportPreview What an import would do, worked out without writing anything (IO-03).

bytes
integerneeded
counted_from
string or nullThe first day tidekeeper counted itself, if it has counted any.
days
integerneeded
file
stringneeded
files
integerneeded
from
stringneededThe first and last day in the file.
lines
list of ImportLineneeded
months
list of ImportMonthneeded
notes
list of stringneededWhat was found while reading: a day that appears twice, rows left out.
problems
list of stringneededWhy it cannot be imported as it is. Empty when it can.
source
stringneeded
source_label
stringneeded
to
stringneeded
views
integerneeded
visitors
integerneeded
will_days
integerneeded
will_from
string or nullThe stretch that would be imported: the file's days before tidekeeper's own begin, and before today. `null` when nothing is left.
will_to
string or null

Asking

With your token from Settings
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports/check \
    -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
With your token from Settings
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/imports/check", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`,
  },
}).then((r) => r.json());