Discover/Gov API
live

Gov APIlegislation.gov.uk

Search and retrieve UK Acts of Parliament, Statutory Instruments, and other legislation. Access titles, tables of contents, and full section text via 3 endpoints.

This API takes change requests — .
Endpoint health
verified 1h ago
search_legislation
get_legislation_section
get_legislation_contents
3/3 passing latest checkself-healing
Endpoints
3
Updated
2h ago

What is the Gov API?

The legislation.gov.uk API provides 3 endpoints for searching and reading official UK legislation, covering Acts of Parliament, Statutory Instruments, and more. Use search_legislation to find laws by title, year, number, or type, get_legislation_contents to retrieve a structured table of contents, and get_legislation_section to read the full text of any individual section, complete with amendment annotations.

This call costs1 credit / call— charged only on success
Try it
Page number for pagination.
Legislation type filter. Common values: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Acts of Scottish Parliament), ssi (Scottish Statutory Instruments), primary, secondary.
Year of legislation to search within (e.g. '2018'). Used as a relevance signal, not a strict filter.
Search term to match against legislation titles (e.g. 'data protection', 'employment').
Legislation number to search for.
api.parse.bot/scraper/47dc5438-5519-4ae0-bec1-bb2697e07c18/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/47dc5438-5519-4ae0-bec1-bb2697e07c18/search_legislation?type=all&year=2018&title=data+protection&page=1&number=12' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 3 totalmissing one? ·

Search UK legislation by title, year, number, and/or type. Returns paginated results ordered by relevance. At least one of title, year, or number must be provided. Each result includes the legislation identifier, title, year, number, and type.

Input
ParamTypeDescription
pageintegerPage number for pagination.
typestringLegislation type filter. Common values: ukpga (UK Public General Acts), uksi (UK Statutory Instruments), asp (Acts of Scottish Parliament), ssi (Scottish Statutory Instruments), primary, secondary.
yearstringYear of legislation to search within (e.g. '2018'). Used as a relevance signal, not a strict filter.
titlestringSearch term to match against legislation titles (e.g. 'data protection', 'employment').
numberstringLegislation number to search for.
Response
{
  "type": "object",
  "fields": {
    "page": "current page number",
    "results": "array of legislation items, each with id, title, uri, legislation_type, year, number, and updated timestamp",
    "total_pages": "total number of pages available",
    "total_results": "number of results on this page",
    "items_per_page": "number of results per page"
  },
  "sample": {
    "data": {
      "page": 1,
      "results": [
        {
          "id": "http://www.legislation.gov.uk/id/ukpga/2018/12",
          "uri": "http://www.legislation.gov.uk/id/ukpga/2018/12",
          "year": "2018",
          "title": "Data Protection Act 2018",
          "number": "12",
          "updated": "2026-07-09T10:58:22+01:00",
          "legislation_type": "UnitedKingdomPublicGeneralAct"
        }
      ],
      "total_pages": 5,
      "total_results": 20,
      "items_per_page": 20
    },
    "status": "success"
  }
}

About the Gov API

Searching UK Legislation

search_legislation accepts any combination of title, year, number, and type parameters — at least one must be provided. The type parameter accepts standard abbreviations: ukpga for UK Public General Acts, uksi for UK Statutory Instruments, and asp for Acts of the Scottish Parliament, among others. Results are paginated (controlled by the page parameter) and each item in the results array includes id, title, uri, legislation_type, year, number, and an updated timestamp. Note that year acts as a relevance signal rather than a strict filter, so results may include legislation from adjacent years.

Navigating Legislation Structure

get_legislation_contents takes a legislation_id in the format type/year/number — for example, ukpga/2018/12 for the Data Protection Act 2018 — and returns the title, description, and a flat contents array. Each entry in contents carries a type field (values include part, chapter, item, schedule, pblock, division, and crossheading), a number, a title, a uri, and a depth indicating its position in the hierarchy. This structure lets you enumerate all navigable sections before fetching their text.

Reading Section Text

get_legislation_section retrieves the readable text of a specific section. The section parameter follows the legislation's URL path structure: section/1, part/2/chapter/1, or schedule/1. The response includes text (paragraphs separated by newlines), section_title, section_number, legislation_title, and echoes back the legislation_id and section path. Where sections carry amendment annotations in the official XML source, those annotations appear inline in the returned text.

Reliability & maintenanceVerified

