# UK Postcode Nearest Lookup

> UK Postcode Nearest Lookup is a paid API for AI agents from postcode-api-production.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Returns UK postcodes within a specified radius (100–2000m) of a latitude/longitude point, each with its distance in metres.

## Facts

- Endpoint: POST https://postcode-api-production.up.railway.app/lookup/nearest
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/uk-postcode-nearest-lookup-44bf14c2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3ggOah-ttftWm3EqjW-AR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability uk-postcode-nearest-lookup-44bf14c2 -d '<json body>'
```

Example prompt: Can you find all UK postcodes within 500 metres of latitude 51.5014, longitude -0.1419, and give me up to 20 results sorted by how close they are?

## When to prefer this

Use this endpoint when you need to discover all UK postcodes within a specific geographic radius of known coordinates, especially when distance from the query point matters (e.g. building delivery zones, catchment areas, or proximity-ranked lists). Prefer this over a text search or single postcode lookup when you have lat/lng rather than a postcode or address, and you need multiple nearby results with distances.

## Known failure modes

- Radius out of range (must be 100–2000m) returns validation error
- Limit out of range (must be 1–100) returns validation error
- Invalid or missing lat/lng returns a bad request error
- No postcodes found within the specified radius returns an empty list
- Coordinates outside the UK may return empty results or unexpected data
- Payment failure or insufficient balance returns 402 error

## How this service works

Find UK postcodes within a radius (100-2000m) of a lat/lng, each with its distance in metres from the query point.

## Output

A list of UK postcode records each containing the postcode string and its distance in metres from the query lat/lng, ordered by proximity, up to the requested limit.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat": {
   "type": "number",
   "description": "Latitude in decimal degrees, e.g. 51.5014."
  },
  "lng": {
   "type": "number",
   "description": "Longitude in decimal degrees, e.g. -0.1419."
  },
  "limit": {
   "type": "integer",
   "maximum": 100,
   "minimum": 1,
   "description": "Maximum number of postcodes to return (1-100, default 10)."
  },
  "radius": {
   "type": "integer",
   "maximum": 2000,
   "minimum": 100,
   "description": "Search radius in metres (100-2000, default 1000)."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/uk-postcode-nearest-lookup-44bf14c2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from postcode-api-production.up.railway.app](https://www.zero.xyz/host/postcode-api-production.up.railway.app/llms.txt)
