Data // API

The THRIVE data API

Every number on our data pages is available as free JSON and CSV. No key, no sign-up, open CORS. Built on official OGL sources and THRIVE-computed figures.

Discovery

One request returns the whole catalogue — every dataset with its unit, methodology, and JSON/CSV URLs:

curl https://www.thrivefleet.co.uk/api/v1

Endpoints

Response shape

Every response is JSON with a consistent envelope — a source line, a terms link, a methodology URL, the unit, and the data:

{
  "source": "THRIVE Fleet Cost Index — …/data/fleet-cost-index",
  "terms":  "https://www.thrivefleet.co.uk/data/terms",
  "unit":   "pence per mile",
  "weeks":  [ { "week": "2026-07-20", "diesel_van_ppm": 21.1, … } ]
}

CSV

Append ?format=csv to any series endpoint for a download, e.g. /api/v1/cost-index?format=csv. Series endpoints serve a rolling 26-week open window. /api/v1/rates is JSON only — it returns current values, not a series, and ignores the parameter.

CORS & caching

All endpoints send Access-Control-Allow-Origin: * and are cache-friendly (s-maxage=600, stale-while-revalidate). Please cache responses rather than polling aggressively so it stays free for everyone.

Attribution

Attribution is requested, never required — a link to THRIVE is appreciated but is not a condition of use, and any rel attribute (including nofollow) is fine. Underlying GOV.UK data is Open Government Licence v3.0. Full terms: /data/terms.