Legislation.gov.uk Scraper
Pricing
from $3.00 / 1,000 results
Legislation.gov.uk Scraper
Scrape UK statute law from legislation.gov.uk. Fetch specific Acts and Statutory Instruments, browse by type and year, get the newest legislation, or search by title. Returns clean metadata plus official XML/PDF links.
Pricing
from $3.00 / 1,000 results
Rating
0.0
(0)
Developer
Crawler Bros
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
5 days ago
Last modified
Categories
Share
Scrape UK statute law straight from the official legislation.gov.uk service — Acts of Parliament, Statutory Instruments, devolved legislation for Scotland, Wales and Northern Ireland, and more. Fetch a specific piece of legislation, browse everything of a given type and year, pull the newest published items, or search by title. HTTP-only, no login, no proxy.
What this actor does
- Four modes:
browseByTypeYear,byLegislation,newest,search - 31 legislation types — from UK Public General Acts (
ukpga) and Statutory Instruments (uksi) to Acts of the Scottish Parliament (asp), Senedd Cymru (asc), the Northern Ireland Assembly (nia), and retained EU legislation (eur,eudn,eudr) - Clean metadata parsed from the official Atom feeds and item XML
- Official links to each item's web page, XML, PDF and table of contents
- Empty fields are omitted — every field in a record is populated
Modes
| Mode | What it does | Needs |
|---|---|---|
browseByTypeYear | List all legislation of a type (optionally one year) | legislationType (+ optional year) |
byLegislation | Fetch specific item(s) with full metadata | legislationType, year, number (or numbers) |
newest | Most recently published items of a type | legislationType |
search | Title search within a type (or across all types) | titleQuery (+ optional legislationType) |
Output fields
Feed-based modes (browseByTypeYear, newest, search) return a lightweight record per item; byLegislation returns the full item metadata. Fields that aren't available for a given item are omitted.
legislationType— type code (e.g.ukpga)typeTitle— human-readable type (e.g.UK Public General Act)year,number— the item's year and numbertitle— the legislation titlesummary— long title / description (feed modes)documentMainType— canonical classification (e.g.UnitedKingdomPublicGeneralAct)documentCategory—primaryorsecondary(byLegislation)documentStatus—revised,final,enacted(byLegislation)extent— territorial extent, e.g.E+W+S+N.I.(byLegislation)numberOfProvisions— provision count (byLegislation)statistics— paragraph/image counts:{ totalParagraphs, bodyParagraphs, scheduleParagraphs, attachmentParagraphs, totalImages }(byLegislation)enactmentDate,creationDate,madeDate— key datesvalidDate,modifiedDate,restrictStartDate— revision dates (byLegislation)alternativeNumber— e.g. Welsh series number (byLegislation)isbn— ISBN of the printed publicationpublisher— publishing authority (byLegislation)schemaVersion— legislation XML schema version (byLegislation)published,updated— feed timestamps (feed modes)url— official web page for the itemidUri— canonical identifier URIxmlUrl,contentsUrl— official XML and table-of-contents linkspdfUrl— official print PDF, English edition when bilingual (byLegislation)pdfSizeBytes— size of the print PDF in bytes (byLegislation)aknUrl— Akoma Ntoso XML (byLegislation)versionedXmlUrl— point-in-time XML (feed modes)recordType: "legislation",sourceUrl,scrapedAt
Input
| Field | Type | Default | Description |
|---|---|---|---|
mode | string | browseByTypeYear | browseByTypeYear / byLegislation / newest / search |
legislationType | string | ukpga | One of 31 type codes |
year | int | 2023 | Calendar year (required for byLegislation) |
number | int | – | Item number (byLegislation) |
numbers | array | – | Multiple item numbers (byLegislation) |
titleQuery | string | data protection | Title search text (search) |
maxItems | int | 50 | Hard cap (1–2000) |
Example: browse Acts of the Scottish Parliament for 2023
{ "mode": "browseByTypeYear", "legislationType": "asp", "year": 2023, "maxItems": 50 }
Example: fetch the Finance Act 2023
{ "mode": "byLegislation", "legislationType": "ukpga", "year": 2023, "number": 1 }
Example: newest UK Statutory Instruments
{ "mode": "newest", "legislationType": "uksi", "maxItems": 100 }
Example: title search for "data protection"
{ "mode": "search", "legislationType": "ukpga", "titleQuery": "data protection" }
Use cases
- Legal research — build a corpus of Acts and Statutory Instruments by type and year
- Compliance monitoring — track the newest legislation affecting your sector
- Legal tech — feed clean statute metadata and official XML/PDF links into your product
- Govtech & civic data — mirror UK legislation for open-data projects
- Academic research — bulk-export legislative metadata for analysis
FAQ
What is legislation.gov.uk? The official home of UK legislation, managed by The National Archives. It publishes most UK legislation and is free to use and re-use under the Open Government Licence.
What do the type codes mean? Each jurisdiction and instrument has a short code — ukpga (UK Public General Act), uksi (UK Statutory Instrument), asp (Act of the Scottish Parliament), asc (Act of Senedd Cymru), nia (Act of the Northern Ireland Assembly), and 26 more, all selectable in the input.
How do I find an item's number? Legislation is identified by type + year + number, e.g. the Finance Act 2023 is ukpga/2023/1. Use browseByTypeYear or search to discover numbers, then byLegislation for full detail.
What does extent mean? The territorial extent — where the legislation applies. E+W+S+N.I. means England, Wales, Scotland and Northern Ireland; S means Scotland only.
What's the difference between revised and enacted? documentStatus reflects whether you're seeing the up-to-date revised text or the text as originally enacted/made.
Is the data official? Yes — every record links back to the official legislation.gov.uk page, XML, PDF and table of contents.
How fresh is the data? legislation.gov.uk publishes new legislation continuously; the newest mode surfaces the latest items and each item carries published/updated timestamps.