KK-OZEC data API: guide
Contract version 1.1.0 (API v1). Read-only access to the measurements stored on the KK-OZEC server: ozone, temperature, humidity, pressure, air quality and the atmospheric electric field of the KK-OZEC monitors. The API reads stored data only; it cannot reach or change a monitor.
1. Getting access
- Fill in the form at /api/register: organisation, contact, e-mail, what you want the data for, and which monitors, measurements, how often and how far back. Accept the licence (CC BY 4.0) and terms. You do not need, and do not get, a login to the KK-OZEC website.
- Confirm your e-mail address with the link we send (valid 24 hours). Unconfirmed requests are deleted after 7 days.
- The administrator reviews the request and decides your scope (monitors, parameters, resolutions, earliest date), your tier (limits) and an expiry date (normally 12 months).
- If approved, you get an e-mail with a one-time link (valid 48 hours). Opening it shows your key once: copy it into your software. Nobody can show it again, the administrator included. If you lose it, ask for a new one.
- About 30 days before expiry you get a reminder; renewal is a new approval by the administrator.
2. Authentication
Send the key in the Authorization header of every request, over HTTPS only:
curl -H "Authorization: Bearer ozec_1a2b3c4d_..." https://api.ozec.org/v1/monitors
The API's address is https://api.ozec.org/v1/. The paths in the reference (/api/v1/…) also work in
full, at https://api.ozec.org/api/v1/… or https://www.ozec.org/api/v1/…: the same API, the same key.
A key in a URL is refused (key_in_query), and plain HTTP is refused before it reaches us: a key that travelled that way should be treated as exposed. When the administrator gives you a new key, the old one keeps working for 7 days so you can switch without a gap. Keep keys on servers, not in web pages (the API sends no CORS headers).
3. Endpoints
| Path | Returns |
|---|---|
GET /api/v1/ | Version, links, licence |
GET /api/v1/health | Liveness (no key) |
GET /api/v1/parameters | Parameters in your scope: unit, sensor, accuracy, description (EN/DE) |
GET /api/v1/monitors | Monitors in your scope: name, approximate location (a point rounded to 3 decimals and the radius within which the monitor lies), height, latest record |
GET /api/v1/monitors/{id}/latest | Latest value of each parameter |
GET /api/v1/monitors/{id}/series | Measurements over a span: raw, hourly or daily; JSON or CSV; paginated |
GET /api/v1/monitors/{id}/calibrations | Calibration periods |
GET /api/v1/usage | Your limits and today's usage (free) |
Every field and parameter is in the reference, generated from the server's code.
Parameters
| Key | Unit | Sensor | Accuracy and notes |
|---|---|---|---|
temp_c | °C | BME688 | ±1 °C typical; can read high in sun or from self-heating. sht_temp_c is the more accurate air temperature. |
rh_pct | % | BME688 | ±3 %RH typical. |
pressure_hpa | hPa | BME688 | ±0.6 hPa typical; station pressure, not reduced to sea level. |
o3_ppb | ppb | SPEC ULPSM-O3 | Electrochemical cell. Single readings scatter about ±26 ppb (white noise of the cell); use resolution=1h for trends (ozone is reported as hourly means officially). Zero and span change only at calibration events (see /calibrations). |
pg_vm | V/m | field mill | Atmospheric potential gradient (field mill). Fair-weather values are about 100-150 V/m. |
iaq | IAQ | BME688 + Bosch BSEC2 | Bosch indoor-air-quality index 0-500, relative to the sensor's own history; not an absolute gas level. Single readings scatter about ±0.7 (white noise, station 1, Nov 2026); use resolution=1h for trends. |
sht_temp_c | °C | SHT40 | ±0.2 °C typical. |
sht_rh_pct | % | SHT40 | ±1.8 %RH typical. |
pg_sigma_vm | V/m | field mill | Spread of the potential gradient within a burst. |
gas_ohm | Ω | BME688 | Heated metal-oxide gas sensor resistance (raw). Single readings scatter about ±550 Ω (white noise, station 1, Nov 2026); use resolution=1h for trends. |
siaq | IAQ | BME688 + Bosch BSEC2 | Bosch static IAQ index. Single readings scatter about ±2.7 (white noise, station 1, Nov 2026); use resolution=1h for trends. |
eco2_ppm | ppm | BME688 + Bosch BSEC2 | Bosch CO2-equivalent estimate (not a CO2 sensor). Single readings scatter about ±26 ppm (white noise, station 1, Nov 2026); use resolution=1h for trends. |
bvoc_ppm | ppm | BME688 + Bosch BSEC2 | Bosch breath-VOC-equivalent estimate. Single readings scatter about ±0.04 ppm (white noise, station 1, Nov 2026); use resolution=1h for trends. |
gas_pct | % | BME688 + Bosch BSEC2 | Bosch gas percentage (relative). Single readings scatter about ±0.4 % (white noise, station 1, Nov 2026); use resolution=1h for trends. |
Parameter keys are permanent: never renamed, never reused for something else.
4. Series: times, resolutions, pages
- All times are UTC, ISO 8601 (
2026-11-22T13:00:00Z). A time without an offset is read as UTC; a date alone means its midnight UTC. resolution=raw: every stored record (normally one per 5 minutes; faster in storms) at its own time.1h: hourly means, labelled by the start of the UTC hour, withn= records in the hour.1d: the mean of the day's hourly means, labelled by the start of the UTC day,n= hours with data. Raw records are kept 365 days; hourly means forever.- Pages hold up to
limitrows (at most 10,000). If there are more,meta.next_cursor(JSON) or theOZEC-Next-Cursorheader (CSV) is set: repeat the request with the same parameters pluscursor=that value, until it is null or absent. To keep each request light for a small server, a page covers at mostlimitrecord intervals (5 minutes, 1 hour or 1 day), so a page can hold fewer rows thanlimit, or none across a gap in the data: keep following the cursor. format=csv: the same rows; comma separator, decimal point, a header row, flags joined by;, licence and attribution in theOZEC-Licence/OZEC-Attributionheaders.- Gaps in the data are gaps: no row is invented.
curl -H "Authorization: Bearer $KEY" \ "https://api.ozec.org/v1/monitors/1/series?parameters=o3_ppb,temp_c&start=2026-11-01&end=2026-11-08&resolution=1h"
import requests
S = requests.Session(); S.headers["Authorization"] = "Bearer " + KEY
url, q, rows = "https://api.ozec.org/v1/monitors/1/series", {"parameters": "o3_ppb", "start": "2026-11-01",
"end": "2026-11-08", "resolution": "raw"}, []
while True:
r = S.get(url, params=q, timeout=60)
if r.status_code in (429, 503):
time.sleep(int(r.headers.get("Retry-After", "60"))); continue
r.raise_for_status(); page = r.json(); rows += page["data"]
if not page["meta"]["next_cursor"]: break
q["cursor"] = page["meta"]["next_cursor"]
5. Data quality
The data is given out as measured: no smoothing, no adjustment to other stations. Use these to judge it:
- time_quality (raw rows):
received= sent live and stamped by the server on arrival;synced= sent later from the monitor's memory, with its clock set by the server;offset/stale= the time was reconstructed after an outage and may be off by minutes;none= not synced. - flags: fault flags of the record that concern the parameters you asked for:
bme688_fault,sht40_fault,ozone_fault,mill_stall,mill_clip,mill_quality,storage_fault,radio_fault. Hourly and daily rows list the faults that occurred in at least one record of the window; beyond the 365 days of raw records onlyfaults_in_period(some record had a fault) is known. The list is open: ignore flags you do not know. - cal: the calibration period the value was measured in (
/calibrations). A step at a period boundary is a calibration change, not a change in the air. - Ozone: single readings of the electrochemical cell scatter about ±26 ppb; trends need hourly means
(
resolution=1h), which is also how ozone is reported officially. - Gas values (
iaq,siaq,eco2_ppm,bvoc_ppm,gas_pct,gas_ohm): single readings scatter in the same way (each parameter's note gives the size); useresolution=1hfor trends. Temperature, humidity and pressure readings can be used singly.
6. Limits
Your key belongs to a tier; the administrator can change tiers and give a key its own values. The server is a Raspberry Pi on a home connection: the limits are sized to it, and one monitor records about 105,000 raw values per parameter a year, so even the smallest tier can fetch about three months of raw data, or several years of hourly means, per day.
| Tier | Requests/min (burst) | Requests/day | Rows/day | At a time | Max span raw / 1h / 1d |
|---|---|---|---|---|---|
| standard | 4 (8) | 1,000 | 30,000 | 1 | 31 d / 366 d / 7305 d |
| research | 12 (24) | 5,000 | 200,000 | 1 | 92 d / 1827 d / 7305 d |
| partner | 20 (40) | 10,000 | 600,000 | 1 | 366 d / 7305 d / 7305 d |
Every response carries RateLimit-Policy and RateLimit headers (IETF draft) for the
minute, day and rows limits. A limit of your key gives 429 with Retry-After (seconds); the
server-wide limit, which protects the monitors' radio link and a small home server, gives 503 with
Retry-After. Days are UTC days. /api/v1/usage shows your counters and is free. Fetch only what
changed: data arrives every 5 minutes, so polling latest more often than that gains nothing.
7. Errors
Errors are RFC 9457 problem details (application/problem+json) with a stable code. New
codes may be added; treat unknown ones by their HTTP status.
| code | HTTP | Meaning | What to do |
|---|---|---|---|
missing_key | 401 | No Authorization: Bearer header. | Send your key in that header. |
invalid_key | 401 | The key is not one of ours (typo, truncated). | Check the copy of your key. Ten invalid keys from one address within 15 minutes block that address for the rest of the 15 minutes. |
key_revoked | 401 | The key was revoked, or replaced and its 7-day overlap ended. | Use your newest key. |
key_expired | 401 | Your access reached its expiry date. | Ask the administrator to renew it. |
client_suspended | 403 | The administrator suspended your access. | Contact the administrator. |
key_in_query | 400 | A key was sent in the URL (e.g. ?api_key=). | Never put the key in a URL: it ends up in logs. Ask the administrator for a new key. |
too_many_bad_keys | 429 | Too many invalid keys from your address. | Wait for Retry-After. |
unknown_query_parameter | 400 | A query parameter this endpoint does not know. | Check the spelling; the detail lists the allowed ones. |
out_of_scope | 403 | A monitor, parameter or resolution outside your key's scope. | Ask the administrator to widen the scope, or stay within it (see /api/v1/usage). |
unknown_monitor | 404 | The monitor has no stored data. | See /api/v1/monitors. |
unknown_parameter | 400 | No parameter with that key. | See /api/v1/parameters. |
bad_request | 400 | A value could not be read (time format, limit range, ...). | See the detail. |
bad_time | 400 | start is not before end. | Swap or fix the times. |
span_too_long | 400 | The span is longer than your tier allows at that resolution. | Split it into several requests, or use a coarser resolution. |
bad_cursor | 400 | The cursor is not from this API or not from this span. | Pass the cursor unchanged, with the same start and end. |
rate_limited | 429 | A limit of your key: per minute, per day, rows per day, or requests at a time (limit names it). | Wait for Retry-After. |
server_busy | 503 | The server-wide limit was reached (all clients together). | Wait for Retry-After. |
service_paused | 503 | The administrator paused the API (maintenance). | Try again later. |
data_unavailable | 503 | The data store did not answer. | Try again later. |
not_found | 404 | No such endpoint. | See the reference. |
method_not_allowed | 405 | Anything but GET. | The API is read-only. |
8. Licence and attribution
The data is licensed CC BY 4.0: you may share and adapt it, commercially too, if you give credit. Use: "Data: KK-OZEC monitoring network (https://www.ozec.org), CC BY 4.0". It is low-cost research instrumentation, provided as is, without warranty: not an official air-quality service.
9. Compatibility promise
- The major version is in the path (
/api/v1). Within v1 the contract only grows: new endpoints, new optional query parameters, new response fields, new flags, error codes, parameters and monitors. - Nothing is removed, renamed, retyped or given a new meaning within v1, and no optional input becomes required. A check on our side fails any change that would break this.
- Write tolerant clients: ignore fields and flag values you do not know.
- If a breaking change is ever needed, it comes as
/api/v2beside v1. v1 responses then carryDeprecationandSunsetheaders, every client that used v1 in the last 90 days is e-mailed, and v1 keeps working for at least 12 months.
10. Changelog
| Version | Date | Change |
|---|---|---|
| 1.1.0 | 2026-11-26 | Added: location.radius_m in /monitors. The operator publishes an approximate point near each monitor and the distance within which the monitor lies; the exact position is never published. |
| 1.0.2 | 2026-11-26 | Documentation only: the notes of iaq, siaq, eco2_ppm, bvoc_ppm, gas_pct and gas_ohm now give their reading-to-reading scatter and recommend resolution=1h for trends, as for ozone. |
| 1.0.1 | 2026-11-24 | Documentation only: the reference now lists every refusal each endpoint can send (400/403/503 on the index, 404 unknown_monitor on the monitor endpoints) and no longer lists 422, which the API never sends (bad values get 400 bad_request). |
| 1.0.0 | 2026-11-23 | First release: parameters, monitors, latest, series (raw / 1h / 1d, JSON / CSV, pagination), calibrations, usage. |