# England Flood Defence Schemes (`vespa-zzz/uk-flood-defence-schemes`) Actor

Completed flood and coastal risk management schemes from the Environment Agency. Filter by EA area, scheme name or homes better protected, and monitor new and revised records.

- **URL**: https://apify.com/vespa-zzz/uk-flood-defence-schemes.md
- **Developed by:** [Vespa ZZZ](https://apify.com/vespa-zzz) (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 results

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

## England Flood Defence Schemes

Get completed flood and coastal risk management schemes in England from the Environment Agency. Each row describes a published scheme or delivered phase. Use the data to track investment by EA area, identify relevant schemes for due diligence, or monitor new records and revisions to the reported number of homes better protected.

### Input

```json
{
    "areas": ["East Anglia", "53"],
    "keywords": ["bank", "flood"],
    "minHomesBetterProtected": 10,
    "maxItems": 100
}
```

| Field | Behaviour |
| --- | --- |
| `areas` | Match any published EA area name or code. Names are case-insensitive and codes are strings. An empty list includes all areas. |
| `keywords` | Match any substring in the scheme name, ignoring case. An empty list includes all names. |
| `minHomesBetterProtected` | Inclusive minimum. A scheme must have a published count if you set this filter. |
| `maxItems` | Save up to this many eligible rows, from 1 to 300. Defaults to 100. |
| `onlyNew` | Compare matching schemes with the last version saved under `stateKey`. Defaults to false. |
| `stateKey` | Monitoring baseline, default `default`. Use 1–50 letters, digits, underscores or hyphens. |

Different filters combine with AND. The completed schemes endpoint omits completion dates, completion financial years and named local authority or Westminster constituency geography. The Actor reports both completion fields as `null` and rejects `completedFrom`, `completedTo`, `localAuthorities` and `constituencies` in input. The capital programme ID identifies a multi-year programme. [Environment Agency API reference](https://environment.data.gov.uk/asset-management/doc/reference#completed-capital-schemes)

### Monitoring

```json
{
    "areas": ["52"],
    "keywords": ["Ten Mile Bank Emergency repairs"],
    "onlyNew": true,
    "stateKey": "east-anglia-ten-mile-bank"
}
```

Repeat the same input to report only newly matched projects (`changeType: "new"`) or revisions to previously saved rows (`"changed"`). The first run reports the matching schemes as new. Use a separate key for an independent baseline and schedule runs that share a key sequentially. Schemes that disappear from the list produce no event. If a filter excludes a revision, it remains eligible when the scheme matches again. The Actor checkpoints each successfully stored batch, including the stored portion of a batch cut short by a spending limit. Runs can repeat the last batch after an interruption between the dataset write and its checkpoint.

### Output

```json
{
    "projectId": "ACC451E/000A/633A",
    "name": "Ten Mile Bank Emergency repairs",
    "capitalProgrammeId": "CapitalProgramme2015To2023",
    "eaArea": "East Anglia",
    "eaAreaCode": "52",
    "riskManagementAuthority": "Environment Agency",
    "riskManagementAuthorityType": "Environment Agency",
    "completionDate": null,
    "completionFinancialYear": null,
    "homesBetterProtected": 39,
    "easting": 560040,
    "northing": 296020,
    "regions": [{ "code": "E12000006", "name": "East of England" }],
    "regionalFloodAndCoastalCommittee": "Anglian Great Ouse RFCC",
    "regionalFloodAndCoastalCommitteeCode": "anglian-great-ouse",
    "sourceUrl": "https://environment.data.gov.uk/asset-management/id/completed-capital-project/ACC451E/000A/633A",
    "source": "Environment Agency — Flood and Coastal Erosion Risk Management Completed Schemes. Contains public sector information licensed under the Open Government Licence v3.0 (https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)."
}
```

`riskManagementAuthorityType` preserves the published authority value. When that value is a generic category such as “Local Authority,” `riskManagementAuthority` is `null`. Easting and northing are British National Grid coordinates for the locality indicated by the EA. `homesBetterProtected` is the only benefit figure exposed by this endpoint. A missing count is `null`, and a published zero stays zero. [Dataset description](https://environment.data.gov.uk/asset-management/downloads/completed-schemes.pdf)

The Actor checks page URLs, offsets, limits and unique project IDs before saving any rows. The API omits a total, so the Actor verifies the computed total with an empty end-of-list probe. It reads at most three data pages plus the probe. The `RUN_SUMMARY` record reports the verified source count, matches, rows eligible for output, rows stored and any output limit reached.

### Data source and terms

Contains public sector information from the Environment Agency’s Flood and Coastal Erosion Risk Management Completed Schemes, licensed under the Open Government Licence v3.0. This independent Actor selects and reformats the published data and has no affiliation with the Environment Agency. [Source API](https://environment.data.gov.uk/asset-management/doc/reference) · [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)

### 日本語概要

イングランドの治水・沿岸対策の完了事業を、Environment Agency の公開 API から取得します。EA 地域、事業名、保護改善戸数で絞り込み、監視モードで新規事業と公表内容の改訂を取得できます。戸数が未公表の場合は `null` です。

# Actor input Schema

## `areas` (type: `array`):

Include any of these published EA area names or codes. For example, use East Anglia or 52. Names are matched without regard to case. Leave empty to include every area.

## `keywords` (type: `array`):

Include schemes whose names contain at least one of these words or phrases, ignoring case.

## `minHomesBetterProtected` (type: `integer`):

Only include schemes with a published count at or above this value. Set it to zero to include all published counts and exclude missing counts.

## `maxItems` (type: `integer`):

Maximum number of schemes to save in this run. In monitoring mode, eligible rows beyond the limit remain eligible for later runs.

## `onlyNew` (type: `boolean`):

Report each matching scheme on first sight and when its published fields change compared with the last saved version.

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

Reuse this key for related runs. Use a different key for a separate baseline. Enter 1 to 50 letters, digits, underscores or hyphens.

## Actor input object example

```json
{
  "areas": [
    "East Anglia"
  ],
  "maxItems": 100,
  "onlyNew": false,
  "stateKey": "default"
}
```

# Actor output Schema

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

No description

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

No description

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

No description

# 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 = {
    "areas": [
        "East Anglia"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vespa-zzz/uk-flood-defence-schemes").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 = { "areas": ["East Anglia"] }

# Run the Actor and wait for it to finish
run = client.actor("vespa-zzz/uk-flood-defence-schemes").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 '{
  "areas": [
    "East Anglia"
  ]
}' |
apify call vespa-zzz/uk-flood-defence-schemes --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vespa-zzz/uk-flood-defence-schemes"
        }
    }
}
```

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/EpcldL5eMeESIWrAE/builds/65cwkZnBD6oDc4tOm/openapi.json
