Postcode API for Great Britain

Four government datasets describe a postcode: the ONS Postcode Directory, the Environment Agency’s flood risk data, police.uk and the schools register. Here is how each works, and how to get all four in one call.

Updated 25 November 20263 minute readOfficial sources linked at the end

Area codes: the ONS Postcode Directory

The ONS Postcode Directory maps every current and terminated postcode in the UK to its local authority, ward, parliamentary constituency, census areas (output area, LSOA, MSOA), police force area, NHS boards and coordinates. It is published under the Open Government Licence with Ordnance Survey and Royal Mail attribution, except for Northern Ireland, which needs a separate commercial licence. The directory is a large quarterly download, so most teams load it into their own database or use a hosted lookup.

Flood risk: the Environment Agency

The Environment Agency publishes, for each postcode in England, how many addresses sit in areas at high, medium and low long-term risk of flooding from rivers and the sea and from surface water, plus groundwater alert areas. It is the data behind GOV.UK’s check long-term flood risk service.

Crime: police.uk

police.uk publishes street-level crime for England, Wales and Northern Ireland a couple of months in arrears, with locations anonymised to nearby points. Its API returns one month at a time around a point, and refuses areas with more than 10,000 crimes, so a 12-month summary takes a dozen calls and some care in busy city centres. Scotland is not included.

Schools and Ofsted

The Department for Education’s Get Information About Schools register lists every school in England with its location, phase and type. Ofsted publishes inspection outcomes monthly; since November 2025 new inspections use report cards instead of a single overall grade, so a good integration shows both.

All four in one call

One request to our postcode check API returns area codes, flood risk, 12 months of crime and the nearest schools, with the source and release date of each part. Get a free key and try it on your own postcode.

curl https://api.vardic.dev/v1/postcodes/SW1A2AA \
  -H "x-api-key: $VARDIC_API_KEY"

Ask for only what you need

Every part can be requested on its own with include: areas, flood, crime and schools. Each call counts once, whatever you include, and every part carries its own source and release date.

curl "https://api.vardic.dev/v1/postcodes/SW1A2AA?include=areas,flood" \
  -H "x-api-key: $VARDIC_API_KEY"
PartSourceCoverage
areasONS Postcode DirectoryGreat Britain
floodEnvironment AgencyEngland
crimepolice.ukEngland and Wales
schoolsGet Information About Schools, OfstedEngland

1.5p a check on Starter (£15 a month) and 0.49p a check on Growth (£49 a month), for area codes, flood risk, crime and schools in one call.

Try it with the sandbox key

Send a real request from this page with the public sandbox key.

Sandbox consoleMade-up sandbox data, free, nothing billed
Uses the public sandbox key. Paste your own vd_test_ key to try your account.
// The response appears here.

Common questions

Is postcodes.io free?

Yes, postcodes.io is a free open source service built on the same ONS data. It covers area codes but not flood risk, crime or schools.

Can I get flood risk for an address?

The Environment Agency’s open postcode file gives counts of addresses per risk band in a postcode. Property-level risk needs the official checker or a licensed product.

Why is Northern Ireland not covered?

Northern Ireland postcode data in the ONS directory needs a separate commercial licence from Land and Property Services.

Next: Postcode check on the location page, with prices and the full response.

Sources

  1. ONS: licences for postcode products
  2. Environment Agency: flood risk postcode data
  3. police.uk API documentation
  4. Get Information About Schools

Checked 25 November 2026.

Postcode data in one call.

100 free checks a month, then from £15 a month for 1,000. For volume, an SLA or invoice billing, talk to us.