AutoPostcode
Guide · Validation API

UK address validation API guide — from key to production

Everything you need to validate UK addresses via API: authenticate, look up and verify against Royal Mail PAF, and handle errors cleanly. With copy-paste code at each step.

No card required · Royal Mail PAF-verified data

Trusted UK address intelligence

1 header
auth
REST
endpoints
31M+
PAF addresses
PAF-verified address lookup
Fast REST API & no-code plugins
GDPR-friendly, UK-hosted

To validate UK addresses via API, send a postcode or address to the AutoPostcode validation endpoint with your API key as a Bearer token; it checks the input against Royal Mail PAF and returns whether the address is deliverable, the correctly formatted version, and a UPRN. AutoPostcode validates against ~31M UK delivery points across ~1.8M postcodes.

~31M
UK addresses in PAF
~1.8M
UK postcodes
<1s
typical response

How do I authenticate with the API?

Pass your API key as a Bearer token on every request, and keep it server-side:

const headers = {
  Authorization: "Bearer " + process.env.AUTOPOSTCODE_KEY,
};

How do I look up addresses for a postcode?

A lookup returns all PAF addresses for a postcode so the user can pick the exact one:

const res = await fetch(
  "https://autopostcode.com/api/public/lookup?postcode=SW1A1AA",
  { headers }
);
if (!res.ok && res.status !== 404) throw new Error("Lookup HTTP " + res.status);
const addresses = res.status === 404 ? [] : await res.json();

How do I validate a full address?

Compare the supplied premise, street and town with candidates at that postcode. Ask the user to confirm a suggested match or permit manual entry if the address is missing or ambiguous.

Use autocomplete for search-as-you-type and postcode lookup for full-postcode entry. Keep a manual option when results are unavailable.

How should I handle errors?

Branch on the HTTP status so failures are graceful and rate limits are respected:

StatusMeaningAction
200SuccessUse the result
401Invalid keyCheck the Bearer token
429Rate limitedBack off and retry
400Bad requestValidate your input

What are the integration best practices?

  • Keep the API key server-side, never in the browser
  • Cache stable postcode lookups to cut repeat calls
  • Store the UPRN as a permanent address identifier
  • Soft-warn on failed validation instead of hard-blocking

See the endpoint-level UK address validation API overview, start fast with the API quickstart, and read every parameter in the REST API reference.

A modern, UK-first alternative

AutoPostcode uses the same Royal Mail PAF data as Loqate, Fetchify and Ideal Postcodes, with a clean REST API and an affordable per-lookup price — get your API key and integrate today.

Frequently asked questions

How do I validate UK addresses with an API?

Send a full UK postcode to the AutoPostcode lookup endpoint with a website key. Compare Royal Mail PAF delivery point candidates with the supplied address and ask the user to confirm the match.

What data does a UK address validation API check against?

AutoPostcode resolves candidate delivery points using Royal Mail PAF. A match gives you a structured address to confirm with the user.

What's the difference between validation and autocomplete?

Autocomplete helps a user find and select an address as they type; validation confirms a given address is real and deliverable. Most checkouts use autocomplete for entry and validation as a safety net on submit.

How do I authenticate with the address validation API?

Pass your API key as a Bearer token in the Authorization header of every request. Keep the key server-side so it never reaches the browser.

How should I handle validation errors and rate limits?

Check the HTTP status: 401 means an invalid key, 429 means you exceeded the rate limit, and 200 returns the result. Back off and retry on 429, and surface a helpful message on 4xx.

Can I validate addresses in bulk?

The lookup API accepts one postcode per request. Discuss data licensing, usage and volume with support before batch processing.

Price beat guarantee

We'll beat any like-for-like UK address lookup price

Send us your current quote or invoice and we'll come back the same working day with a better price — plus free migration and integration support.

  • Beat any like-for-like UK quote, monthly or annual
  • Free migration + hands-on integration support
  • No setup fees, no lock-in, cancel any time

Ready to get started?

Add Royal Mail PAF-verified UK address lookup to your site in minutes — start free, no card required.