# Postcodes.io: UK postcode lookup

UK postcode lookup from Postcodes.io: coordinates, council area, ward, parliamentary constituency, region and census areas for a postcode, nearest postcodes to a point, and postcode autocomplete.

- No API key needed to call
- Source: [Postcodes.io](https://postcodes.io/)
- Licence and terms: [Open Government Licence v3.0 and OS OpenData](https://postcodes.io/about)
- Coverage: United Kingdom
- Answers are shared and cached for 86400 seconds.

## Questions you can ask

- Where is postcode SW1A 2AA and which constituency is it in? (operation `postcodes_io_lookup`)
- What postcodes are near 51.5035, -0.1276 in London? (operation `postcodes_io_near_point`)
- Which postcodes start with SW1A 2? (operation `postcodes_io_autocomplete`)

## Operations

### UK postcode details

Answers: where is this UK postcode \(latitude, longitude\) and which council, ward, constituency, region and census areas does it belong to?

- `postcode`: required, string, UK postcode, for example SW1A 2AA.

Example: Where is postcode SW1A 2AA and which constituency is it in?

Over MCP:

```
{"tool":"call_connector_operation","arguments":{"connector":"postcodes_io","operation":"postcodes_io_lookup","params":{"postcode":"SW1A 2AA"}}}
```

Over HTTP:

```
curl '/v1/connectors/postcodes_io/postcodes_io_lookup?postcode=SW1A+2AA'
```

### Nearest UK postcodes to a coordinate

Answers: what are the nearest UK postcodes to this latitude and longitude, and which area does the point sit in?

- `lat`: required, number, Latitude in the United Kingdom.
- `lon`: required, number, Longitude in the United Kingdom.
- `limit`: optional, integer, default 5

Example: What postcodes are near 51.5035, -0.1276 in London?

Over MCP:

```
{"tool":"call_connector_operation","arguments":{"connector":"postcodes_io","operation":"postcodes_io_near_point","params":{"lat":51.5035,"lon":-0.1276,"limit":3}}}
```

Over HTTP:

```
curl '/v1/connectors/postcodes_io/postcodes_io_near_point?lat=51.5035&lon=-0.1276&limit=3'
```

### Complete a partial UK postcode

Answers: which full UK postcodes start with these characters?

- `postcode`: required, string, Start of a UK postcode.

Example: Which postcodes start with SW1A 2?

Over MCP:

```
{"tool":"call_connector_operation","arguments":{"connector":"postcodes_io","operation":"postcodes_io_autocomplete","params":{"postcode":"SW1A 2"}}}
```

Over HTTP:

```
curl '/v1/connectors/postcodes_io/postcodes_io_autocomplete?postcode=SW1A+2'
```

## Source notice

Source: Postcodes.io, built on ONS and Ordnance Survey open data. Terms were not quoted here: see the terms page. Contains OS data \(c\) Crown copyright and database right, and Royal Mail data under the open licences stated by the service.

## Missing something?

Tell us what data, endpoint or feature you wish we had. It is free and needs no signup: call the MCP tool request_capability, or POST a short description to https://agentnative.dennery.ai/v1/capabilities/request.
