UK Grounding service
Postcode validation
This service gives AI agents a small, direct way to check whether a UK postcode appears in the source dataset and retrieve its available geography fields.
What the result means
A found result means the postcode is present in the ONS Postcode Directory release used by this service. It does not verify a delivery address, prove that a property exists, or guarantee that the postcode is current outside that release. Returned fields are the normalized values and retained source row available in the database.
The current data release is ONSPD February 2025. Northern Ireland postcodes beginning BT are excluded from this service.
Use the service
JSON API
Send a postcode with no API key. Use the versioned GET route for a quick lookup or POST when sending JSON.
GET /api/v1/postcodes/SW1A%201AA.json
POST /api/v1/postcodes/validate
{ "postcode": "SW1A 1AA" }Read the OpenAPI specificationWebMCP
Where the browser exposes WebMCP, this page registers the read-only validate_uk_postcode tool. It calls the same POST endpoint and returns the same result fields.
WebMCP is an early-preview browser feature. A compatible browser may require the WebMCP origin trial or a local testing flag. The JSON API works independently of browser support.
Data, licensing and coverage
The service uses the ONS Postcode Directory, derived from Code-Point Open. Only open data whose licence permits commercial use may be used by this service. ONS notes that commercial use of Northern Ireland BT records requires a separate Land and Property Services licence; BT records are therefore excluded.
Data is returned with its release and attribution. The public API does not require an API key. Request limits apply to keep the service available.
Contains OS data © Crown copyright and database right 2025
Contains Royal Mail data © Royal Mail copyright and database right 2025
Source: Office for National Statistics licensed under the Open Government Licence v.3.0