# Postcodes.io API: List nearby postcodes

> Lists UK postcodes nearest to a postcode or named place, with distance, ward, council and coordinates. For places sharing a name, a city or town is preferred.

Unofficial. Not affiliated with or endorsed by Postcodes.io.

- Page: https://fous.com/methods/postcodes.io/list-nearby-postcodes
- Method: `postcodes.io/list_nearby_postcodes`, version 1
- Website: postcodes.io
- Returns: postcode, distance, ward, council, latitude, longitude, page URL
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `near` | string | yes | `"SW1A 1AA"` | A UK postcode or place name, for example SW1A 1AA or Oxford. |
| `max_results` | integer | no |  | Maximum number of nearest postcodes, for example 10. Default 10. |
| `radius_metres` | integer | no |  | Maximum distance in metres from the postcode or place, for example 1000. Default 1000. |

## Output

From a run on Oct 23, 2026, shortened. Its input:

```json
{
  "near": "SW1A 1AA"
}
```

Its output:

```json
{
  "postcodes": [
    {
      "ward": "St James's",
      "latitude": 51.50101,
      "page_url": "https://postcodes.io/postcodes/SW1A%201AA",
      "postcode": "SW1A 1AA",
      "longitude": -0.141563,
      "local_council": "Westminster",
      "distance_metres": 0
    },
    {
      "ward": "St James's",
      "latitude": 51.499933,
      "page_url": "https://postcodes.io/postcodes/SW1E%206LA",
      "postcode": "SW1E 6LA",
      "longitude": -0.141117,
      "local_council": "Westminster",
      "distance_metres": 123.67233656624896
    },
    {
      "ward": "St James's",
      "latitude": 51.499738,
      "page_url": "https://postcodes.io/postcodes/SW1E%206AY",
      "postcode": "SW1E 6AY",
      "longitude": -0.140736,
      "local_council": "Westminster",
      "distance_metres": 152.5853742672548
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"postcodes.io/list_nearby_postcodes","input":{"near":"SW1A 1AA"}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- What postcodes are within 500 metres of SW1A 1AA, and which councils do they belong to?
- Give me the 15 closest UK postcodes to Oxford with their wards and coordinates.
- Find nearby postcodes around Leeds city centre within a 1500 metre radius, including distances.
- I need the nearest postcodes to M1 1AE on postcodes.io, up to 20 results, with latitude and longitude.
- List the postcodes within 800 metres of Bristol Temple Meads showing ward and council names.

## Input schema

```json
{
  "type": "object",
  "required": [
    "near"
  ],
  "properties": {
    "near": {
      "type": "string",
      "minLength": 1,
      "description": "A UK postcode or place name, for example SW1A 1AA or Oxford."
    },
    "max_results": {
      "type": "integer",
      "default": 10,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of nearest postcodes, for example 10."
    },
    "radius_metres": {
      "type": "integer",
      "default": 1000,
      "maximum": 2000,
      "minimum": 1,
      "description": "Maximum distance in metres from the postcode or place, for example 1000."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "postcodes"
  ],
  "properties": {
    "postcodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ward": {
            "type": [
              "string",
              "null"
            ]
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ]
          },
          "page_url": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ]
          },
          "local_council": {
            "type": [
              "string",
              "null"
            ]
          },
          "distance_metres": {
            "type": "number"
          }
        }
      },
      "description": "Postcodes ordered nearest first."
    }
  }
}
```

## See more

- [Postcodes.io API: Get postcode details](https://fous.com/methods/postcodes.io/get-postcode.md): Looks up a UK postcode on Postcodes.io, including its location, administrative areas and whether it is still in use. Retired postcodes return location and retirement year only.
- [data.police.uk API: Get crimes near a UK postcode or place](https://fous.com/methods/data.police.uk/get-crimes-near-postcode.md): Gets crimes reported within one mile of a UK postcode or place in England, Wales or Northern Ireland for a month (latest published by default), with category totals, up to 100 sampled incidents, the previous month's total and the local police.uk crime-map link.
- [police.uk API: Get neighbourhood policing team by postcode](https://fous.com/methods/police.uk/get-neighbourhood-team.md): Finds the neighbourhood policing team for a UK postcode (England, Wales, Northern Ireland) with its force, contacts, officers, priorities and upcoming events.
- [NHS API: Search nearby services](https://fous.com/methods/nhs.uk/search-nearby-services.md): Find nearby NHS service listings from a UK postcode or town, nearest first. NHS service search covers England; urgent_care returns A&E listings. Hours, patient availability and websites are null when not shown.
- [Open Charge Map API: Search EV chargers near a place](https://fous.com/methods/openchargemap.org/search-chargers.md): Finds Open Charge Map charging locations near an address, city, or postcode, nearest first.
- [Postal PIN Code API: Search post offices by place](https://fous.com/methods/postalpincode.in/search-pin-codes.md): Finds Indian post offices matching a place name, with PIN codes, branch types, delivery statuses, districts and states. Optionally narrows by state or district.
- [Starbucks API: Find nearby cafés](https://fous.com/methods/starbucks.com/search-stores.md): Finds Starbucks cafés near a city, address or ZIP code, nearest first, with whether each is open now, today's local hours and amenities; optionally only cafés open now.
- [GreatSchools API: Search schools near a location](https://fous.com/methods/greatschools.org/search-schools.md): Finds GreatSchools schools within 5 miles of a US address, city or ZIP code. Results can be filtered by grade and school type and sorted by distance or rating.
- [All Postcodes.io methods](https://fous.com/methods/postcodes.io.md)
