Distributions and summary statistics for a zoning category in a commune
Returns the per-parcel metric distributions, summary statistics, age cohorts, and raw scatter inputs that drive the room Aireon app. Backed by an in-memory LRU keyed on ${fso}:${cz_local} (capacity 500, TTL 1 hour).
Server-side rules:
- Nulls are dropped before computing distributions and summary.
- Hard outliers (above p99.5 or below p0.5 within the zone) are trimmed from
distributions[*]; raw min/max stay insummary. parcels[]is unfiltered.other_zoneslists every distinctcz_localin the same FSO except the queried one, sorted by parcel count desc.
GET alias (cacheable). Identical handler and identical response to the POST, with the inputs as query parameters. A POST is uncacheable by browsers and by any CDN, so apps on a first-load path should prefer this GET.
The response carries Cache-Control: private, max-age=86400, stale-while-revalidate=21600 and Vary: Origin, token. The policy is private, never public: the endpoint is gated on the token request header, and a header is not part of any shared-cache key - a public/s-maxage directive would let a CDN serve the payload to a caller that never presented the token. Error responses (including the legacy HTTP-200 plain-text ones) carry Cache-Control: no-store.
Snapshot and revalidation. Every 200 carries X-Res-Snapshot (the identity of the serving data the payload is computed from: the serving table, plus the last completed serving refresh when recorded, e.g. parcel_2025_07@20261020T031200Z) and a strong ETag derived from the snapshot, the payload version, fso, zone and lang (never from the body). Send it back as If-None-Match and a match answers 304 before any computation runs, token required. Pass snapshot=<value> to pin the data version: when it is not the current snapshot the answer is 409 {"error":"snapshot_mismatch","snapshot":<current>} with Cache-Control: no-store.
https://res.aireon.ch/res_api/zone_statsAuthorization
Query parameters
Returns
200
Zone statistics payload.
- age_cohortsobjectrequired
Mean, p50 and p80 of cz_util_now (utilization) per building-age cohort, widest window first. Seven precision steps: the all-years baseline plus six trailing windows (60/40/20/15/10/5 years). The 15/10/5 steps were added 2026-08-24. Windows are relative to the current year. Each cohort carries
n- the narrower the window the thinner the sample, so readnbefore trusting a cohort mean.
304
If-None-Match matches the current ETag. Empty body; answered before the payload is computed.