Skip to content
GET /v1/nearest

Postcodes near a postcode

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/postcode-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/postcode-api/v1/nearest" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/postcode-api/v1/nearest", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/postcode-api/v1/nearest");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/postcode-api/v1/nearest",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "count": 1,
        "postcode": "SW1A1AA",
        "postcodes": [
            {
                "ccg": "NHS North West London",
                "lsoa": "Westminster 018C",
                "msoa": "Westminster 018",
                "nuts": "Westminster",
                "incode": "1AA",
                "parish": "Westminster, unparished area",
                "region": "London",
                "country": "England",
                "outcode": "SW1A",
                "quality": 1,
                "eastings": 529090,
                "latitude": 51.50101,
                "postcode": "SW1A 1AA",
                "longitude": -0.141563,
                "northings": 179645,
                "admin_ward": "St James's",
                "distance_m": 0,
                "admin_county": null,
                "admin_district": "Westminster",
                "primary_care_trust": "Westminster",
                "nhs_health_authority": "London",
                "european_electoral_region": "London",
                "parliamentary_constituency": "Cities of London and Westminster"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-08T01:19:43.416Z",
        "request_id": "a48aa394-5f92-474d-8cee-fd285138bdec"
    },
    "status": "ok",
    "message": "Nearest postcodes retrieved successfully",
    "success": true
}