# Postcodes.io API: Get postcode details

> 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.

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

- Page: https://fous.com/methods/postcodes.io/get-postcode
- Method: `postcodes.io/get_postcode`, version 1
- Website: postcodes.io
- Returns: postcode, country, region, council, ward, parish, constituency, health board, coordinates, in_use, year_retired, area codes
- 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 |
|---|---|---|---|---|
| `postcode` | string | yes | `"SW1A 1AA"` | UK postcode, with or without a space and in any letter case, for example SW1A 1AA. |

## Output

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

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

Its output:

```json
{
  "ward": "St James's",
  "county": null,
  "in_use": true,
  "parish": "Westminster, unparished area",
  "region": "London",
  "country": "England",
  "eastings": 529090,
  "latitude": 51.50101,
  "postcode": "SW1A 1AA",
  "longitude": -0.141563,
  "northings": 179645,
  "page_link": "https://postcodes.io/postcodes/SW1A1AA",
  "area_codes": {
    "ward": "E05013806",
    "county": null,
    "parish": "E43000236",
    "local_council": "E09000033",
    "integrated_care_board": "E54000071",
    "parliamentary_constituency": "E14001172"
  },
  "year_retired": null,
  "local_council": "Westminster",
  "parliamentary_constituency": "Cities of London and Westminster",
  "health_board_or_integrated_care_board": "NHS West and North London Integrated Care Board"
}
```

## 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/get_postcode","input":{"postcode":"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 council and ward does the postcode SW1A 1AA fall under?
- Is the UK postcode M1 1AE still active or has it been retired, and if retired, when?
- Give me the constituency, region and coordinates for EH1 2NG on postcodes.io.
- Which parish and health board cover the postcode bs81uh?
- I need the country, latitude and longitude for the UK postcode ls1 4ap, plus its administrative area codes.

## Input schema

```json
{
  "type": "object",
  "required": [
    "postcode"
  ],
  "properties": {
    "postcode": {
      "type": "string",
      "minLength": 1,
      "description": "UK postcode, with or without a space and in any letter case, for example SW1A 1AA."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "postcode",
    "country",
    "region",
    "county",
    "local_council",
    "ward",
    "parish",
    "parliamentary_constituency",
    "health_board_or_integrated_care_board",
    "latitude",
    "longitude",
    "in_use",
    "year_retired",
    "page_link",
    "area_codes",
    "eastings",
    "northings"
  ],
  "properties": {
    "ward": {
      "type": [
        "string",
        "null"
      ],
      "description": "Administrative ward."
    },
    "county": {
      "type": [
        "string",
        "null"
      ],
      "description": "Administrative county, if applicable."
    },
    "in_use": {
      "type": "boolean",
      "description": "Whether the postcode is currently active."
    },
    "parish": {
      "type": [
        "string",
        "null"
      ],
      "description": "Civil parish or equivalent, if recorded."
    },
    "region": {
      "type": [
        "string",
        "null"
      ],
      "description": "Region, if available."
    },
    "country": {
      "type": [
        "string",
        "null"
      ],
      "description": "UK country."
    },
    "eastings": {
      "type": [
        "integer",
        "null"
      ],
      "description": "British National Grid easting when provided.",
      "x-fous-developer": true
    },
    "latitude": {
      "type": [
        "number",
        "null"
      ],
      "description": "Latitude in decimal degrees."
    },
    "postcode": {
      "type": "string",
      "description": "Postcode with standard spacing and uppercase letters."
    },
    "longitude": {
      "type": [
        "number",
        "null"
      ],
      "description": "Longitude in decimal degrees."
    },
    "northings": {
      "type": [
        "integer",
        "null"
      ],
      "description": "British National Grid northing when provided.",
      "x-fous-developer": true
    },
    "page_link": {
      "type": "string",
      "description": "Link to the postcode record on Postcodes.io."
    },
    "area_codes": {
      "type": "object",
      "required": [
        "local_council",
        "county",
        "ward",
        "parish",
        "parliamentary_constituency",
        "integrated_care_board"
      ],
      "properties": {
        "ward": {
          "type": [
            "string",
            "null"
          ]
        },
        "county": {
          "type": [
            "string",
            "null"
          ]
        },
        "parish": {
          "type": [
            "string",
            "null"
          ]
        },
        "local_council": {
          "type": [
            "string",
            "null"
          ]
        },
        "integrated_care_board": {
          "type": [
            "string",
            "null"
          ]
        },
        "parliamentary_constituency": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "description": "Official area identifiers supplied for the postcode; null where unavailable.",
      "x-fous-developer": true,
      "additionalProperties": false
    },
    "year_retired": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Year the postcode was retired, if known."
    },
    "local_council": {
      "type": [
        "string",
        "null"
      ],
      "description": "Local authority or council area."
    },
    "parliamentary_constituency": {
      "type": [
        "string",
        "null"
      ],
      "description": "UK parliamentary constituency."
    },
    "health_board_or_integrated_care_board": {
      "type": [
        "string",
        "null"
      ],
      "description": "Integrated care board in England or the available health authority or board elsewhere."
    }
  },
  "additionalProperties": false
}
```

## See more

- [Postcodes.io API: List nearby postcodes](https://fous.com/methods/postcodes.io/list-nearby-postcodes.md): 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.
- [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.
- [Zippopotam.us API: Get postal code](https://fous.com/methods/zippopotam.us/get-postal-code.md): Looks up the places, regions and coordinates for a postal code in a supported country on Zippopotam.us.
- [Zippopotam.us API: Search postal codes](https://fous.com/methods/zippopotam.us/search-postal-codes.md): Finds postal codes, place names and coordinates for a town and state or region in a country covered by Zippopotam.us.
- [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.
- [IPinfo API: Get IP location](https://fous.com/methods/ipinfo.io/get-ip-location.md): Finds the public location and network operator of an IPv4 or IPv6 address. Private and reserved addresses have no public location.
- [Postal PIN Code API: Get PIN code post offices](https://fous.com/methods/postalpincode.in/get-pin-code.md): Looks up an Indian six-digit PIN code and lists its post offices with branch type, delivery status and postal area.
- [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.
- [All Postcodes.io methods](https://fous.com/methods/postcodes.io.md)
