UK Legislation Section Retrieval — legislation.gov.uk avatar

UK Legislation Section Retrieval — legislation.gov.uk

Pricing

from $13.40 / 1,000 completed section retrievals

Go to Apify Store
UK Legislation Section Retrieval — legislation.gov.uk

UK Legislation Section Retrieval — legislation.gov.uk

Retrieve individual sections of UK legislation from the official legislation.gov.uk service.

Pricing

from $13.40 / 1,000 completed section retrievals

Rating

0.0

(0)

Developer

NexGen Watch

NexGen Watch

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

📚 UK Legislation Section Retrieval — legislation.gov.uk

Retrieve individual sections of UK legislation from the official legislation.gov.uk service. Give it section references; get back, for each, the Act title, section heading, extent, and the section text — the primary source a legal, compliance or policy workflow needs, with a link to the official page.

Output is one section_record row per result; billing is pay-per-event, the value event being one completed section retrieval (a $0.02 start fee per run, then $0.02 per completed section retrieval). Source: www.legislation.gov.uk.

No login, no API key and no CAPTCHA solving are involved: the source is read logged-out with an identified contact User-Agent.

📊 Sample Output

UK Legislation Section Retrieval — legislation.gov.uk sample output — a table of real completed section retrieval rows (input, exists, legislation_type, act_title) from run KWr98tFwpJTagUjYF on build 0.1.10

Real rows from run KWr98tFwpJTagUjYF on build 0.1.10 (2026-09-17), the same input as the Quick start below — every value is as the source published it (emails masked, long text shortened):

inputexistslegislation_typeact_titlesection_headingextent
ukpga/2010/15/1TrueukpgaEquality Act 2010Socio-economic inequalitiesE+W+S+N.I.
ukpga/1998/42/section/6TrueukpgaHuman Rights Act 1998Public authoritiesE+W+S+N.I.

The run finished with the status message: NORMAL: 2 retrieved (0 unavailable, 0 unparseable) of 2 | section-record billable=2 | section-record charged=2

✅ What you get

Each row is flat JSON with these fields (from the dataset schema and the sample run; a field the source does not publish for a given row is null):

  • record_type (string) — e.g. section_record
  • input (string/null) — e.g. ukpga/2010/15/1
  • exists (boolean/null) — e.g. True
  • legislation_type (string/null) — e.g. ukpga
  • year (string/null) — e.g. 2010
  • number (string/null) — e.g. 15
  • section (string/null) — e.g. 1
  • act_title (string/null) — e.g. Equality Act 2010
  • section_heading (string/null) — e.g. Socio-economic inequalities
  • extent (string/null) — e.g. E+W+S+N.I.
  • text_blocks (integer/null) — e.g. 62
  • section_text (string/null) — e.g. An authority to which this section applies must, when making decisions of a stra
  • source (string/null) — e.g. https://www.legislation.gov.uk/ukpga/2010/15/section/1
  • unavailable_reason (string/null) — null in every sample row

⚙️ Sample inputs

1. Quick start — the Store example (this is what the sample above came from)

{
"sections": [
"ukpga/2010/15/1",
"ukpga/1998/42/section/6"
]
}

The sample run charged exactly: 1 × $0.02 apify-actor-start + 2 × $0.02 section-record = $0.06 on the Free tier — every delivered row was billed.

2. A smaller, narrowed run

{
"sections": [
"ukpga/2010/15/1",
"ukpga/1998/42/section/6"
]
}

A bounded run for checking the field shape before scheduling.

3. A full-size run

{
"sections": [
"ukpga/2010/15/1",
"ukpga/1998/42/section/6"
]
}

The same input run on a schedule; each run is billed only for what it delivers.

🧾 JSON sample record

One real record from run KWr98tFwpJTagUjYF, exactly as it lands in the dataset (emails masked, long text shortened):

{
"record_type": "section_record",
"input": "ukpga/2010/15/1",
"exists": true,
"legislation_type": "ukpga",
"year": "2010",
"number": "15",
"section": "1",
"act_title": "Equality Act 2010",
"section_heading": "Socio-economic inequalities",
"extent": "E+W+S+N.I.",
"text_blocks": 62,
"section_text": "An authority to which this section applies must, when making decisions of a strategic nature about how to exercise its functions, have due regard to the desirability of exercising them in a way that is designed to reduce the inequalities of",
"source": "https://www.legislation.gov.uk/ukpga/2010/15/section/1",
"unavailable_reason": null
}

