The API

Every figure on this site is available as JSON or CSV at a stable address, with the publisher, the release and the cell it was read from attached. No key, no sign-up, no rate limit beyond ordinary politeness.

Endpoints

  • GET /api/provenance/<metric>/<area> · JSON

    One figure with everything needed to check it: the value, the file it was read from with its sha256, the sheet, row and column, when the file was retrieved, and the version of the code that read it. Earlier vintages of the same period are listed, so a revision is visible.

    Add ?period=YYYY-MM-DD for one period. An area may be a local authority address or an ONS code.

    /api/provenance/council_tax_band_d_authority/camden

  • GET /api/area/<area> · JSON, CSV

    Every measure published for one local authority, in the shape the report card renders: value, period, change, rank, the national figure, the arithmetic behind any calculated figure, and — where there is no figure — the publisher's reason.

    /api/area/camden?format=csv

  • GET /api/compare/<a>/<b> · JSON, CSV

    Two areas across every measure, with the gap between them where the two figures are comparable and a stated reason where they are not.

    /api/compare/camden/manchester

  • GET /api/map/layer/<layer> · JSON, CSV, GeoJSON

    One map layer for every area at once: the value, the numerator and denominator behind it, and the boundary geometry if you ask for GeoJSON.

    /api/map/layer/house-price?format=csv

  • GET /api/metrics/<metric> · JSON

    A metric's latest national figure, its definition, what it does not measure, and the release it came from.

    /api/metrics/council_tax_band_d

  • GET /api/metrics/<metric>/series · JSON

    The whole published series for a metric, oldest first.

    /api/metrics/council_tax_band_d/series

  • GET /api/metrics/<metric>/vintages · JSON

    Every value ever published for every period, by release. This is where a revision can be seen: the same period with two figures and two dates.

    /api/metrics/council_tax_band_d/vintages

  • GET /api/geo/postcode/<postcode> · JSON

    The areas a postcode falls in: local authority, region, constituency and police force area.

    /api/geo/postcode/NW1%202DB

What the answers promise

  • A figure is either published by the body named beside it, or arithmetic on published figures with the sum included in the response.
  • A missing figure comes back as null with a reason. It is never zero, and never filled in from a wider area.
  • Periods are given as start and end dates as well as the publisher’s own label, so two series are never spliced by accident.
  • Every value carries the release it came from. If the publisher revises it, the old value stays visible under revisions and in the vintages endpoint.

Caching and stability

Responses are cacheable for an hour and revalidate in the background. Addresses are meant to last: an endpoint that has to change will be listed on what changed before it does. If you are pulling the whole site, the data catalogue lists every publication with its release cadence, so you only need to come back when a publisher does.

Reuse

The statistics are published under the Open Government Licence v3.0 and carry that licence here. Attribute the original publisher; attribute Civometry as well for a figure it calculated. The rules and worked examples are on how to cite.

Data catalogueMethodologyllms.txt