Skip to main content

Reverse Geocode a Postcode

This endpoint returns the nearest postcodes for a given longitude and latitude coordinate pair.

Each postcode in the results includes a distance field that indicates the distance in meters from the specified coordinates to the postcode.

Endpoint

GET https://api.postcodes.io/postcodes?lon=[longitude]&lat=[latitude]

Example Request

https://api.postcodes.io/postcodes?lon=-0.127&lat=51.507

Example Response

{
"status": 200,
"result": [
{
"postcode": "SW1A 2DD",
"quality": 1,
"eastings": 530075,
"northings": 180339,
"country": "England",
"nhs_ha": "London",
"longitude": -0.127149,
"latitude": 51.50702,
"european_electoral_region": "London",
"primary_care_trust": "Westminster",
"region": "London",
"lsoa": "Westminster 018C",
"msoa": "Westminster 018",
"incode": "2DD",
"outcode": "SW1A",
"parliamentary_constituency": "Cities of London and Westminster",
"parliamentary_constituency_2024": "Cities of London and Westminster",
"admin_district": "Westminster",
"parish": "Westminster, unparished area",
"admin_county": null,
"date_of_introduction": "198001",
"admin_ward": "St James's",
"ced": null,
"ccg": "NHS North West London",
"nuts": "Westminster",
"pfa": "Metropolitan Police",
"codes": {
"admin_district": "E09000033",
"admin_county": "E99999999",
"admin_ward": "E05013806",
"parish": "E43000236",
"parliamentary_constituency": "E14001172",
"parliamentary_constituency_2024": "E14001172",
"ccg": "E38000256",
"ccg_id": "W2U3Z",
"ced": "E99999999",
"nuts": "TLI35",
"lsoa": "E01004736",
"msoa": "E02000977",
"lau2": "E09000033",
"pfa": "E23000001"
},
"distance": 10.58165325
}
// Truncated for brevity
]
}

Request Parameters

ParameterRequiredDescription
lonYesThe longitude coordinate. Must be a valid WGS84 longitude value between -180 and 180.
latYesThe latitude coordinate. Must be a valid WGS84 latitude value between -90 and 90.

Optional Query Parameters

ParameterDescriptionDefaultConstraintsExample
limitLimits number of postcode matches to return10Maximum value is 100&limit=5
radiusSets search radius in meters100mMaximum value is 2,000m&radius=500
widesearchEnables a wide area search up to 20km radius, but returns a maximum of 10 results. When set to true, any radius over 10 and limit parameters are ignoredfalse-&widesearch=true