Free UK Postcode Lookup APIs: Open-Data vs Full PAF Guide
Compare free UK postcode lookup APIs. Understand open-data limitations (postcodes.io) vs full Royal Mail PAF lookups, rate limits, and code examples.
Free UK postcode lookup APIs divide into two categories: completely free open-data APIs that resolve outward/inward codes down to centroid coordinates, administrative wards, or outward towns without premise-level door numbers, and commercial Royal Mail Postcode Address File (PAF) APIs with free developer tiers providing full premise-level building numbers, organisations, and street addresses.
For basic geographic routing or district lookups, open-data APIs cost nothing. For checkout address auto-completion, shipping dispatch, and CRM entry, premise-level PAF data is required.
Open Data vs Commercial PAF APIs: Technical Differences
| Feature | Open-Data APIs (e.g. postcodes.io, ONS) | Full PAF APIs (e.g. Postio Free Tier) |
|---|---|---|
| Primary Dataset | ONS Postcode Directory, OS OpenData | Royal Mail Postcode Address File (PAF) |
| Data Resolution | Postcode centroid (lat/long, admin ward, district) | Premise level (house number/name, sub-building, PO box) |
| Address Auto-Fill | No (cannot return full street address or building unit) | Yes (complete premise-level UK address string) |
| Update Frequency | Quarterly or bi-annually | Daily updates direct from Royal Mail |
| Licensing Cost | 100% Free (Open Government Licence) | Royal Mail PAF license applies (free developer tier available) |
| Best For | Geocoding, regional validation, delivery zone assignment | Checkout forms, delivery validation, customer onboarding |
Why Open-Data APIs Cannot Provide House Numbers
Open-data APIs such as postcodes.io rely on public datasets released by the Office for National Statistics (ONSPD) and Ordnance Survey (OS Open Names). These datasets map UK postcodes (e.g. SW1A 1AA) to geographical coordinates, Parliamentary constituencies, and local authority wards.
However, the individual delivery point records (building names, house numbers, flat numbers, organisation names) are owned and maintained by Royal Mail in the Postcode Address File (PAF), containing over 30 million UK delivery points. PAF is not released under an open-data licence; access requires commercial licensing from Royal Mail.
Comparison of Free and Freemium UK Postcode APIs
| Provider | Free Allowance | Dataset | Authentication Required | Typeahead Autocomplete |
|---|---|---|---|---|
| Postcodes.io | Unlimited (fair use) | ONS Postcode Directory (Centroid only) | No | Postcode-only autocomplete |
| Postio | 100 full PAF lookups/mo + free typeahead | Direct Royal Mail PAF (Full premise) | Yes (API Key) | Yes (Address & Postcode) |
| OS Places API | Free public sector / low-volume sandbox | Ordnance Survey AddressBase Premium | Yes (API Key) | Yes |
| Ideal Postcodes | Developer test keys only (paid in production) | Royal Mail PAF | Yes (API Key) | Yes |
| GetAddress.io | Non-PAF open derived tier | Open-data derived records | Yes (API Key) | Yes |
When to Use an Open-Data API (postcodes.io)
If your application only needs to determine:
- The town or region associated with a postcode
- Distance calculations between two UK postcodes
- Local authority or NHS health authority assignment
An open-data API like postcodes.io is appropriate. Below is a standard request using cURL:
curl -X GET "https://api.postcodes.io/postcodes/SW1A1AA"Example JSON response:
{
"status": 200,
"result": {
"postcode": "SW1A 1AA",
"quality": 1,
"eastings": 529090,
"northings": 179645,
"country": "England",
"nhs_ha": "London",
"longitude": -0.141588,
"latitude": 51.501009,
"admin_district": "Westminster",
"admin_ward": "St James's"
}
}Notice that no street name, building number, or business name is returned.
When to Use a Full PAF API (Postio Developer Tier)
If your application requires full checkout address auto-fill where a user types a postcode or partial address and selects their exact building and flat number, a direct PAF API is required.
Postio provides a free developer tier with 100 free full-PAF lookups per month and free typeahead query searching.
1. Autocomplete Search Request (JavaScript)
Typeahead calls search across 30+ million Royal Mail PAF records as the user types:
const query = "10 Downing";
const response = await fetch(`https://api.postio.co.uk/v1/addresses/autocomplete?q=${encodeURIComponent(query)}`, {
headers: {
"Authorization": `Bearer YOUR_POSTIO_API_KEY`
}
});
const suggestions = await response.json();
console.log(suggestions);2. Full Premise Lookup Request (cURL)
Once the user selects a suggestion ID, fetch the full PAF premise record:
curl -X GET "https://api.postio.co.uk/v1/addresses/lookup?id=PAF_ID_HERE" \
-H "Authorization: Bearer YOUR_POSTIO_API_KEY"Example premise-level JSON response:
{
"building_number": "10",
"thoroughfare": "Downing Street",
"dependent_locality": "",
"post_town": "LONDON",
"postcode": "SW1A 2AA",
"formatted_address": [
"10 Downing Street",
"LONDON",
"SW1A 2AA"
],
"udprn": 23747799
}Architecture Summary: Choosing the Right API
- Use `postcodes.io` if you do not need building numbers or street names, and only need geocoding, ward boundary data, or broad postcode validation.
- Use `Postio` (Free Tier) if you need full street addresses, building numbers, and typeahead address autocomplete for checkout forms, shipping labels, or CRM data entry without paying commercial fees at low volume.
Ready in under a minute.
Sign up, grab a key, paste it in. Your first hundred lookups are on us.