apyhub
Back
▣ DATA VALIDATION · STANDARD DATA

Validate UK Postcodes API

Hosted on ApyHub

What it does

The UK Postcode Validation API checks whether a UK postcode is real. Send a postcode and get back true or false. Spaces are ignored, so YO17 6DU and YO176DU both work.

Use it to stop bad addresses at the point of entry. Checkout forms. Signup flows. CRM imports. Cleaning up an address list you inherited. Catching a typo before a parcel ships saves a failed delivery and a support ticket.

The response is deliberately small. One boolean, nothing to parse. That makes it cheap to call on form submit, and easy to drop into a validation chain next to your email and phone checks.

It tells you the postcode exists. It does not return the street, town or county, or confirm that the rest of the address matches. If you need the full address verified, use the Address Validation API. Shipping to India as well? The Indian Pincode API works the same way.

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

QUICKSTART

GUIDE

Quickstart

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

curl -X POST "https://api.eu.apyhub.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 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.
▣ 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.