# 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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/planningportal/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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/credits/planningportal/find-lpa-by-postcode \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/planningportal/get-common-paths \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/planningportal/get-consent-types \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/planningportal/get-lpa-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/planningportal/get-lpa-urls \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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/credits/planningportal/get-page-content \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"path":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.