7 endpoints
Essentials
The handful of calls most people start with: find a place, get a quick answer and see what's available.
- List every routeReturns the paths the API serves right now. Handy as a quick health check, or to see at a glance what's available.get
/ - Get the OpenAPI specDownload the machine-readable OpenAPI 3.1 description of the whole API, as YAML. Point a client generator, Postman or your editor at it and you get every route, parameter and response shape for free.get
/openapi.yaml - Open the built-in docs pageA single HTML page the API serves itself, built from the OpenAPI spec: a route chooser, a glossary, three quick starts and every endpoint with the mistake people most often make calling it. Useful wherever the API runs without this site.get
/docs - Search places by nameType a place name and get back every area it could mean. Place names are slippery: "Newport" is thirteen different areas across Wales, the Isle of Wight and Shropshire. Rather than guessing, this lists them all so you can choose.get
/places - Find a postcode's areasLook up a full UK postcode and find the areas containing its centroid, including its local authority, ward and constituency by default. The response includes the postcode's status, source edition and positional quality so you can judge how precise the placement is.get
/postcodes/{postcode} - Find areas for postcodesLook up up to 100 full UK postcodes in one request and find the areas containing each postcode's centroid. The response gives every lookup the same source edition and boundary settings, making it easier to tag a list consistently.post
/postcodes:batch - Get a value for a placeThe quickest way to answer a question like "what was the population of the North West in 2022?". Give a measure and a place name and you get a single number back, with a note of exactly how it was worked out.get
/data/{measure-id}/value