🔧 How it works

Transport. Requests go through Apify residential proxy because the source refuses datacenter egress. Every request carries an identified contact User-Agent. Pacing: CRAWL_DELAY_SEC=5.0.

Charging. Each completed section retrieval is charged at the moment it is pushed (section-record); a row that fails to charge is not delivered, so the dataset count always equals the charged count.

What is and is not a retrieval

A completed retrieval is one reference the service resolved — an existing section (with its text) or a well-formed reference the service returns 404 for ("no such section", which is a sourced answer). Both are charged. A malformed reference or a service outage is not a retrieval and is not charged; those rows appear in the "issues" view. A run that retrieves nothing fails loud and charges nothing.

Source & pacing

The official legislation.gov.uk service, queried anonymously (no key). The actor honours the site's Crawl-delay: 5 (one request every 5 seconds) and bounds a run to 40 sections.

What is not done. No login, no cookie or CAPTCHA bypass, no private or personal-account data, no browser automation.

💰 Pricing example

EventFreeBronzeSilverGold
Actor Start (apify-actor-start)$0.02$0.02$0.02$0.02
Completed section retrieval (section-record)$0.02$0.02$0.02$0.01

Worked at the live Free-tier price:

  • 2 completed section retrievals: $0.02 start + 2 × $0.02 = $0.06
  • 25 completed section retrievals: $0.02 start + 25 × $0.02 = $0.52
  • 100 completed section retrievals: $0.02 start + 100 × $0.02 = $2.02

A run that delivers zero rows charges the $0.02 start fee only. A BLOCKED run (source refused) fails loud and charges no value event. The start fee is charged once per GB of run memory; the default run memory is 1024 MB.

Yield on the sample run: NORMAL: 2 retrieved (0 unavailable, 0 unparseable) of 2 | section-record billable=2 | section-record charged=2.

This actor reads public, logged-out pages and feeds published by www.legislation.gov.uk. It collects only what the source publishes to any visitor, identifies itself with a contact User-Agent, and does not access accounts, private data or anything behind authentication. Use the output in line with the source's terms and your local law; the intended use is B2B research and monitoring.

❓ FAQ

Q: Do I need an API key or a login?
A: No. The source (www.legislation.gov.uk) is read logged-out; the input schema has no key field and the actor carries no secrets.

Q: Why did my run return 0 rows?
A: Read the run's status message. GENUINE_EMPTY means the source was read and had nothing in scope for your input; BLOCKED means the source refused and the run failed without billing a value event — retry later or narrow the input. A zero-row run bills the start fee only.

Q: How fresh is the data?
A: Every run reads the source live at run time; nothing is cached between runs. Put it on a schedule for a continuous feed.

Q: What formats can I export?
A: The dataset downloads as JSON, CSV, Excel, XML or RSS from the run's Dataset tab or the Apify API, and any run can push to a webhook or integration.

Q: How is this different from the other public records lookups actors?
A: Same output shape and billing model; this one covers www.legislation.gov.uk. The siblings under Related Actors cover the other sources or slices — run several on one schedule for a combined feed.

Q: Are there rate limits?
A: The actor paces itself against the source (CRAWL_DELAY_SEC=5.0); there is no per-buyer limit beyond your Apify plan's concurrency.

🆘 Troubleshooting

  • Run FAILED with BLOCKED → the source refused the request or changed its page shape → nothing was billed beyond the start fee; retry after a while, and if it persists open an Issue with the run id.
  • Fewer rows than expected → the source had fewer items in scope → widen the input.
  • Input validation error on start → a field is outside the schema's allowed values → start from the Quick start block and change one field at a time.
  • Run TIMED-OUT → a very wide request on a slow day → raise the run timeout in Run options or narrow the input; what was delivered before the timeout is still in the dataset.
  • Residential proxy unavailable → the actor falls back to a direct request, which the source refuses → the run fails loud and bills nothing; make sure your plan includes residential proxy.

⭐ Found this useful?

If this actor saved you a manual check, a quick review on the Apify Store helps other teams find it. Feature request or a source that changed? Open it from the Issues tab — every one is read.