# Planningportal — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Find your Local Planning Authority by postcode or location and access their planning decision registers, along with comprehensive UK planning and building guidance all in one place. Quickly identify the right LPA for your planning needs and get direct links to their official planning information.

**Category:** Government & Public Data | **Website:** [planningportal.co.uk/](https://planningportal.co.uk/) | **Docs:** [parse.bot/marketplace/fa5d1113-4a7a-4a59-9e38-5aa98ee58b44/planningportal-co-uk-api](https://parse.bot/marketplace/fa5d1113-4a7a-4a59-9e38-5aa98ee58b44/planningportal-co-uk-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### find_lpa_by_postcode

Finds the Local Planning Authority responsible for a given UK postcode. Resolves the postcode to addresses with OS grid coordinates, then performs a spatial lookup to identify the LPA boundary. Returns both the resolved addresses and the matching LPA details including lpaCode and lpaName. A single postcode may resolve to multiple addresses but typically maps to one LPA.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `postcode` | string | Yes | UK postcode to lookup (e.g. 'SW1A 2AA', 'EC1A 1BB'). Spaces are optional. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/find_lpa_by_postcode \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"postcode":"<string>"}'
```

### get_common_paths

Returns a curated list of valid path slugs for guidance content on the Planning Portal. These paths can be used with the get_page_content endpoint to retrieve page content and metadata. The list covers planning applications, permissions, building control, services, and informational pages.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/get_common_paths \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_consent_types

Retrieves descriptions and slugs for all available planning consent types in England. Returns 14 consent types including householder planning, full planning, outline planning, listed building, advertisement, lawful development certificate, prior approval, reserved matters, and more. Each entry includes a title, slug, description, and full URL path.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/get_consent_types \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_lpa_details

Retrieves detailed contact and website information for a specific Local Planning Authority by its code. Returns contact details including name, email, website URL, address, and telephone numbers. LPA codes use a proprietary X-prefixed format (e.g. 'X5990' for Westminster City Council). Use find_lpa_by_postcode to discover the lpa_code for a given location.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `lpa_code` | string | Yes | The unique X-prefixed code of the LPA (e.g. 'X5990' for Westminster City Council). Discoverable via find_lpa_by_postcode endpoint. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/get_lpa_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lpa_code":"<string>"}'
```

### get_lpa_urls

Retrieves the direct URLs for an LPA's planning services, including the searchable planning application register and decision register. Returns an array of named service URLs with sort order. Invalid or unrecognized LPA codes will result in an upstream error from the API.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `lpa_code` | string | Yes | The unique X-prefixed code of the LPA (e.g. 'X5990' for Westminster City Council). Discoverable via find_lpa_by_postcode endpoint. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/get_lpa_urls \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lpa_code":"<string>"}'
```

### get_page_content

Retrieves static content and metadata for specific guidance pages on the Planning Portal via its Gatsby page-data backend. Returns the full page structure including content sections, breadcrumbs, and SEO metadata. Use get_common_paths to discover valid path slugs. Returns 404 (input_not_found) for invalid paths.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `path` | string | No | The slug/path of the page (e.g. 'planning/planning-applications', 'planning/appeals'). Use get_common_paths to discover valid paths. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planningportal-co-uk-api-fa5d1113/get_page_content \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path":"<string>"}'
```
