API
A versioned JSON API over the same cleaned series this site renders — so you can build on the data instead of scraping the pages.
54 datasets, every headline figure, the source register and the freshness check, all under /api/v1/.
What the version number promises
Anything under /api/v1/ is a commitment: the fields documented here will not change meaning or disappear without the version changing. The older /data/{id}.json downloads still work and are not going away, but their shape is whatever the site needs — if you are writing code against this, use the versioned path.Licence and attribution
The underlying figures are UK official statistics republished under the Open Government Licence v3.0, with Crown copyright acknowledged. Every record carries the publisher it originated with in its own source field — this API republishes, it does not originate. If you use it, attribute the publisher rather than this site, and follow the source link before drawing a conclusion from any figure.Endpoints
| Path | Returns |
|---|---|
| /api/v1/index | This list, machine-readable, with the API version.Start here if you are discovering the API programmatically. |
| /api/v1/datasets | Every dataset with its provenance, columns and row count — without the rows.The cheap call. Use it to find what you want before fetching a full series. |
| /api/v1/datasets/{id} | One dataset in full, including every row.Ids are stable. The CSV equivalent is /data/{id}.csv. |
| /api/v1/sources | The source register: publisher, licence, cadence, last published, last checked.What this site reads and how often, including the caveats each source carries. |
| /api/v1/figures | Every headline figure the site publishes, grouped by page, with its period and source URL.Generated from the same accessors as the pages, so it cannot disagree with them. |
| /api/v1/status | Dataset freshness against the cadence windows the build checks, measured at build time.The machine-readable form of the status page. |
Notes for anyone building on this
- Everything is prerendered. There is no database and no request-time work, so responses are static files. Cache them; there is no rate limit and nothing to overload.
- Periods differ between figures, deliberately. Some series are weekly and provisional, some quarterly, some financial-year. Read the period field before comparing two records — most of the mistakes made with this data are made here.
- Snapshots and flows are not interchangeable. A count of people in a state on one date cannot be added to a count of events over a period. The dataset descriptions say which each one is.
- Check freshness before you trust a figure. /api/v1/status gives every dataset's age against the cadence window this site enforces. Currently 1 of 33 are past their window.
- Some rows carry an unverified badge. Curated cost figures include verified and illustrative columns. They travel with the data on purpose — do not drop them.
The human version of all of this: the download catalogue, methodology and data status.
Example
curl -s https://migrationwatchdog.com/api/v1/datasets | jq '.datasets[] | {id, title, rowCount}'
curl -s https://migrationwatchdog.com/api/v1/datasets/small-boats-monthly | jq '.rows[:5]'
curl -s https://migrationwatchdog.com/api/v1/status | jq '{newestDataset, overdue}'Newest dataset as of