# UK Postcode Validator

> UK Postcode Validator 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).

Validates a UK postcode, returning its normalised form, format validity, and active/inactive status

## Facts

- Endpoint: POST https://postcode-api-production.up.railway.app/lookup/validate
- 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-validator-1f5d6ada
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dulXUHWmF1_9w-9W-Uukh

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-validator-1f5d6ada -d '<json body>'
```

Example prompt: Can you check whether 'SW1A 1AA' is a valid, active UK postcode and give me its normalised form?

## When to prefer this

Use this endpoint when you need to confirm that a user-supplied UK postcode string is correctly formatted AND currently active, without needing full geographic lookup data. It is lighter and faster than a full postcode lookup and is ideal for form validation, data cleansing, or pre-flight checks before enriching an address with coordinates or admin boundaries.

## Known failure modes

- Postcode string missing or empty — likely returns validation error or invalid flag
- Non-UK postcode submitted — will be flagged as invalid format
- Malformed JSON body — returns HTTP 400
- Discontinued or terminated postcode — valid format but marked inactive
- Network or server error — HTTP 5xx from Railway-hosted service

## How this service works

Validate a UK postcode and report its normalised form, format validity, and whether it is currently active.

## Output

Returns whether the postcode has a valid UK format, its normalised (correctly spaced and uppercased) form, and whether it is currently active in the Royal Mail postcode database.

## Request schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/uk-postcode-validator-1f5d6ada/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)
