Legislation API Reference
Search and retrieve UK legislation from legislation.gov.uk.
Base URL: https://api.govdata.dev/v1
Search Legislation
GET
/v1/legislation/search
response
Waiting for request...
Full-text search across UK legislation. Filter by type and year.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q |
string | Yes | Search query (matches title and content) |
type |
string | No | One of ukpga, uksi, ukla, wsi, ssi, nisi, nisr, asp, asc, or ukdsi |
year |
integer | No | Year of enactment (e.g. 2025) |
page |
integer | No | Page number (default 1, 20 results per page) |
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.govdata.dev/v1/legislation/search?q=employment&type=ukpga&year=2025"
uri = URI("https://api.govdata.dev/v1/legislation/search?q=employment&type=ukpga&year=2025") req = Net::HTTP::Get.new(uri) req["Authorization"] = "Bearer YOUR_API_KEY" res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
response = requests.get( "https://api.govdata.dev/v1/legislation/search", headers={"Authorization": "Bearer YOUR_API_KEY"}, params={"q": "employment", "type": "ukpga", "year": 2025} )
const url = new URL("https://api.govdata.dev/v1/legislation/search"); url.searchParams.set("q", "employment"); url.searchParams.set("type", "ukpga"); url.searchParams.set("year", "2025"); const response = await fetch(url, { headers: { "Authorization": "Bearer YOUR_API_KEY" } });
Response
{ "data": [ { "identifier": "ukpga/2025/36", "legislation_type": "ukpga", "type_name": "UK Public General Act", "year": 2025, "number": 36, "title": "Employment Rights Act 2025", "description": "An Act to make provision to amend the law relating to employment rights; to make provision about procedure for handling redundancies; to make provision about the treatment of workers involved in the supply of services under certain public contracts; to provide for duties to be imposed on employers in relation to equality; to amend the definition of “employment business” in the Employment Agencies Act 1973; to provide for the establishment of the School Support Staff Negotiating Body and Social Care Negotiating Bodies; to amend the Seafarers’ Wages Act 2023; to make provision for the implementation of international agreements relating to maritime employment; to make provision about trade unions, industrial action, employers’ associations and the functions of the Certification Officer; to make provision about the enforcement of legislation relating to the labour market; and for connected purposes.", "enacted_date": null, "commencement_date": null, "url": "https://www.legislation.gov.uk/ukpga/2025/36" } ], "meta": { "api_version": "v1", "licence": "Open Government Licence v3.0", "source": "legislation.gov.uk", "source_url": "https://www.legislation.gov.uk", "dataset_total": 79271, "latest_year": 2026, "last_synced_at": "2026-08-16T10:00:12.928Z" }, "pagination": { "total": 1, "page": 1, "per_page": 1, "total_pages": 1 } }
Get Legislation
GET
/v1/legislation/:type/:year/:number
response
Waiting for request...
Retrieve a specific piece of legislation by type, year, and number.
Path parameters
| Parameter | Type | Description |
|---|---|---|
type |
string | Any of the ten type codes listed above |
year |
integer | Year of enactment |
number |
integer | Legislation number within that year |
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.govdata.dev/v1/legislation/ukpga/2025/8
uri = URI("https://api.govdata.dev/v1/legislation/ukpga/2025/8") req = Net::HTTP::Get.new(uri) req["Authorization"] = "Bearer YOUR_API_KEY" res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
response = requests.get( "https://api.govdata.dev/v1/legislation/ukpga/2025/8", headers={"Authorization": "Bearer YOUR_API_KEY"} )
const response = await fetch("https://api.govdata.dev/v1/legislation/ukpga/2025/8", { headers: { "Authorization": "Bearer YOUR_API_KEY" } });
Response
{ "data": { "identifier": "ukpga/2025/1", "legislation_type": "ukpga", "type_name": "UK Public General Act", "year": 2025, "number": 1, "title": "Lords Spiritual (Women) Act 2015 (Extension) Act 2025", "description": "An Act to extend the period within which vacancies among the Lords Spiritual are to be filled by bishops who are women.", "enacted_date": null, "commencement_date": null, "url": "https://www.legislation.gov.uk/ukpga/2025/1" }, "meta": { "api_version": "v1", "licence": "Open Government Licence v3.0", "source": "legislation.gov.uk", "source_url": "https://www.legislation.gov.uk/ukpga/2025/1" } }
Legislation data is sourced from The National Archives with a sync scheduled every Sunday at 10am. All ten documented series are synchronised for 2000 to the present year. Contains public sector information licensed under the Open Government Licence v3.0.
Data Coverage
| Source | legislation.gov.uk (The National Archives) |
| Date range | 2000–present for all ten series (or the series' later inception) |
| Records | About 96,000 published series/year results through 2026: ukpga 938; uksi 51,969; wsi 6,735; ssi 11,280; nisi 114; nisr 9,050; asp 401; asc 34; ukla 67; ukdsi 5,402 |
| Updated | Weekly; historical backfill is resumable by type and year |
| Limitations | legislation.gov.uk's UKSI browse total includes Welsh SIs, so published series totals overlap. GovData stores each canonical identifier once under its canonical type. Draft instruments (ukdsi) can be withdrawn or replaced; local Acts (ukla) are sparse and some years have no publications. |