United Kingdom Postal Code API
Look up postcodes in United Kingdom with PostalDataPI — sub-10ms responses, one API key for 70+ countries.
Country Code
GB
Format
A(A)N(N) NAA
Example
SW1A 1AA
About United Kingdom postcodes
The UK uses alphanumeric postcodes in outcode + incode format. The outcode (e.g., SW1A) identifies the postal district; the incode (e.g., 1AA) narrows to a group of addresses. London codes start with E, EC, N, NW, SE, SW, W, WC.
Local term: postcode | Regex pattern: ^[A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}$
API Usage Examples
cURL
curl -X POST https://postaldatapi.com/api/lookup \
-H "Content-Type: application/json" \
-d '{"zipcode": "SW1A 1AA", "country": "GB", "apiKey": "YOUR_API_KEY"}'Python
from postaldatapi import PostalDataPI
client = PostalDataPI(api_key="YOUR_API_KEY")
result = client.lookup("SW1A 1AA", country="GB")
print(result.place_name, result.latitude, result.longitude)Node.js
import { PostalDataPI } from 'postaldatapi';
const client = new PostalDataPI({ apiKey: 'YOUR_API_KEY' });
const result = await client.lookup('SW1A 1AA', { country: 'GB' });
console.log(result.placeName, result.latitude, result.longitude);$0.000028 per query
Same price for United Kingdom and all 70+ countries. No tiers, no per-country pricing.