# UK Legislation Monitor (`vizellie/uk-legislation-monitor`) Actor

Newly published UK legislation from the legislation.gov.uk Atom feed. One row per item, with a link to the official page. A schedule can keep only items that were not saved before.

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

## Pricing

from $2.00 / 1,000 saved items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Monitor

Read newly published UK legislation from the official Atom feed on legislation.gov.uk and save one row per item. The row has the title, the official id, the type when the id has one, the published and updated times, and a link to the official page.

Not legal advice and not an official government service. Source: legislation.gov.uk, the feed published by The National Archives.

The run does not download the PDF or the full text.

### Try this first

Every new item, at most 5 rows. Checked on 8 November 2026, the new-items feed on legislation.gov.uk returned HTTP 200, about 75 KB, 20 entries. The feed was updated at `2026-11-08T22:54:20Z`. The first saved row is below.

```json
{
  "maxResults": 5,
  "newItemsOnly": false
}
```

The form opens with **Max results** at 5 and **Type** empty. Leave **New items only** off.

Five saved items cost 5 x $0.002 = $0.01, plus the $0.00005 start fee.

### Who it is for

Legal, policy, and agency teams who want a repeatable list of what legislation.gov.uk has just published, and a schedule that reports only ids they have not already saved.

### What you get

- One row per feed entry, up to **Max results**.
- The title, with any markup removed. A bilingual title keeps the English span when the feed marks one.
- The official id on legislation.gov.uk, stored with https.
- The type taken from that id, such as `uksi` or `ukpga`, when the path has one.
- The published and updated times from the entry.
- A link to the official page. A PDF or XML alternate is used only when the entry has no other legislation.gov.uk link, which is what a correction slip looks like.
- New items only, for a schedule. Off by default. A normal run does not open a named store.
- A note when the feed does not respond, refuses the request, or is empty. Those runs do not charge an item row.

One run reads one feed page. On 8 November 2026 that page held 20 entries. It does not walk an archive.

The `ukpga` feed that evening started with a correction slip for a PDF, then `Sovereign Grant Act 2026` (`http://www.legislation.gov.uk/id/ukpga/2026/28`). A type filter of `ukpga` can therefore save the slip first. The slip row stores the link and does not download the file.

### Tutorial

1. Leave **Type** empty for a first look. Set it to `uksi` or another code from the field description when you want one type.
2. Leave **Max results** at 5 on the form. When the field is omitted, the run saves up to 40, still limited to the one feed page.
3. Leave **New items only** off until you schedule the task. Then turn it on and keep the same state key.
4. Run the Actor. The dataset has one row per saved item. The `OUTPUT` record says how many were saved.
5. Schedule the same task. A quiet feed still completes. You pay the start fee only.

### Example output

This is the first row from the all-new feed on 8 November 2026.

```json
{
  "title": "The Renewables Obligation and Electricity Capacity (Amendment) (British Industrial Competitiveness Scheme Excluded Electricity) Regulations 2026",
  "identifier": "https://www.legislation.gov.uk/id/uksi/2026/1171",
  "url": "https://www.legislation.gov.uk/uksi/2026/1171/made",
  "source": "legislation.gov.uk",
  "type": "uksi",
  "published": "2026-11-06T14:59:16.093966Z",
  "updated": "2026-11-06T15:55:23Z"
}
```

Open `url` for the official page. The second entry that evening was the Administrative and Financial Provisions Act (Northern Ireland) 2026, id `https://www.legislation.gov.uk/id/nia/2026/10`.

### Pricing

You pay a small fee when the run starts, then a fee for each item row that is saved.

| What | Price |
|---|---|
| Run start | $0.00005 |
| Saved item | $0.002 |

Rows that were not saved are free. That includes an empty feed, ids already seen, rows past **Max results**, a timeout, and an HTTP error, including a 403.

**Examples**

- The form on 8 November 2026, 5 items saved: 5 x $0.002 = **$0.01**, plus the $0.00005 start fee.
- The omitted cap, when the page has 20 items: 20 x $0.002 = **$0.04**, plus the start fee.
- Forty saved items: 40 x $0.002 = **$0.08**, plus the start fee.
- A scheduled run that saves 3 new items: 3 x $0.002 = **$0.006**, plus the start fee.
- An empty feed: **$0.00005**.

