Public read-only API
Everything on UKSpend is queryable directly from a public REST endpoint — same data, same freshness, no signup. It is a thin PostgREST layer over our Postgres database, and it returns JSON or CSV. Please be considerate with request volume.
Authentication
Every request needs the public publishable anon key in both the apikey and Authorization: Bearer headers. That key is published on this page in the browser; it grants only the read-only access the website itself uses. Add Accept: text/csv to receive CSV instead of JSON.
Query syntax
Standard PostgREST: ?select=col1,col2, &order=col.desc, &limit=N, and filters such as &council=eq.lambeth, &fy=eq.2023-24 or &amount=gte.100000.
Endpoints
GET /councils— Directory of councils we track — slug, name, tier, region, publication threshold and sync status.GET /transactions— Raw payment lines. Always filter by council; filter further by date, amount, supplier or financial year, and paginate with limit/offset.GET /mv_national_vendor— Aggregated spend per supplier across every council we track.GET /mv_council_vendor_fy— Council × supplier × financial year rollup.GET /mv_national_category— Spend grouped by normalised category across all councils.GET /mv_national_supplier_category_fy— What each supplier was paid for, per financial year.GET /companies, /company_officers, /company_psc— Companies House data matched to vendors via the vendor_companies table.GET /political_control— Controlling party and leader per council per financial year.
Notes and limits
- Default response cap is 1,000 rows per request. Page with
limitandoffset, or use theRangeheader. - Always filter
/transactionsbycouncil— an unfiltered scan of ~16M rows will time out. - Data is licensed under the Open Government Licence v3.0. Attribution to the source councils is appreciated.