Postal code guides
Guides on postal code validation, ZIP code distances in Excel, choosing a ZIP code API and when to use a database download instead.
Comparison
Best ZIP code APIs in 2026
Comparison of ZIP and postal code APIs in 2026: zipcodestack, Zipcodebase, Smarty, the USPS API, GeoNames and more. Coverage, features, free tiers and pricing.
Guide
ZIP code database vs API
Download a ZIP code database (CSV) or use a ZIP code API? Cost, freshness, coverage, maintenance and speed compared, with advice by use case.
Tutorial
How to validate postal codes
Postal code regex patterns for the US, UK, Canada, Germany and 16 more countries, code examples in JavaScript, Python and PHP, and when a regex is not enough.
Tutorial ยท Excel & Sheets
Distance between ZIP codes in Excel
Calculate miles or kilometres between ZIP codes in Excel and Google Sheets with the Haversine formula, or get them from the API with Power Query.
Postal code API
Get this data in your app
zipcodestack looks up, validates and searches postal codes in 182 countries: city, state, coordinates, distances and radius search, as JSON.
/v1/search documentation International postal code API All documentation
300 free requests every month. No credit card required.
GET https://api.zipcodestack.com/v1/search?codes=10001&country=us
{
"results": {
"10001": [{
"postal_code": "10001",
"country_code": "US",
"latitude": 40.7484,
"longitude": -73.9967,
"city": "New York",
"state": "New York",
"state_code": "NY",
"province": "New York"
}]
}
}