Postcodes

API Reference - Postcodes.io

Postcodes.io is a free postcode lookup API and geocoder for the UK. Endpoint All services can be accessed from the following endpoint.…

Maps & location#geocoding

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

Postcodes.io is a free postcode lookup API and geocoder for the UK.

Endpoint

All services can be accessed from the following endpoint.

https://api.postcodes.io

The API accepts GET and POST requests. POST methods use content type application/json.

Responses

Each response comes with an appropriate HTTP Status code (except for JSONP requests). These include 200 for success, 400 for a bad request, 404 for not found and 500 for server error. The HTTP Status code is also included in the response body.

Authentication

Postcodes.io does not require authentication.

Endpoints 11

Postcodes

  • GETLookup Postcode/postcodes/:postcodePostcode Data Lookup a UK postcode against the ONS Postcode Directory (ONSPD). The response is a fully resolved record — every administrative, electoral,…
  • GETAutocomplete Search a Postcode/postcodesQuery for a postcode either by: The postcode itself (with query=) or by, A geolocation (lat= and lon=). Query with Postcode Submit a postcode query and…
  • GETFind the Nearest Postcodes/postcodes/:postcode/nearestReturns a list of postcodes geographically nearest to the specified postcode, ordered by proximity (closest first).
  • GETGet a Random Postcode/random/postcodesReturns a randomly selected postcode along with comprehensive geographic, administrative, and statistical data associated with that postcode.

Terminated Postcodes

  • GETLookup Terminated Postcodes/terminated_postcodes/:postcodeLookup a terminated postcode. If the terminated postcode exists, this API returns the year and month of termination plus its last known WGS84 coordinates.…

Scottish Postcodes

  • GETLookup Scottish Postcode/scotland/postcodes/:postcodeLookup a Scottish postcode. Returns Scottish Postcode Directory (SPD) data associated with the postcode. The response covers the full SPD field set: council…

Outward Codes

  • GETFind an Outward Code/outcodes/:outcodeReturns aggregated information for postcodes grouped by their shared outward code. The outward code is the first half of any postcode (3-4 characters and…

Places

  • GETFind a Place/placesSubmit a place query and receive a complete list of places matches and associated data.
  • GETFind a Place by ID/places/:codeSubmit a place query and receive a complete list of place matches and associated data. This API uses the Ordnance Survey Open Names Dataset. Places are not…
  • GETRetrieve a Random Place/random/placesReturns a randomly selected place from the database along with all its associated geographical and administrative data. Useful for testing or displaying…

Postcode Query

  • POSTBulk Postcode Lookup/postcodesAccepts a JSON object containing an array of postcodes. Returns a list of matching postcodes and respective available data. Be sure to submit JSON requests…

API details

Base URL
https://api.postcodes.io
Authentication
None declared in the description
Operations
11 operations on 10 pathsGET 10POST 1
Main resources
Postcodes 4Places 3Outward Codes 1Postcode Query 1Scottish Postcodes 1Terminated Postcodes 1
Response formats
application/json
Description format
OpenAPI 3.1.0, API version 20.0.0

How to test the API Reference - Postcodes.io in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the API Reference - Postcodes.io collection, without the publisher's secrets.
  3. Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
  4. Send a requestPick an endpoint, for example “Lookup Postcode” (GET /postcodes/:postcode), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the API Reference - Postcodes.io?

Postcodes.io is a free postcode lookup API and geocoder for the UK. Endpoint All services can be accessed from the following endpoint.… It is listed under Maps & location and has 11 endpoints.

Who publishes the API Reference - Postcodes.io?

It is listed from Postcodes's public API description (an OpenAPI document), not published by Postcodes on Swastik Codes. Anyone who controls postcodes.io can claim the profile by adding a DNS TXT record.

What is the base URL of the API Reference - Postcodes.io?

Requests go to https://api.postcodes.io. Endpoint paths are added to this base URL.

How do I authenticate with the API Reference - Postcodes.io?

Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.

How many endpoints does the API Reference - Postcodes.io have?

11 operations on 10 paths (10 GET, 1 POST). The largest groups are Postcodes, Places, Outward Codes, Postcode Query.

Is forking the API Reference - Postcodes.io free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.