Find UK postcodes within a radius (100-2000m) of a lat/lng, each with its distance in metr
Find UK postcodes within a radius (100-2000m) of a lat/lng, each with its distance in metres from the query point.
1000 (raw units)
price
2
calls / 30d
1
unique payers
2026-08-28
updated
Provider
postcode-api-production.up.railway.app · discovered, not yet claimed by its owner
Payment (x402 accepts[])
[
{
"scheme": "exact",
"network": "eip155:8453",
"payTo": "0xFFc458dB291b4ABcE020fE3de4f91F2770E537b1",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"amount": "1000",
"maxTimeoutSeconds": 300
}
]Output schema
{
"bazaar": {
"info": {
"input": {
"body": {
"lat": 51.5014,
"limit": 10,
"lng": -0.1419,
"radius": 1000
},
"bodyType": "json",
"method": "POST",
"type": "http"
},
"output": {
"example": {
"count": 1,
"lat": 51.5014,
"lng": -0.1419,
"radius_m": 1000,
"results": [
{
"admin_county": null,
"admin_district": "Westminster",
"admin_ward": "St James's",
"ccg": "NHS North West London",
"codes": {
"admin_district": "E09000033",
"admin_ward": "E05013806"
},
"country": "England",
"date_of_introduction": "198001",
"distance_m": 42.7,
"european_electoral_region": "London",
"incode": "1AA",
"latitude": 51.501009,
"longitude": -0.141588,
"lsoa": "Westminster 018C",
"msoa": "Westminster 018",
"nuts": "Westminster",
"outcode": "SW1A",
"parish": "Westminster, unparished area",
"parliamentary_constituency": "Cities of London and Westminster",
"postcode": "SW1A 1AA",
"primary_care_trust": "Westminster",
"quality": 1,
"region": "London"
}
]
},
"type": "json"
}
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"input": {
"additionalProperties": false,
"properties": {
"body": {
"properties": {
"lat": {
"description": "Latitude in decimal degrees, e.g. 51.5014.",
"type": "number"
},
"limit": {
"description": "Maximum number of postcodes to return (1-100, default 10).",
"maximum": 100,
"minimum": 1,
"type": "integer"
},
"lng": {
"description": "Longitude in decimal degrees, e.g. -0.1419.",
"type": "number"
},
"radius": {
"description": "Search radius in metres (100-2000, default 1000).",
"maximum": 2000,
"minimum": 100,
"type": "integer"
}
},
"required": [
"lat",
"lng"
],
"type": "object"
},
"bodyType": {
"enum": [
"json",
"form-data",
"text"
],
"type": "string"
},
"method": {
"enum": [
"POST",
"PUT",
"PATCH"
],
"type": "string"
},
"type": {
"const": "http",
"type": "string"
}
},
"required": [
"type",
"method",
"bodyType",
"body"
],
"type": "object"
},
"output": {
"properties": {
"example": {
"properties": {
"count": {
"type": "integer"
},
"lat": {
"type": "number"
},
"lng": {
"type": "number"
},
"radius_m": {
"type": "integer"
},
"results": {
"description": "Nearby postcode records, each with an added distance_m field (metres from the query point).",
"items": {
"properties": {
"admin_county": {
"type": [
"string",
"null"
]
},
"admin_district": {
"type": [
"string",
"null"
]
},
"admin_ward": {
"type": [
"string",
"null"
]
},
"ccg": {
"type": [
"string",
"null"
]
},
"codes": {
"type": "object"
},
"country": {
"type": "string"
},
"date_of_introduction": {
"type": [
"string",
"null"
]
},
"distance_m": {
"type": "number"
},
"european_electoral_region": {
"type": [
"string",
"null"
]
},
"incode": {
"type": "string"
},
"latitude": {
"type": [
"number",
"null"
]
},
"longitude": {
"type": [
"number",
"null"
]
},
"lsoa": {
"type": [
"string",
"null"
]
},
"msoa": {
"type": [
"string",
"null"
]
},
"nuts": {
"type": [
"string",
"null"
]
},
"outcode": {
"type": "string"
},
"parish": {
"type": [
"string",
"null"
]
},
"parliamentary_constituency": {
"type": [
"string",
"null"
]
},
"postcode": {
"type": "string"
},
"primary_care_trust": {
"type": [
"string",
"null"
]
},
"quality": {
"type": "integer"
},
"region": {
"type": [
"string",
"null"
]
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"input"
],
"type": "object"
}
}
}Use it
curl
curl "https://postcode-api-production.up.railway.app/lookup/nearest" # -> 402 Payment Required, accepts[] lists how to pay # retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://postcode-api-production.up.railway.app/lookup/nearest");
if (res.status === 402) {
const { accepts } = await res.json();
// pay one of accepts[] via an x402 client, then retry with the payment header
}Python
import httpx
res = httpx.get("https://postcode-api-production.up.railway.app/lookup/nearest")
if res.status_code == 402:
accepts = res.json()["accepts"]
# pay one of accepts[] via an x402 client, then retry with the payment headerMachine-readable
Everything on this page is also available as clean JSON at /resources/13274.json, and this resource appears in /discovery/resources and /discovery/search.