# UK Legislation Search: Acts, SIs, In-Force Status & Changes (`zaiqltd/uk-legislation-search`) Actor

UK Acts, statutory instruments and other legislation with type, number, dates, extent, revised version date, whole-item repeal, outstanding changes, contents and amendment history, from legislation.gov.uk (The National Archives). Search by title or full text, or look up by ID.

- **URL**: https://apify.com/zaiqltd/uk-legislation-search.md
- **Developed by:** [Zaiq](https://apify.com/zaiqltd) (community)
- **Categories:** Business, Education
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 legislation records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Legislation Search: Acts, SIs, In-Force Status & Changes

Search **UK legislation** on **legislation.gov.uk** (The National Archives' official open data, Open Government Licence) by title or full text, or look items up by identifier, and get one row per **Act of Parliament, statutory instrument, Scottish, Welsh or Northern Ireland Act or instrument, or retained EU law**: type, number, Royal Assent or made date, **where it applies (extent)**, the date of its **latest revised version**, whether the whole item has been **repealed or revoked**, the number of provisions, and the **changes not yet applied** to it, with the legislation making each change and whether it is in force.

Turn on the table of contents for every section, regulation and schedule with links, extent and repealed or prospective status, and the amendment history for the newest **amendments, repeals and commencements** affecting each item, each as its own row with in-force dates. Every search also gets a **free summary** with the total matches and counts by type.

No API key, login or proxy setup. The Actor follows legislation.gov.uk's fair use policy: it identifies itself and waits 5 seconds between requests, as the site's robots.txt asks.

Tested in Apify's cloud: the default input delivered 10 paid rows. The example below is a real delivered cloud row.

### What you get

| Field | What it holds |
|---|---|
| recordType | `legislation` and `change` are paid rows; `summary` is free. |
| legislationId, title, titleWelsh, type, typeName, category, year, number, alternativeNumbers | What the item is: e.g. ukpga/2018/12, Data Protection Act 2018, United Kingdom Public General Act, primary, 2018, chapter 12. |
| description, subjects, isbn | Long title or summary, subject headings (instruments) and ISBN. |
| madeOrEnactedDate, laidDate, comingIntoForceDates | Royal Assent or made date, laid date and the coming-into-force dates printed on instruments. |
| wholeRepealed, repealedDate | Whether legislation.gov.uk records the whole item as repealed or revoked, and when. |
| documentStatus, latestVersion, extent, provisionCount | revised (kept up to date) or final (as made); latest revised version date; where it applies (E+W+S+N.I.); number of provisions. |
| outstandingChanges, outstandingChangesList | Changes legislation.gov.uk knows about but has not applied yet: what changes, which provisions, made by what, and in-force status. |
| sections, sectionCount, repealedProvisions, prospectiveProvisions | With `includeSections`: the table of contents with links, extent and repealed or prospective (not yet in force) status. |
| changeType, affectedProvisions, affectingTitle, affectingId, affectingProvisions, applied, inForce | With `includeChanges`: one row per amendment, repeal or commencement, newest first. |
| url, pdfUrl, dataXmlUrl, explanatoryNotesUrl | Links to the item, the print PDF, XML and explanatory notes or memorandum. |
| publishedAt, updatedAt | When legislation.gov.uk first published and last updated it. |
| searchTerm, rank, totalFound, byType, status, note | The search, the position, and the free summary. |

### What people use it for

- **Legal research and compliance:** find the current Acts and instruments on a topic, where they apply, whether they are repealed, and what changes are still outstanding.
- **Regulatory change monitoring:** schedule runs on the Acts you care about with includeChanges and see new amendments, repeals and commencements as they are recorded.
- **Legal tech and AI:** feed structured legislation metadata, contents and change history into search, RAG or citation tools, with stable legislation.gov.uk identifiers.
- **Policy and public affairs:** track new statutory instruments under an Act, e.g. every commencement order for the Online Safety Act.
- **Education and publishing:** build reading lists and tables of contents with official links.
- **AI agents:** answer 'is the Data Protection Act 1984 still in force?' or 'what amends the Online Safety Act?' from the official source.

### How to use it

1. Enter **Searches** (title words, or set Search in to full text) and/or identifiers in **Look up legislation** (ukpga/2018/12 or a legislation.gov.uk link).
2. Optionally pick **Types** (Acts, SIs, Scottish, Welsh, Northern Ireland, EU-origin, drafts) and a year range.
3. Keep **Details and in-force status** on; add **Table of contents** or **Changes** if you need them.
4. Set **Maximum items per search** and a **Maximum cost per run** in Apify, then start.
5. Read the `legislation` and `change` rows and the free `summary` rows.

### Input

| Field | Example | Notes |
|---|---|---|
| searches | \["online safety", "data protection"] | 1-20 searches. |
| searchIn | "title" | title (fast) or text (full text; legislation.gov.uk takes 10-30 seconds a page). |
| legislation | \["ukpga/2023/50"] | Identifiers or legislation.gov.uk links, up to 100. |
| types | \["ukpga", "uksi"] | Empty = all UK legislation excluding EU-origin. |
| startYear / endYear | 2000 / 2026 | Year range. |
| maxResultsPerSearch | 10 | 1-500 paid items per search. |
| includeDetails | true | Extent, version, provisions and outstanding changes: one request per item. |
| includeSections | false | Table of contents (same request). |
| includeChanges | false | Newest changes per item as paid rows. |
| maxChangesPerItem | 20 | 1-500. |

### Output

Each result is one row in the run's dataset (download it as JSON, CSV, Excel, XML or HTML, or read it through the API). An example row (values shortened):

```json
{
  "recordType": "legislation",
  "resultId": "legislation-ukpga/2018/12",
  "legislationId": "ukpga/2018/12",
  "title": "Data Protection Act 2018",
  "titleWelsh": null,
  "type": "ukpga",
  "typeName": "United Kingdom Public General Act",
  "category": "primary",
  "year": 2018,
  "number": "12",
  "alternativeNumbers": [],
  "description": "An Act to make provision for the regulation of the processing of information relating to individuals; to make provision in connection with the Information Commissioner's functions under certain regulations relating to information; to make provision for a direct marketing code of practice; and for connected purposes.",
  "subjects": [],
  "madeOrEnactedDate": "2018-05-23",
  "laidDate": null,
  "comingIntoForceDates": null,
  "wholeRepealed": false,
  "repealedDate": null,
  "documentStatus": "revised",
  "latestVersion": "2026-09-30",
  "extent": "E+W+S+N.I.",
  "provisionCount": 1185,
  "outstandingChanges": 9,
  "outstandingChangesList": [
    {
      "type": "word substituted",
      "affectedProvisions": "s. 26(2)(f)(ai)",
      "affectingTitle": "The Data (Use and Access) Act 2025 (Consequential Amendments and Transitional Provision) Regulations 2026",
      "affectingId": "uksi/2026/386",
      "affectingProvisions": "Sch. 2 para. 23(2)(3)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "word substituted",
      "affectedProvisions": "s. 165(1)",
      "affectingTitle": "The Data (Use and Access) Act 2025 (Consequential Amendments and Transitional Provision) Regulations 2026",
      "affectingId": "uksi/2026/386",
      "affectingProvisions": "Sch. 2 para. 23(2)(3)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "words substituted",
      "affectedProvisions": "Sch. 3 para. 8(1)(q)(ii)",
      "affectingTitle": "Adoption and Children Act (Northern Ireland) 2022",
      "affectingId": "nia/2022/18",
      "affectingProvisions": "Sch. 3 para. 78(2)(a)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "words substituted",
      "affectedProvisions": "Sch. 3 para. 8(1)(q)(ii)",
      "affectingTitle": "Adoption and Children Act (Northern Ireland) 2022",
      "affectingId": "nia/2022/18",
      "affectingProvisions": "Sch. 3 para. 78(2)(b)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "added",
      "affectedProvisions": "Sch. 3 para. 8(1)(y)",
      "affectingTitle": "Adoption and Children Act (Northern Ireland) 2022",
      "affectingId": "nia/2022/18",
      "affectingProvisions": "Sch. 3 para. 78(3)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "substututed",
      "affectedProvisions": "Sch. 4 para. 3(4)(a)",
      "affectingTitle": "Adoption and Children Act (Northern Ireland) 2022",
      "affectingId": "nia/2022/18",
      "affectingProvisions": "Sch. 3 para. 79(2)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "words substituted",
      "affectedProvisions": "Sch. 4 para. 5(4)(a)",
      "affectingTitle": "Adoption and Children Act (Northern Ireland) 2022",
      "affectingId": "nia/2022/18",
      "affectingProvisions": "Sch. 3 para. 79(3)(a)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "words substituted",
      "affectedProvisions": "Sch. 4 para. 5(4)(a)",
      "affectingTitle": "Adoption and Children Act (Northern Ireland) 2022",
      "affectingId": "nia/2022/18",
      "affectingProvisions": "Sch. 3 para. 79(3)(b)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    },
    {
      "type": "words substituted",
      "affectedProvisions": "Sch. 3 para. 2(1)",
      "affectingTitle": "Veterans Advisory and Pensions Committees Act 2023",
      "affectingId": "ukpga/2023/48",
      "affectingProvisions": "s. 2(1)(l)",
      "inForce": [
        {
          "date": null,
          "qualification": null,
          "prospective": true
        }
      ]
    }
  ],
  "sectionCount": null,
  "repealedProvisions": null,
  "prospectiveProvisions": null,
  "isbn": "9780105700128",
  "explanatoryNotesUrl": "http://www.legislation.gov.uk/ukpga/2018/12/notes",
  "publishedAt": "2019-08-19T00:00:00Z",
  "updatedAt": "2026-09-30T10:46:18Z",
  "url": "https://www.legislation.gov.uk/ukpga/2018/12",
  "pdfUrl": "http://www.legislation.gov.uk/ukpga/2018/12/2026-09-30/data.pdf",
  "dataXmlUrl": "http://www.legislation.gov.uk/ukpga/2018/12/2026-09-30/data.xml",
  "changeType": null,
  "affectedId": null,
  "affectedTitle": null,
  "affectedProvisions": null,
  "affectingId": null,
  "affectingTitle": null,
  "affectingProvisions": null,
  "applied": null,
  "inForce": null,
  "searchTerm": "data protection (title)",
  "rank": 1,
  "status": null,
  "totalFound": null,
  "delivered": null,
  "alreadyDelivered": null,
  "byType": null,
  "note": null,
  "sourceUrl": "https://www.legislation.gov.uk/ukpga/2018/12/introduction/data.xml",
  "scrapedAt": "2026-11-12T19:14:00Z"
}
```

The example uses a real cloud row; large contents and amendment arrays are omitted for readability. Exported rows retain the requested details.

### Pricing

- **$0.002 per record ($2 per 1,000 legislation items or changes)**; $0.0018 on Silver and $0.0016 on Gold and higher plans, plus Apify's $0.00005 start.
- Summaries, items already delivered for another search in the same run, empty searches and failures are free.
- Cloud runs on 12 November 2026 charged exactly one event per delivered record.

What typical jobs cost at the list price:

| Job | Cost |
|---|---|
| Default: 10 items with details for 'data protection' (94 match) | $0.02 |
| Online Safety Act, an SI and a repealed Act with contents and 5 changes each (13 records) | $0.026 |
| 1,000 items or changes | $2.00 |
| An empty search | $0 |

Set Maximum cost per run in Apify. A cloud test on 12 November 2026 stopped cleanly at two paid rows with a $0.00505 limit; free summaries are retained.

### Tips

- Turn details off for quick lists: one request returns up to 100 items, instead of one request per item.
- Use quotes for exact titles, e.g. "Online Safety Act", and Types to keep to Acts or SIs.
- Look up an Act by identifier with includeChanges to see its newest amendments and commencements first.
- wholeRepealed false does not mean every provision is in force: check outstandingChanges, prospectiveProvisions (with the table of contents) and the change rows.

### Use it through the API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("zaiqltd/uk-legislation-search").call(run_input={"searches": ["online safety"], "types": ["ukpga", "uksi"], "maxResultsPerSearch": 5, "includeChanges": true, "maxChangesPerItem": 5})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row)
```

**JavaScript**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('zaiqltd/uk-legislation-search').call({"searches": ["online safety"], "types": ["ukpga", "uksi"], "maxResultsPerSearch": 5, "includeChanges": true, "maxChangesPerItem": 5});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**HTTP (one call, results back)**

```bash
curl -X POST 'https://api.apify.com/v2/acts/zaiqltd~uk-legislation-search/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"searches": ["online safety"], "types": ["ukpga", "uksi"], "maxResultsPerSearch": 5, "includeChanges": true, "maxChangesPerItem": 5}'
```

### Integrations and schedules

- **Schedules:** run it every hour, day or week from the Apify Console (Schedules) and keep a history of results.
- **Make, Zapier, n8n, Google Sheets, Slack, Airtable:** connect it through Apify's integrations, or send each finished run to a **webhook**.
- **Datasets:** results stay in the run's dataset; export them or read them by API whenever you need them.

### Use it with AI agents (MCP)

Add Apify's MCP server with this Actor already pinned (`https://mcp.apify.com?tools=zaiqltd/uk-legislation-search`) to Claude, ChatGPT, Cursor, VS Code or any MCP client. The agent can find this Actor and run it for you: ask it for UK Acts and statutory instruments about online safety, with extent, latest revised version, whole-item repeals and outstanding changes, plus the newest amendments to each. AI agents can also pay for runs directly through Apify's agentic payments.

### Limits

- The Actor waits 5 seconds between requests, as legislation.gov.uk's robots.txt asks, so details cost about 5 seconds per item.
- Revised legislation may not be fully up to date: outstanding changes are the ones legislation.gov.uk has recorded but not yet applied.
- A whole-item repeal is reported when legislation.gov.uk records it in the title; large Acts are often repealed provision by provision instead.
- Full text is linked (XML, PDF), not copied into rows.
- Only the public legislation.gov.uk data feeds are used, under the Open Government Licence v3.0.
- Title searches require every search word in the delivered title, with simple singular/plural matching. The source can match broader word stems; those rows are skipped without charge. Source match totals can include skipped broad matches.

### FAQ

**Do I need a legislation.gov.uk API key?**

No. legislation.gov.uk's open data needs no key; you only need your Apify account.

**Does it cover Scotland, Wales and Northern Ireland?**

Yes: Acts of the Scottish Parliament, Senedd Cymru and the Northern Ireland Assembly and their instruments, plus UK Acts and SIs and EU-origin legislation if you select it.

**How do I know if a law is in force?**

Use wholeRepealed and repealedDate for whole-item repeals, outstandingChanges for changes not yet applied, and the change rows' inForce dates; for section-level status turn on the table of contents.

**Can I reuse the data commercially?**

Yes. legislation.gov.uk content is Crown copyright under the Open Government Licence v3.0, which allows commercial reuse with attribution: 'Contains public sector information licensed under the Open Government Licence v3.0.'

### Related Actors from Zaiq

- [company-registry-search](https://apify.com/zaiq/company-registry-search): official UK and European company records
- [government-tenders-scraper](https://apify.com/zaiq/government-tenders-scraper): UK and EU public tenders and awards
- [google-news-scraper](https://apify.com/zaiq/google-news-scraper): news coverage of the same legislation

### Support

Questions, a site that changed, or a field you need? Open an issue on this Actor's **Issues** tab: we answer there, usually within a day.

***

Also found as: UK legislation API, legislation.gov.uk scraper, UK Acts of Parliament data, statutory instruments search, UK law in force status, legislation changes and amendments, Scottish and Welsh legislation, UK regulations tracker, repealed Acts, commencement orders.

# Actor input Schema

## `searches` (type: `array`):

1-20 searches, e.g. data protection, "Online Safety Act" or employment rights. Matched in titles, or in the full text with Search in = full text.

## `searchIn` (type: `string`):

Titles (fast) or the full text of the legislation (legislation.gov.uk takes 10-30 seconds a page).

## `legislation` (type: `array`):

Identifiers or links, e.g. ukpga/2018/12 or https://www.legislation.gov.uk/uksi/2026/386. Up to 100.

## `types` (type: `array`):

Leave empty for all UK legislation (excluding legislation originating from the EU).

## `startYear` (type: `integer`):

Only legislation from this year on.

## `endYear` (type: `integer`):

Only legislation up to this year.

## `maxResultsPerSearch` (type: `integer`):

A cap on paid legislation rows per search. The free summary still gives the total number of matches.

## `includeDetails` (type: `boolean`):

Extent, revised-version date, provision count, made dates and outstanding changes for each item: one more request per item (5 seconds each, as the site asks).

## `includeSections` (type: `boolean`):

Adds every section, regulation and schedule with its link, extent and repealed or prospective status (same request as the details).

## `includeChanges` (type: `boolean`):

Adds the newest changes affecting each item as paid change rows: amendments, repeals and commencements, applied or not, with in-force dates.

## `maxChangesPerItem` (type: `integer`):

Newest first. Big Acts have thousands of recorded changes.

## Actor input object example

```json
{
  "searches": [
    "online safety",
    "data protection"
  ],
  "searchIn": "title",
  "legislation": [],
  "types": [],
  "maxResultsPerSearch": 5,
  "includeDetails": true,
  "includeSections": false,
  "includeChanges": false,
  "maxChangesPerItem": 20
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset: the results.

## `summary` (type: `string`):

What each input returned, and notes.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searches": [
        "online safety",
        "data protection"
    ],
    "maxResultsPerSearch": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("zaiqltd/uk-legislation-search").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searches": [
        "online safety",
        "data protection",
    ],
    "maxResultsPerSearch": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("zaiqltd/uk-legislation-search").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searches": [
    "online safety",
    "data protection"
  ],
  "maxResultsPerSearch": 5
}' |
apify call zaiqltd/uk-legislation-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zaiqltd/uk-legislation-search"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gzeSzVAzFmDJ7funn/builds/zlohgxHNZa6FdHo7d/openapi.json
