| name | uk-legislation-api |
| title | UK Legislation API (legislation.gov.uk) |
| description | Access UK laws and statutory instruments via the Legislation.gov.uk API |
| author | wentorai |
| author_url | https://github.com/wentorai/research-plugins/tree/main/skills/domains/law/uk-legislation-api |
| license | MIT |
| version | 0.1.0 |
| execution_mode | open |
| jurisdiction | gb |
| practice | general |
| language | en |
UK Legislation API (legislation.gov.uk)
Overview
The Legislation.gov.uk API, maintained by The National Archives, provides open access to the full text of UK legislation from 1267 to the present day. The database covers over 100,000 items including Acts of Parliament, Statutory Instruments, Scottish and Welsh legislation, and Northern Ireland statutes. All data is available as structured XML with Dublin Core metadata, Atom feeds, and HTML. The API supports point-in-time versions showing how legislation read at any given date, plus amendment tracking.
Authentication
No authentication or API key is required. The API is fully open. Respect rate limits by adding reasonable delays between bulk requests.
URL Structure
All legislation follows the pattern:
https://www.legislation.gov.uk/{type}/{year}/{number}
Legislation Types
| Type Code | Description | Example |
|---|
ukpga | UK Public General Act | /ukpga/2010/15 (Equality Act 2010) |
uksi | UK Statutory Instrument | /uksi/2020/1374 |
asp | Act of Scottish Parliament | /asp/2020/13 |
asc | Act of Senedd Cymru (Wales) | /asc/2021/4 |
nia | Northern Ireland Act | /nia/2022/2 |
ukla | UK Local Act | /ukla/2008/1 |
ukdsi | UK Draft Statutory Instrument | /ukdsi/2023/123 |
eur | Retained EU Legislation | /eur/2016/679 (GDPR) |
Core Endpoints
Full Legislation Text (XML)
curl "https://www.legislation.gov.uk/ukpga/2010/15/data.xml"
curl
curl