Data
Legislation is public information, so OpenLegislation keeps it easy to reuse. There's no API key and nothing to sign up for: every link below is a plain HTTP GET, and the JSON can be fetched from any website.
An Act or instrument
Every page has the same address with .json or .md added:
.json- The item's details (title, citation, dates, extent, whether it is revised and to what date), its contents with a link to each provision, and the changes not yet written into its text.
.md- The whole text as Markdown, handy for feeding to an LLM.
For example, for the Equality Act 2010:
/equality-act-2010
/equality-act-2010.json
/equality-act-2010.md
The text as enacted or made is at /enacted, and the provisions that extend to one country at /england, /wales, /scotland or /northern-ireland, each with the same formats. legislation.gov.uk addresses work too: /ukpga/2010/15 redirects to the page, and /ukpga/2010/15/data.json to its JSON.
A provision
Each section, article, regulation, schedule paragraph, part and chapter has its own address, again with .json and .md. The JSON has the text, extent, status (repealed or prospective), the annotations and the changes not yet written in:
/equality-act-2010/section-13
/equality-act-2010/section-13.json
/equality-act-2010/schedule-1/paragraph-2.md
Listings and search
/browse.json every type held, by legislature
/uk.json one legislature's types
/browse/uk-public-general-acts.json one type's years
/browse/uk-public-general-acts/2010.json everything of that type and year
/search.json?q=equality titles
/search/text.json?q="reasonable adjustments" the text of every provision
Search results come 20 to a page: follow next for more. Counts stop at 1,000.
The shape of the JSON
Keys are snake_case, dates are ISO 8601, and a missing value is an explicit null. Every record has its own url and json_url, and its official version on legislation.gov.uk in provenance.source_url, with retrieved_at saying when it was copied. Every payload ends with licence, licence_url and attribution. A .json address that doesn't exist returns {"error": "Not found"} with a 404.
MCP server
OpenLegislation is also available as a Model Context Protocol (MCP) server, so AI assistants such as Claude, ChatGPT, Cursor and VS Code can find legislation, read its provisions, and check what has changed it and what is not yet written in. It is read-only, needs no key or sign-in, and serves the same data as these pages. Add this URL to your assistant as a connector:
https://openlegislation.uk/mcp
Opened in a browser, the same URL is the MCP page: how to connect, every tool it offers and its limits.
Licence
The legislation is Crown copyright and reused under the Open Government Licence v3.0. When you reuse it, give the attribution each payload carries: Contains public sector information licensed under the Open Government Licence v3.0. Source: legislation.gov.uk, The National Archives.
OpenLegislation is an independent project and is not affiliated with The National Archives. legislation.gov.uk is the official version: where anything here differs from it, legislation.gov.uk takes precedence.