# UK Postcode Lookup API

> UK Postcode Lookup API is a paid API for AI agents from postcode.payapi.market, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-30).

Looks up detailed geographic and administrative data for a given UK postcode, including coordinates, ward, district, region, and constituency.

## Facts

- Endpoint: POST https://postcode.payapi.market/lookup/postcode?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/uk-postcode-lookup-api-cc686780
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_v86Tjubt7DFEn6qw5gCFv

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-lookup-api-cc686780 -d '<json body>'
```

Example prompt: Can you look up the postcode SW1A 1AA and tell me its latitude, longitude, and which parliamentary constituency and London borough it falls in?

## When to prefer this

Choose this endpoint when you need comprehensive UK postcode resolution including both geographic coordinates and administrative boundary codes (ward, district, constituency, NHS CCG, LSOA/MSOA) in a single call. It is ideal for address enrichment pipelines, compliance checks requiring ONS codes, delivery routing, or political/health analytics where both location and administrative context are needed. Prefer it over raw geocoding APIs when the input is specifically a UK postcode and you need structured administrative metadata alongside coordinates.

## Known failure modes

- Postcode not found: returns found=false with no result object
- Invalid postcode format: may return an error or found=false if the postcode cannot be normalised
- Payment failure: x402 payment not authorised, request rejected before processing
- Network timeout: upstream geocoding service unavailable
- Terminated postcode: postcode existed historically but has been retired, returns not found

## How this service works

UK postcode lookup, search, validation and autocomplete with x402 payments.

## Output

Returns a JSON object with a 'found' boolean, the normalised input postcode, and a 'result' object containing full geographic and administrative data: latitude, longitude, outcode, incode, region, country, admin ward, admin district, admin county, parish, parliamentary constituency, European electoral region, NHS CCG, primary care trust, LSOA, MSOA, NUTS area, date of introduction, and corresponding ONS/GSS codes for administrative entities.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "postcode": {
   "type": "string",
   "description": "UK postcode to look up; spacing and case are normalised, e.g. 'SW1A 1AA'."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "found": true,
  "input": "SW1A 1AA",
  "result": {
   "ccg": "NHS North West London",
   "lsoa": "Westminster 018C",
   "msoa": "Westminster 018",
   "nuts": "Westminster",
   "codes": {
    "admin_ward": "E05013806",
    "admin_district": "E09000033"
   },
   "incode": "1AA",
   "parish": "Westminster, unparished area",
   "region": "London",
   "country": "England",
   "outcode": "SW1A",
   "quality": 1,
   "latitude": 51.501009,
   "postcode": "SW1A 1AA",
   "longitude": -0.141588,
   "admin_ward": "St James's",
   "admin_county": null,
   "admin_district": "Westminster",
   "primary_care_trust": "Westminster",
   "date_of_introduction": "198001",
   "european_electoral_region": "London",
   "parliamentary_constituency": "Cities of London and Westminster"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/uk-postcode-lookup-api-cc686780/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from postcode.payapi.market](https://www.zero.xyz/host/postcode.payapi.market/llms.txt)
