Reverse Geocode an Outcode
This endpoint returns the nearest outcodes for a given longitude and latitude coordinate pair.
Each outcode in the results includes a distance
field that indicates the distance in meters from the specified coordinates to the outcode.
Endpoint
GET https://api.postcodes.io/outcodes?lon=[longitude]&lat=[latitude]
Example Request
https://api.postcodes.io/outcodes?lon=-0.127&lat=51.507
Example Response
{
"status": 200,
"result": [
{
"outcode": "SW1A",
"longitude": -0.127325,
"latitude": 51.501009,
"northings": 179951,
"eastings": 529825,
"admin_district": [
"Westminster"
],
"parish": [
"Westminster, unparished area"
],
"admin_county": [],
"admin_ward": [
"St James's",
"Vincent Square"
],
"country": [
"England"
],
"distance": 672.3056261
}
// Truncated for brevity
]
}
Request Parameters
Parameter | Required | Description |
---|---|---|
lon | Yes | The longitude coordinate. Must be a valid WGS84 longitude value between -180 and 180. |
lat | Yes | The latitude coordinate. Must be a valid WGS84 latitude value between -90 and 90. |
Optional Query Parameters
Parameter | Description | Default | Constraints | Example |
---|---|---|---|---|
limit | Limits number of outcode matches to return | 10 | Maximum value is 100 | &limit=5 |
radius | Sets search radius in meters | 5,000m | Maximum value is 25,000m | &radius=10000 |