Overview

Postcodes.io is a public-facing API specifically engineered for managing and querying UK postcode data. Since its inception in 2013, it has provided developers with a free and open-source solution for integrating UK postcode validation and geocoding capabilities into their applications. The API serves as a comprehensive resource for retrieving detailed information related to any UK postcode, including geographical coordinates (latitude and longitude), administrative areas, electoral divisions, and associated outcode and incode components. This data is critical for applications requiring precise location data within the United Kingdom.

The primary use cases for Postcodes.io revolve around real-time address validation during online form submissions, enhancing delivery logistics by converting postcodes to precise coordinates, and enriching customer data with accurate geographic context. For instance, an e-commerce platform might use the Postcodes.io Postcode Lookup endpoint to autofill address fields as users type, reducing errors and improving user experience. Similarly, mapping applications can leverage its geocoding capabilities to place markers accurately on a map based on postcode input.

Postcodes.io operates under a fair usage policy, making it accessible for a wide range of projects, from small-scale personal applications to larger commercial systems, without direct cost. The project's commitment to open-source development and clear, accessible documentation contributes to a straightforward developer experience. While it specializes exclusively in UK postcodes, this focus allows for a high degree of accuracy and up-to-date data, reflecting changes in UK administrative boundaries and postal services. The API's design prioritizes ease of integration and performance for its specific domain, making it a suitable choice for developers whose primary requirement is robust UK geospatial data.

Beyond simple lookups, Postcodes.io also offers features such as reverse geocoding (finding a postcode from coordinates), distance calculations between postcodes, and functionality to list postcodes within a specified radius. This enables more complex location-based services, such as identifying nearby service points or calculating delivery zones. The API also provides access to parliamentary constituency data, ward data, and local authority details, which can be valuable for demographic analysis or governmental applications. Developers seeking a dedicated, cost-effective, and well-maintained solution for UK postcode data will find Postcodes.io directly addresses these needs without the overhead of more generalized global geocoding services.

Key features

  • Postcode Lookup: Retrieve comprehensive details for a given UK postcode, including latitude, longitude, parliamentary constituency, and local authority information.
  • Postcode Validation: Verify the existence and format of a UK postcode. The API returns a 200 status code for valid postcodes and a 404 for invalid ones.
  • Reverse Geocoding: Find the nearest postcodes to a given latitude and longitude, useful for location-based services and proximity searches.
  • Bulk Postcode Lookup: Query details for multiple postcodes in a single request, optimizing API call efficiency for batch processing.
  • Outcode Lookup: Get information about the outcode part of a postcode, which represents the postal district, alongside its associated geographical data.
  • Postcodes in Radius: Identify all postcodes within a specified radius of a given postcode or coordinates, enabling local search functionalities.
  • Autocomplete: Provides suggestions for postcodes as a user types, improving user experience in address input forms.

Pricing

Postcodes.io operates as a free service with an unlimited usage policy, subject to fair usage guidelines as outlined on the Postcodes.io documentation. Donations are accepted to support the project's maintenance and development.

Feature Cost (as of 2026-05-28) Details
Postcode Lookup Free Unlimited requests under fair usage policy
Postcode Validation Free Unlimited requests under fair usage policy
Reverse Geocoding Free Unlimited requests under fair usage policy
Bulk Operations Free Unlimited requests under fair usage policy
Donations Voluntary Accepted to support project development and hosting

Common integrations

  • E-commerce Platforms: Integrate into checkout flows for real-time address validation and auto-completion, improving data accuracy and customer experience.
  • Logistics and Delivery Systems: Utilize for route optimization and precise delivery location identification by converting postcodes to coordinates.
  • CRM Systems: Enrich customer records with accurate geographical data for segmentation and localized marketing efforts.
  • Mapping and GIS Applications: Display UK locations on maps and perform spatial analysis based on postcode data.
  • Government and Public Sector Services: Support local authority services, electoral information systems, and demographic analysis tools.
  • Healthcare Systems: Validate patient addresses and identify service areas based on postcode for community health initiatives.
  • Financial Services: Assist in fraud detection and customer onboarding by verifying address details against official UK postcode data.

Alternatives

  • Loqate: A commercial global address verification and geocoding service with a strong focus on UK data.
  • Addressy: Provides address validation and autocomplete solutions, with specific offerings for the UK market.
  • Ideal Postcodes: A dedicated UK postcode and address API offering lookup, validation, and autocomplete features, similar to Postcodes.io but with commercial tiers and service level agreements.

Getting started

To begin using Postcodes.io, you can make a simple HTTP GET request to its endpoints. The primary endpoint for looking up a single postcode is /postcodes/:postcode. Here's an example using curl to retrieve information for the postcode 'SW1A 0AA':

curl https://api.postcodes.io/postcodes/SW1A%200AA

The API will return a JSON object containing the postcode details:

{
  "status": 200,
  "result": {
    "postcode": "SW1A 0AA",
    "quality": 1,
    "eastings": 529949,
    "northings": 179950,
    "country": "England",
    "nhs_ha": "London",
    "longitude": -0.126999,
    "latitude": 51.50352,
    "european_electoral_region": "London",
    "primary_care_trust": "Westminster",
    "region": "London",
    "lsoa": "Westminster 016A",
    "msoa": "Westminster 016",
    "incode": "0AA",
    "outcode": "SW1A",
    "parliamentary_constituency": "Cities of London and Westminster",
    "admin_district": "Westminster",
    "ward": "St James's",
    "ccg": "NHS North West London",
    "nuts": "Westminster",
    "codes": {
      "admin_district": "E09000033",
      "admin_county": "E99999999",
      "admin_ward": "E05000644",
      "parliamentary_constituency": "E14000639",
      "ccg": "E38000008",
      "nuts": "UKI32"
    }
  }
}

For reverse geocoding, you can query the /postcodes?lon=:longitude&lat=:latitude endpoint. This retrieves postcodes near a specified geographical point. For example, to find postcodes near specific coordinates:

curl "https://api.postcodes.io/postcodes?lon=-0.1278&lat=51.5074"

The response will list nearby postcodes and their associated data. The API's straightforward RESTful interface and JSON responses make it compatible with virtually any programming language or environment capable of making HTTP requests. For more detailed examples and advanced usage, refer to the official Postcodes.io documentation.