Postcodes.io API

⭐ Beginner's Pick Geocoding / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

Postcodes.io is a free, open-source UK postcode lookup API that returns geolocation data, administrative region info, and coordinates. You can look up a single postcode or bulk-query multiple postcodes at once with no API key required. It is widely used for validating and enriching UK address data.

💡

Beginner Tip

Send POST requests to /postcodes with a JSON body containing an array of up to 100 postcodes for efficient bulk lookups. For quick tests, a simple GET request works too.

Available Data

IP address details
latitude and longitude
city and country
timezone
ISP information

Example Response

JSON Response
{
  "ip": "203.0.113.42",
  "city": "San Francisco",
  "region": "California",
  "country_code": "US",
  "latitude": 37.7749,
  "longitude": -122.4194,
  "timezone": "America/Los_Angeles",
  "isp": "Example ISP"
}

Field Reference

postcode The validated and formatted UK postcode.
latitude Latitude of the postcode centroid in decimal degrees.
longitude Longitude of the postcode centroid in decimal degrees.
region Administrative region of England the postcode belongs to.
country Country within the UK (England, Scotland, Wales, or Northern Ireland).
admin_district Local government district or borough for the postcode.

Implementation Example

const url = "https://postcodes.io/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

404 Invalid postcode The postcode does not exist or is in an invalid format.
UK postcodes follow a format like SW1A 1AA. Remove extra spaces and ensure the format is correct before querying.
CORS error from browser Browser security policies may block the request depending on your setup.
The API supports CORS, so this is usually a local dev environment issue. Try using a proxy in development.
Null result for terminated postcode Some old UK postcodes have been retired and return null.
Use the /terminated_postcodes endpoint to check if the postcode was decommissioned and get its last known coordinates.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 20/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 34ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Geocoding
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →