# England Planning Constraints - Flood, Listed, Conservation (`j0401/uk-planning-constraints`) Actor

Answer 'what planning constraints apply here?' for an England postcode or coordinate: flood risk, conservation areas, listed buildings, Article 4, green belt, tree preservation zones, scheduled monuments, ancient woodland and more. Catalogue mode lists every dataset.

- **URL**: https://apify.com/j0401/uk-planning-constraints.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 england planning constraint 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

## England Planning Constraints - Flood, Listed, Conservation

Check what planning constraints cover an England postcode or coordinate, from
the government's open planning-data service (OGL v3): **223 datasets**, with
**780,636 flood-risk-zone** records, **131,446 listed-building outlines**,
**104,923 tree-preservation zones**, **44,375 ancient woodlands**, **20,159
scheduled monuments**, **11,156 conservation areas**, and more. Counts
measured **20 October 2026**.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you receive.

### What you get

**`mode=datasets`** (the default run) returns the curated catalogue - one row
per dataset with its live entity count and whether it supports a point query.

**`mode=search`** returns every constraint whose geometry covers the
postcode or coordinate you give.

| field | meaning |
|---|---|
| `dataset` | constraint layer, e.g. `flood-risk-zone` |
| `entity`, `reference`, `name` | dataset identifiers and the entity name |
| `prefix`, `typology` | dataset prefix and whether it is a geography or legal instrument |
| `entryDate`, `startDate`, `endDate` | dataset record dates |
| `quality` | `authoritative` where the source flags it |
| `organisationEntity` | the publishing organisation |
| `latitude`, `longitude`, `point` | the entity's representative point |
| `entityUrl`, `datasetUrl` | the full entity JSON and the dataset page |
| `documentUrl`, `documentationUrl` | the published evidence document, where present |
| `attributes` | every other dataset-specific field, as JSON on entity results (e.g. listed-building grade, flood-risk level); in catalogue mode, the dataset description |
| `totalMatched` | total entities matching the point across the queried datasets |

### Curated datasets

| dataset | entities | point query |
|---|---:|---|
| `flood-risk-zone` | 780,636 | yes |
| `listed-building` | 382,373 | no (point layer) |
| `tree` | 273,075 | no (point layer) |
| `listed-building-outline` | 131,446 | yes |
| `tree-preservation-order` | 129,123 | no (legal instrument) |
| `tree-preservation-zone` | 104,923 | yes |
| `ancient-woodland` | 44,375 | yes |
| `brownfield-land` | 40,116 | no (point layer) |
| `scheduled-monument` | 20,159 | yes |
| `conservation-area` | 11,156 | yes |
| `article-4-direction-area` | 7,578 | yes |
| `site-of-special-scientific-interest` | 4,128 | yes |
| `green-belt` | 181 | yes |
| `area-of-outstanding-natural-beauty` | 34 | yes |
| `heritage-coast` | 32 | yes |
| `national-park` | 10 | yes |

### Search it

- **Postcode** - `postcode="SW1A1AA"` (spaces are ignored).
- **Coordinates** - `latitude=51.5`, `longitude=-0.12`.
- **One dataset** - `dataset="flood-risk-zone"`.

### Example inputs

**Everything covering one postcode**

```json
{ "mode": "search", "postcode": "SW1A1AA" }
```

**Flood risk at a coordinate**

```json
{ "mode": "search", "latitude": 51.5, "longitude": -0.12,
  "dataset": "flood-risk-zone" }
```

**Listed-building and conservation-area check**

```json
{ "mode": "search", "postcode": "SW1A1AA", "dataset": "conservation-area" }
```

**The catalogue with counts**

```json
{ "mode": "datasets" }
```

### Example output

```json
{
 "dataset": "listed-building-outline",
 "entity": "42167304",
 "name": "Buckingham Palace The Mall London SW1A 1AA",
 "reference": "1239087",
 "prefix": "listed-building-outline",
 "typology": "geography",
 "entryDate": "1970-02-05",
 "startDate": "1970-02-05",
 "quality": "authoritative",
 "organisationEntity": "387",
 "latitude": "51.500773",
 "longitude": "-0.142542",
 "point": "POINT (-0.142542 51.500773)",
 "entityUrl": "https://www.planning.data.gov.uk/entity/42167304.json",
 "datasetUrl": "https://www.planning.data.gov.uk/dataset/listed-building-outline",
 "attributes": "{\"listed-building\": \"1239087\"}",
 "totalMatched": 1
}
```

### Notes on the data, from the source

- **Constraints, not applications.** The planning-data service carries the
  constraint layers (flood, conservation, listed, Article 4, green belt,
  TPO and environmental designations) but **no planning application records**
  - its application count is zero. This actor does not pretend otherwise.
- **Point-only layers cannot be searched by point.** `listed-building`,
  `tree`, `tree-preservation-order` and `brownfield-land` are published
  without polygon geometry, so the service's point query cannot match them.
  Their counts are in the catalogue, and asking for one in search mode fails
  with an explanation rather than an empty result.
- **England coverage.** The datasets are published by English planning
  authorities; Scotland, Wales and Northern Ireland have their own planning
  portals.
- **Geometry is not mirrored.** The actor returns the representative point
  and the entity URL; fetch the entity URL for the full polygon.
- **Licence.** Open Government Licence v3 - commercial reuse is permitted,
  with attribution. This is an independent data service, not an official
  government service.

Data source: `planning.data.gov.uk` (Ministry of Housing, Communities and
Local Government).

# Actor input Schema

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

datasets = the curated catalogue with counts (default). search = constraints covering a postcode or coordinate.

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

Search one constraint layer. Blank searches every spatially queryable curated layer. Point-only layers (listed-building, tree, tree-preservation-order, brownfield-land) cannot be point-queried.

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

Full England postcode, spaces optional (e.g. "SW1A1AA" or "SW1A 1AA"). Partial codes are rejected: the source would drop the anchor and return the whole corpus. Use either a postcode or latitude+longitude.

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

Latitude, with longitude (e.g. "51.5"). Use either coordinates or a postcode.

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

Longitude, with latitude (e.g. "-0.12").

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

Cap the number of constraint rows pushed (0 = the default 50). The source API caps a single query at 500.

## Actor input object example

```json
{}
```

# Actor output Schema

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

England planning constraint records - as JSON

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

No description

## `runUrl` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/uk-planning-constraints").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("j0401/uk-planning-constraints").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 '{}' |
apify call j0401/uk-planning-constraints --silent --output-dataset

```

## MCP server setup

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

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/pPQOgiUFOkhFMtPqK/builds/qFn2PuD1fSdxgeY6V/openapi.json
