Using the API
Responses
Every JSON response has the same simple shape, so once you've read one, you can read them all.
The envelope
Successful JSON responses look like this:
{
"apiVersion": "v1",
"atlasRelease": "sha256:9377970cfffdd2f92b153ba2ac76190812fc8925f5d65498d0e5149dfc0b1b5d",
"data": {
"…": "the result you asked for"
},
"meta": {
"nextCursor": null
}
}| Field | What it holds |
|---|---|
data | The result you asked for. Its shape is shown on each endpoint's page. |
atlasRelease | The Atlas release that produced this response. |
meta.nextCursor | The cursor for the next page, or null if this is the last. See Pagination. |
apiVersion | Always v1 for this version of the API. |
Reading a response
Data responses also explain themselves. Look inside data and you'll typically find:
- The
measure, with its unit and whether it can be added up. - Which areas and period the values describe.
provenance, linking the values to their source dataset, and stating plainly whether anything was transformed.coverage, saying which nations or areas are included, and why any aren't.
If you're building something people will rely on, store atlasRelease with your results. It lets you reproduce them exactly.
Files and tiles
A few endpoints return a file rather than an envelope: whole dataset downloads, lookup tables, vector tiles, the tile archive and the OpenAPI spec. Each says so on its reference page.
Errors are never wrapped in the envelope either. They have a shape of their own, described in Errors.