GET/v1/postcode/{postcode}
GET/v1/postcode/nearest
GET/v1/postcode/within

Geocoding is the easy part.
The signals are the product.

Free UK postcode geocoding already exists — postcodes.io does it well, and it costs nothing. What most people actually need alongside a postcode is what it implies about a location: flood risk, crime, deprivation, property values. Zyfy pre-loads that data for 1.7M Great Britain postcodes and returns it in the same call as the geocoding data.

Covers England, Scotland, and Wales. Built on ONS, EA, HMLR, and Police UK data under the Open Government Licence v3.0.

What "UK postcode API" usually means — and the gap in it

Most things people call a "UK postcode API" are geocoding services: send a postcode, get back a latitude/longitude and some administrative context — local authority, constituency, NHS region. postcodes.io is the best free option in this category — MIT-licensed, self-hostable, backed by the same ONS Postcode Directory data everyone ultimately uses. If coordinates and admin boundaries are genuinely all you need, it's hard to beat and there's no reason to pay for the same thing.

The gap shows up the moment you need to know something about that location rather than just where it is. Is this postcode at flood risk? What's the crime rate? How deprived is the area? What do properties here typically sell for? None of that comes from a postcode's coordinates — it requires joining against a dozen separate government datasets (Environment Agency flood maps, HMLR Price Paid transactions, ONS IMD, Police UK crime records), each with its own format, update schedule, and geographic join key. Building that pipeline yourself is a multi-week project before you've enriched a single record.

Zyfy has already built that pipeline for Great Britain: 1.7 million postcodes across England, Scotland, and Wales — Northern Ireland isn't currently supported — pre-loaded with flood risk, crime, deprivation, property price, EPC, radon, and air quality signals wherever the underlying government data allows, plus pre-computed composite risk scores. It all comes back alongside the same geocoding and admin data postcodes.io provides. One call, one response, no separate joins.

postcodes.io vs Zyfy

Not a criticism of postcodes.io — it does its job well. It's just a different job.

Fieldpostcodes.ioZyfy
Lat/lng, admin areas, constituency
Flood risk (rivers/sea, surface water, groundwater)
Crime rate band
Deprivation index (IMD/SIMD/WIMD)
Property price (12-month rolling, HMLR)
EPC rating, radon, air quality, green space
Composite risk / liveability scores
HostingSelf-host or free public instance (rate-limited, best-effort uptime)Managed — SLA-backed, no infrastructure to run
Bulk lookups✓ up to 100 per call✓ up to 500 per call, plus async bulk jobs for larger batches
CostFree (MIT licence)Free tier — 100 requests/month, no card required

What Zyfy adds on top of geocoding

A subset of what's returned — 45+ signals in every response, every plan including free. View the full signal reference →

signals.flood.riversSea string | null

Environment Agency flood risk classification — very_low, low, medium, or high.

scores.propertyRiskScore number | null

Pre-computed composite of flood risk, crime, and radon. 0.0–1.0, higher = more risky.

signals.deprivation.imdDecile integer | null

Index of Multiple Deprivation decile, 1–10, covering England, Scotland, and Wales.

signals.crime.rateBand string | null

National percentile band from Police UK LSOA crime counts.

signals.property.averagePrice integer | null

Median sale price (GBP), 12-month rolling window, from HMLR Price Paid data.

ruralUrbanClassification string | null

ONS urban/rural classification — used for logistics tiering and demographic segmentation.

Full postcode or outward code — both work

InputExampleReturns
Full postcodeSW1A 2AAFull signal set, including flood, property, and crime
Outward codeSW1ADistrict-level signals only — too variable across the district for per-postcode fields

Both accept spaces, no spaces, upper or lower case — normalised automatically.

Coordinates work too — not just forward lookup

If you're geocoding the other way — you have a latitude/longitude and want to know what's there — Zyfy covers that natively, with the full signal set attached to the result rather than a bare postcode string.

GET/v1/postcode/nearest?lat={lat}&lon={lon}

Closest single postcode to a point, plus distance in metres.

GET/v1/postcode/within?lat={lat}&lon={lon}&radius={metres}

Every enriched postcode inside a radius, ordered by distance — for area analysis, not just a single point.

See the full endpoint reference for parameter details and radius limits.

Frequently asked questions

Is there a free UK postcode API?

Yes — postcodes.io is free, MIT-licensed, and self-hostable, and it's a genuinely solid foundation for geocoding and administrative lookups. It does not include flood risk, crime, deprivation, property price, or any other enrichment signal — that's a different problem, and it's what Zyfy is for. Zyfy's own free tier is 100 requests/month, no credit card required.

What's the difference between a postcode API and a geocoding API?

A geocoding API converts a postcode to a latitude/longitude and back — that's postcodes.io's job, and Zyfy does it too. A postcode intelligence API goes further: given that same postcode, it tells you about flood risk, crime, deprivation, property values, and other location-derived signals. If you just need coordinates and admin boundaries, postcodes.io alone may be all you need.

Does Zyfy cover Northern Ireland?

No. Northern Ireland (BT postcodes) requires a separate commercial licence from NI Land & Property Services, so Zyfy currently returns a 422 unsupported_region error for BT postcodes. England, Scotland, and Wales are fully covered.

Can I query by outward code only (e.g. "SW1A" instead of "SW1A 2AA")?

Yes. An outward-code-only query returns district-level signals — country, region, admin areas, constituency, rural/urban classification — but omits signals that are too variable across a whole district to be meaningful at that level, such as flood risk, property price, and crime rate.

How current is the postcode data?

It varies by signal: core geography and administrative boundaries update quarterly (ONS Postcode Directory), property prices on a rolling 12-month window (HMLR, monthly), crime quarterly (Police UK), MP data weekly. Every response includes checkedAt for when you made the request — see the FAQ for the distinction from dataAsOf, which tracks the underlying data's freshness.

Can I look up the nearest postcode to a set of coordinates instead?

Yes. GET /v1/postcode/nearest accepts lat and lon and returns the closest postcode with the full signal set attached, plus the distance in metres. GET /v1/postcode/within returns every enriched postcode inside a radius, useful for area-level analysis rather than a single point.

Related

Contains public sector information licensed under the Open Government Licence v3.0.

Every GB postcode. Geocoding plus the signals.

Free tier. No credit card. 100 requests/month.

Get your free API key