Daily figures

GEThttps://api.compostiq.win/research/daily

One row per country per UTC day: how many bins and readings it covers, and the average, minimum, maximum and standard deviation of each sensor.

Research keyUp to 366 daysJSON or CSV

Authentication

Send your research key in the x-research-key header. Create one on the API keys page of a researcher account; you can hold up to five. A key is shown once, and deleting it stops it working at once.

Query parameters

All optional.

startdate-timeEarliest reading to include, inclusive. Must include a timezone, for example 2026-09-01T00:00:00Z. Defaults to 30 days before end.
enddate-timeLatest reading to include, exclusive. Must include a timezone. Defaults to now.
country_codestringISO 3166-1 alpha-2 code, for example ID. Upper or lower case.
formatenumjson (the default) or csv.

The window from start to end can be up to 366 days long.

Response

start, enddate-timeThe window the figures cover.
country_codestring | nullThe country you asked for, or null for every country.
dataarrayOne row per country per day, ordered by country, then day. Each field is described in the data dictionary.

With format=csv the response is just the rows, with a header line.

Errors

Errors come back as JSON with a detail field.

StatusWhen
401No x-research-key header, or the key is wrong, deleted, or belongs to an account that isn't a researcher's.
422start or end has no timezone, start isn't before end, the window is longer than 366 days, or country_code or format isn't a value listed above.
curl -G https://api.compostiq.win/research/daily \
  -H "x-research-key: $COMPOSTIQ_KEY" \
  -d country_code=ID \
  -d start=2026-10-01T00:00:00Z \
  -d end=2026-10-03T00:00:00Z
Response · 200
{
  "start": "2026-10-01T00:00:00+00:00",
  "end": "2026-10-03T00:00:00+00:00",
  "country_code": "ID",
  "data": [
    {
      "country_code": "ID",
      "day": "2026-10-01T00:00:00",
      "bin_count": 3,
      "reading_count": 8640,
      "temperature_c": 52.418,
      "temperature_c_min": 31.204,
      "temperature_c_max": 63.87,
      "temperature_c_sd": 9.312,
      … the same four for moisture_percent, o2_percent,
        co2_percent and nh3_ratio
    },
    { … }
  ]
}

Other endpoints

The research endpoints take the same key. /research/overview and /research/alerts take the same parameters and return the same envelope. The public endpoints need no key.

GET /research/overviewOne row per country for the whole window: bin and reading counts, and each sensor's average, minimum, maximum and standard deviation.
GET /research/alertsOne row per country and alert type raised in the window: how many alerts, in how many bins, and the average hours until they resolved (null while none has).
GET /research/countriesEvery country with readings: bins, readings, and the first and last reading. Covers all time and takes no parameters.
GET /public/statsNo key. Totals across every bin: bins and countries reporting, devices online now, and readings. GET /public/bins-by-countryNo key. How many bins have reported from each country. GET /public/trendsNo key. The daily average temperature and moisture across every bin, for the last 30 UTC days. GET /openapi.jsonThe machine-readable spec, for code generators and Postman.

Public figures

The three /public endpoints feed the figures on this website. They need no key, count only bins that have sent at least one reading, and give nothing finer than a country. Each answer is reused for up to a minute.

/public/statsobjectbins and countries reporting; active_devices, the devices in a bin heard from in the last 10 minutes; readings_total and readings_24h; first_reading_at and last_reading_at; and updated_at, when the figures were worked out.
/public/bins-by-countryarrayOne {country_code, bins} per country, most bins first. Bins without a country aren't listed.
/public/trendsobjectdays: one {date, temperature_c, moisture_percent} per UTC day for the last 30 days, today included. A day without readings has null values.

Changelog

19 Oct 2026Added /public/stats, /public/bins-by-country and /public/trends.
19 Oct 2026Added /research/alerts, /research/countries, each sensor's minimum, maximum and standard deviation, and format=csv.
16 Oct 2026Added /research/daily and /research/overview, read with a research key.