Legislation.gov.uk Scraper avatar

Legislation.gov.uk Scraper

Pricing

from $3.00 / 1,000 results

Go to Apify Store
Legislation.gov.uk Scraper

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

Crawler Bros

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

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

ModeWhat it doesNeeds
browseByTypeYearList all legislation of a type (optionally one year)legislationType (+ optional year)
byLegislationFetch specific item(s) with full metadatalegislationType, year, number (or numbers)
newestMost recently published items of a typelegislationType
searchTitle 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 number
  • title — the legislation title
  • summary — long title / description (feed modes)
  • documentMainType — canonical classification (e.g. UnitedKingdomPublicGeneralAct)
  • documentCategoryprimary or secondary (byLegislation)
  • documentStatusrevised, 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 dates
  • validDate, modifiedDate, restrictStartDate — revision dates (byLegislation)
  • alternativeNumber — e.g. Welsh series number (byLegislation)
  • isbn — ISBN of the printed publication
  • publisher — publishing authority (byLegislation)
  • schemaVersion — legislation XML schema version (byLegislation)
  • published, updated — feed timestamps (feed modes)
  • url — official web page for the item
  • idUri — canonical identifier URI
  • xmlUrl, contentsUrl — official XML and table-of-contents links
  • pdfUrl — 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

FieldTypeDefaultDescription
modestringbrowseByTypeYearbrowseByTypeYear / byLegislation / newest / search
legislationTypestringukpgaOne of 31 type codes
yearint2023Calendar year (required for byLegislation)
numberintItem number (byLegislation)
numbersarrayMultiple item numbers (byLegislation)
titleQuerystringdata protectionTitle search text (search)
maxItemsint50Hard 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.