apyhub
DATA VALIDATION

Validate UK Postcodes API

What it does

UK Postcode Validator checks whether a UK postcode exists in its lookup table. Send a postcode string in the request body, and get back a boolean data value indicating true or false.

Use it when you need a fast yes/no validation step before storing customer addresses, cleaning sign-up forms, or rejecting malformed delivery data. The service ignores spaces when matching, so YO17 6DU and YO176DU are treated the same for lookup.

UK Postcode Validator is intentionally narrow: it does one thing and returns one field. That makes it easy to slot into address forms, checkout flows, CRM imports, and backend validation rules without extra parsing.

If you only need to confirm whether a postcode is present in the reference table, this endpoint gives you a simple boolean result that is easy to branch on in application code.

POST
Validate UK postcode
https://api.eu.apyverse.com/apyhub/validate-uk-postcode

QUICKSTART

GUIDE

Quickstart

Check whether a UK postcode exists in the lookup table.

curl -X POST "https://api.eu.apyverse.com/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 sending a postcode string in the request body and returning a boolean result. The response tells you whether the postcode 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 means the postcode exists in the lookup table; false means it does not.

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.