apyhub
DATA VALIDATION · STANDARD DATA

Validate UK Postcodes API

Hosted on ApyHub

What it does

Validate UK postcodes with a single boolean response. Send a postcode in the request body, and UK Postcode Validator returns data: true when the postcode exists in its lookup table.

Use it when you need a fast gate before storing, routing, or comparing UK address data. It ignores spaces for matching, so you can pass values like YO17 6DU without normalising them first.

The response is intentionally simple: you get one field, data, set to true or false. That makes it easy to plug into signup forms, address capture flows, CRM imports, and checkout validation where you only need to know whether the postcode is recognised.

If your workflow depends on clean UK postcode data, this endpoint gives you a direct existence check without extra enrichment or address parsing.

POST
Validate UK postcode
http://localhost:8080/apyhub/validate-uk-postcode
QUICKSTARTGUIDE

Quickstart

Check whether a UK postcode exists by sending the postcode in a JSON body.

curl -X POST "http://localhost:8080/apyhub/validate-uk-postcode" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postcode":"YO17 6DU"}'

What you'll get back

Returns a JSON object with a data boolean field — true when the postcode exists in the lookup table, false otherwise.

{
  "data": true
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Postcode or PIN code (spaces ignored for matching).

About this endpoint

What it does

Validates a UK postcode by accepting a postcode string in the request body and returning a boolean result indicating whether it exists in the lookup table.

Request Body

ParameterTypeMandatoryDescription
postcodeStringYesPostcode or PIN code; spaces are ignored for matching.

Response

Returns a JSON object with a data boolean field — true when the postcode exists in the lookup table, false otherwise.

ParameterTypeMandatoryDescription
dataBooleanYestrue when the postcode exists in the lookup table.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.