UK postcode API

UK postcode lookup API

Resolve any UK postcode to its town, local authority, constituent country, coordinates and timezone in a single JSON request. Built on the ONS Postcode Directory for England, Scotland and Wales, with a free tier that needs no card.

Try a live GB lookup

Try a full UK postcode (e.g. SW1A 1AA) or an outward code (SW1A).

GET /v3/GB/SW1A 1AA
[
  {
    "country": "GB",
    "postal_code": "SW1A1AA",
    "city": "London",
    "county": "Westminster",
    "state": "England",
    "state_short": "ENG",
    "latitude": 51.501009,
    "longitude": -0.141588,
    "timezone": "Europe/London",
    "geohash": "gcpvj0du6551"
  }
]

Call it from your code or agent

Pass your API key in the x-key header:

curl -H "x-key: YOUR_KEY" "https://zip.getziptastic.com/v3/GB/SW1A%201AA"

v3 Response

200 OK
[
  {
    "country": "GB",
    "postal_code": "SW1A1AA",
    "city": "London",
    "county": "Westminster",
    "state": "England",
    "state_short": "ENG",
    "latitude": 51.501009,
    "longitude": -0.141588,
    "timezone": "Europe/London",
    "geohash": "gcpvj0du6551"
  }
]

UK postcodes match with or without a space and in any case (SW1A 1AA, sw1a1aa). If a full postcode is not in the latest ONS release β€” or is in Northern Ireland β€” /v3 falls back to its outward district and marks the result with "precision": "district". See the field reference for details.

Built for UK address & postcode workflows

  • Full ONSPD postcodes: England, Scotland and Wales postcodes come from the Office for National Statistics' ONS Postcode Directory (Open Government Licence v3.0), paired with Built-Up Area town names and local authority districts.
  • Flexible input normalization: Pass SW1A 1AA, sw1a1aa, or an outward district like SW1A β€” Ziptastic normalizes spacing and casing automatically.
  • District fallback for Northern Ireland & new builds: Northern Ireland (BT) is covered at outward-district level (e.g. BT1), and brand-new postcodes fall back cleanly to their district instead of failing.
  • Reverse, batch & MCP included: Look up nearest postcodes from lat/lon, resolve up to 100 postcodes in one POST /v3/batch call, or connect AI agents via the native MCP server.

Authoritative UK data + 123 countries on one key

Most cheap postal APIs only store outward UK prefixes, while full Royal Mail PAF licences carry steep enterprise minimums. Ziptastic combines the open ONS Postcode Directory for England, Scotland and Wales with 2024 Built-Up Area town names and Local Authority District counties.

The same API key and endpoint pattern also cover 123 countries and territories β€” over 2.8 million postal codes in total β€” so expanding from the UK to Europe, North America or Australia takes zero new integration code.

Free plan included

The free Developer plan gives you an API key with 100 requests a day on the full v3 API across all 123 countries and territories, and no card is required. When you outgrow it, paid plans scale up to 1,000,000 requests a day.

Start in minutes

Create a free key, then copy a working example in cURL, Python, Node.js, PHP or Ruby.