# UK Postcode Lookup

> UK Postcode Lookup is a paid API for AI agents from pennydatahq.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Returns geographic and administrative data (lat/lon, ward, district, constituency, region) for a Great Britain postcode.

## Facts

- Endpoint: GET https://pennydatahq.com/api/postcode/:postcode?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/uk-postcode-lookup-e2d56a3f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dxBooiXKI8o5ojoU10tq2

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-e2d56a3f
```

Example prompt: What are the latitude, longitude, ward, district, and parliamentary constituency for the postcode SW1A 2AA?

## When to prefer this

Choose this endpoint when you need structured geographic and administrative data for a Great Britain postcode in a single low-cost call, especially when you need both coordinates and administrative boundaries (ward, district, constituency, region) together. Prefer this over a general geocoding API when UK administrative context is required alongside lat/lon. Note: Northern Ireland (BT postcodes) is not supported.

## Known failure modes

- Northern Ireland (BT) postcodes are not supported and will return null or an error
- Invalid or non-existent postcode returns an error or empty result
- Malformed postcode string may fail validation
- Region field is null for Scottish and Welsh postcodes (English regions only)

## How this service works

Location and areas for a Great Britain postcode: latitude and longitude, ward, district, constituency and region, as JSON.

## Output

A JSON object containing the normalised postcode, latitude, longitude, ward name, district name, Westminster parliamentary constituency (2024 boundaries), English region (null for Scotland and Wales), and country.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "postcode"
     ],
     "properties": {
      "postcode": {
       "type": "string",
       "description": "Great Britain postcode, with or without the space, any case. Northern Ireland (BT) is not supported."
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "postcode"
     ],
     "properties": {
      "ward": {
       "type": [
        "string",
        "null"
       ]
      },
      "region": {
       "type": [
        "string",
        "null"
       ],
       "description": "English region; null in Scotland and Wales"
      },
      "country": {
       "type": [
        "string",
        "null"
       ]
      },
      "district": {
       "type": [
        "string",
        "null"
       ]
      },
      "latitude": {
       "type": [
        "number",
        "null"
       ]
      },
      "postcode": {
       "type": "string"
      },
      "longitude": {
       "type": [
        "number",
        "null"
       ]
      },
      "constituency": {
       "type": [
        "string",
        "null"
       ],
       "description": "Westminster parliamentary constituency (2024 boundaries)"
      }
     }
    }
   }
  }
 }
}
```

## More

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