The Gov API is a managed, monitored endpoint for legislation.gov.uk — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when legislation.gov.uk changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official legislation.gov.uk API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
1h ago
Latest check
3/3 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Checking whether a specific section of the Data Protection Act 2018 is still in force by reading its text and amendment annotations.
  • Building a legal research tool that lets users search Acts by title keyword and browse their full table of contents.
  • Extracting all sections from a Statutory Instrument (uksi) to feed into a document summarisation pipeline.
  • Comparing the structure of multiple pieces of employment legislation by enumerating their contents arrays.
  • Monitoring updates to specific legislation by storing the updated timestamp from search results and checking for changes.
  • Indexing UK legislation titles and identifiers by year for an offline reference dataset.
  • Pulling the full text of individual schedules from Acts of the Scottish Parliament (asp) for compliance analysis.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo2005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min
Team$300/mo20,000300 req/min
Company$1,000/mo100,000500 req/min

Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does legislation.gov.uk have an official developer API?+
Yes. The National Archives publishes an official REST API for legislation.gov.uk, documented at https://www.legislation.gov.uk/developer/. It exposes Atom feeds and XML/HTML representations of legislation documents.
What does search_legislation return, and can I filter strictly by year?+
Each result in the results array includes id, title, uri, legislation_type, year, number, and an updated timestamp. The year parameter is used as a relevance signal, not a hard filter, so results may occasionally include items from years close to the one specified. To narrow by type, supply the type parameter alongside year.
Does the API return the full text of an entire Act in a single call?+
Not currently. The API retrieves one section at a time via get_legislation_section. To get full Act text, you would call that endpoint once per entry in the table of contents returned by get_legislation_contents. You can fork this API on Parse and revise it to add a bulk-text endpoint that aggregates all sections automatically.
Are historical (revised) versions of legislation accessible?+
The API returns the text available for a given legislation identifier without version-date parameters. Requesting a specific point-in-time version — for example, the text of an Act as it stood on a particular date — is not currently supported by the endpoints. You can fork the API on Parse and revise it to pass version date parameters supported by the official legislation.gov.uk data service.
What legislation types are covered, and is Welsh or Northern Irish legislation included?+
The type parameter supports ukpga (UK Public General Acts), uksi (UK Statutory Instruments), and asp (Acts of the Scottish Parliament), along with other types present on legislation.gov.uk such as Welsh statutory instruments (wsi) and Northern Ireland Orders in Council. Coverage depends on what legislation.gov.uk has published; not all historical legislation is available in a machine-readable form on the source site.
Page content last updated . Spec covers 3 endpoints from legislation.gov.uk.
Related APIs in Government PublicSee all →
indiacode.nic.in API
Search and retrieve Indian legislation from indiacode.nic.in. Browse Central and State Acts, look up individual sections, and extract fully structured act content by keyword or handle ID.
legiscan.com API
Track and monitor legislative bills across all US states, search by topic or bill number, and access full bill text and datasets to stay informed on current legislation. Get detailed information on bill status, sponsors, and voting records without needing authentication.
bailii.org API
Search and retrieve court judgments and case law from British and Irish courts across multiple jurisdictions, with filtering by date range and location. Access complete case details including full judgment text and metadata to research legal precedents and decisions.
devgan.in API
Search and explore Indian legal acts like the IPC, BNS, and CrPC by browsing chapters, viewing detailed section information, and finding cross-references between different laws. Navigate through legislative classifications, search across acts, and access comprehensive details on specific sections all in one place.
diariodarepublica.pt API
Search and retrieve official Portuguese legislation, decrees, and resolutions published in the Diário da República, organized by publication series and date. Browse acts from both Serie I and Serie II to stay updated on the latest government publications and legal announcements.
eur-lex.europa.eu API
Access and explore the complete collection of European Union laws, regulations, and Official Journal publications through a comprehensive database that lets you search documents, retrieve full texts, summaries, and metadata, and track legislative procedures and national implementations. Find exactly what you need with detailed search capabilities and get detailed information about how EU laws are transposed into national legislation.
boe.es API
Access Spain's official government publications to retrieve daily legislative summaries, browse consolidated laws, and view detailed legal documents with their full text and metadata. Stay informed about new regulations and find specific legislation through comprehensive search and retrieval of official state gazette content.
developer.company-information.service.gov.uk API
Search for UK registered companies and retrieve detailed information including company profiles, officer names, and their dates of birth. Access comprehensive corporate records directly from the official Companies House register to verify business details and identify key personnel.