Use **Max results** and Apify's maximum cost per run to cap a single run. The pricing tab on the store is the price you are charged if it ever differs.

### Scheduling and integrations

Save a task, turn on **New items only**, and schedule it daily with the same state key. The dataset can go to Google Sheets, Slack, email, Make or Zapier, or you can read it from the Apify API.

An update to an id you already saved is not a new row. The link on the old row still opens the official page.

### Nederlands

Dit leest nieuwe Britse wetgeving uit de Atom-feed van legislation.gov.uk. De eerste proef is alle nieuwe items, maximaal 5 rijen.

Op 8 november 2026 had die feed 20 items. De eerste was The Renewables Obligation and Electricity Capacity (Amendment) (British Industrial Competitiveness Scheme Excluded Electricity) Regulations 2026, id `uksi/2026/1171`. De ukpga-feed begon die avond met een correction slip (een PDF-link), daarna de Sovereign Grant Act 2026. De PDF wordt niet gedownload.

Een lege feed, een time-out, een HTTP-fout of een 403 wordt niet per rij gerekend. De prijs is $0.00005 bij de start en $0.002 per opgeslagen item.

Geen juridisch advies en geen officiële overheidsdienst. Bron: legislation.gov.uk (The National Archives).

### No personal data

This Actor does not collect personal data beyond the title published on the feed.

- It reads feed metadata. It does not request a person or an account.
- PDFs, XML, and the full text are not downloaded and are not stored.
- Email addresses and phone numbers are removed if they appear in a title.
- The state store, when new items only is on, keeps legislation ids. It does not keep the title.
- Raw responses are not stored.

### FAQ

**Why is an Act missing?**
This run reads the latest new-items page, not the whole statute book. An older Act is not on that page. A `ukpga` filter still only reads that type's new feed, which can start with a correction slip.

**What if the feed is empty?**
The run finishes. The summary says the feed had no new items. You pay the start fee only. `ukppa` and `uksro` returned an empty feed on 8 November 2026.

**What if the feed is down or returns 403?**
The run finishes and the summary says so. No item row is charged.

**Where do the items come from?**
The legislation.gov.uk new-items feed from The National Archives. This Actor is not affiliated with The National Archives. Read the official page before you act on an item.

### Next additions

- Save an item again when the same id comes back with a newer updated time.

### Feedback

Missing a field? Open an issue on the Actor's Issues tab.

# Actor input Schema

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

Official type code, or empty for every newly published item. Codes that returned a feed on 8 November 2026: ukpga, uksi, ukla, ukppa, asp, ssi, wsi, anaw, asc, nia, nisr, ukcm, ukmo, mwa, uksro, nisro, sdsi, nisi, aosp, ukci. ukppa and uksro were empty that day. A ukpga feed can start with a correction slip.

## `maxResults` (type: `integer`):

Most items saved in one run, from 1 to 100. When this field is omitted the run saves up to 40. The form starts at 5. The feed page itself is short. Rows past the cap are not charged.

## `newItemsOnly` (type: `boolean`):

Save only items whose official id was not saved by an earlier run with the same state store and state key. Off by default, so a normal run does not need a named store.

## `stateStoreName` (type: `string`):

Named key-value store used only when new items only is on. It remembers legislation ids, not the text.

## `stateKey` (type: `string`):

Key inside the state store. Use a different key for each schedule.

## Actor input object example

```json
{
  "type": "uksi",
  "maxResults": 5,
  "newItemsOnly": false,
  "stateStoreName": "uk-legislation-state",
  "stateKey": "default"
}
```

# Actor output Schema

## `items` (type: `string`):

Title, official id, type, dates, and the legislation.gov.uk page.

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

The OUTPUT record in the default key-value store.

# 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 = {
    "maxResults": 5,
    "stateKey": "default"
};

// Run the Actor and wait for it to finish
const run = await client.actor("vizellie/uk-legislation-monitor").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 = {
    "maxResults": 5,
    "stateKey": "default",
}

# Run the Actor and wait for it to finish
run = client.actor("vizellie/uk-legislation-monitor").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 '{
  "maxResults": 5,
  "stateKey": "default"
}' |
apify call vizellie/uk-legislation-monitor --silent --output-dataset

```

## MCP server setup

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

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/eZ2DTVgpShW1GPgZ5/builds/9oIwbeIKy3J2ELJBP/openapi.json
