How to hit the Postcodes.io API

Postcodes.io at https://api.postcodes.io looks up UK postcodes: coordinates, district, ward, constituency, and more. Open data from the ONS.

Authentication

None — no key, no signup. Every example runs as-is.

Full reference: https://postcodes.io/docs

Look up a postcode

curl https://api.postcodes.io/postcodes/SW1A1AA
Run in PostTaco
Example response (trimmed)
{
  "status": 200,
  "result": {
    "postcode": "SW1A 1AA",
    "quality": 1,
    "eastings": 529090,
    "northings": 179645,
    "country": "England",
    "nhs_ha": "London",
    "longitude": -0.141563,
    "latitude": 51.50101,
    "european_electoral_region": "London",
    "primary_care_trust": "Westminster",
    "region": "London",
    "lsoa": "Westminster 018C",
    "msoa": "Westminster 018",
    "incode": "1AA",
    "outcode": "SW1A"
  }
}

Postcodes near a point

curl "https://api.postcodes.io/postcodes?lon=-0.1278&lat=51.5074&limit=2"
Run in PostTaco
Example response (trimmed)
{
  "status": 200,
  "result": [
    {
      "postcode": "WC2N 5DU",
      "quality": 1,
      "eastings": 529995,
      "northings": 180358,
      "country": "England",
      "nhs_ha": "London",
      "longitude": -0.128269,
      "latitude": 51.507211,
      "european_electoral_region": "London",
      "primary_care_trust": "Westminster",
      "region": "London",
      "lsoa": "Westminster 018C",
      "msoa": "Westminster 018",
      "incode": "5DU",
      "outcode": "WC2N"
    },
    {
      "postcode": "WC2N 5DX",
      "quality": 1,
      "eastings": 529989,
      "northings": 180358,
      "country": "England",
      "nhs_ha": "London",
      "longitude": -0.128355,
      "latitude": 51.507212,
      "european_electoral_region": "London",
      "primary_care_trust": "Westminster",
      "region": "London",
      "lsoa": "Westminster 018C",
      "msoa": "Westminster 018",
      "incode": "5DX",
      "outcode": "WC2N"
    }
  ]
}

Bulk lookup

curl -X POST https://api.postcodes.io/postcodes \
  -H "Content-Type: application/json" \
  -d '{"postcodes": ["SW1A 1AA", "EC1A 1BB"]}'
Run in PostTaco
Example response (trimmed)
{
  "status": 200,
  "result": [
    {
      "query": "SW1A 1AA",
      "result": {
        "postcode": "SW1A 1AA",
        "quality": 1,
        "eastings": 529090,
        "northings": 179645,
        "country": "England",
        "nhs_ha": "London",
        "longitude": -0.141563,
        "latitude": 51.50101,
        "european_electoral_region": "London",
        "primary_care_trust": "Westminster",
        "region": "London",
        "lsoa": "Westminster 018C",
        "msoa": "Westminster 018",
        "incode": "1AA",
        "outcode": "SW1A"
      }
    },
    {
      "query": "EC1A 1BB",
      "result": {
        "postcode": "EC1A 1BB",
        "quality": 1,
        "eastings": 531073,
        "northings": 182317,
        "country": "England",
        "nhs_ha": "London",
        "longitude": -0.112017,
        "latitude": 51.524567,
        "european_electoral_region": "London",
        "primary_care_trust": "Islington",
        "region": "London",
        "lsoa": "Islington 022F",
        "msoa": "Islington 022",
        "incode": "1BB",
        "outcode": "EC1A"
      }
    }
  ]
}