API Freaks logoAPI Freaks logo
CTRL+K

    APIs

  • Pricing
  • Resources
  • Tools

  • Contact us
CTRL+K
Sign InGet Started For Free
  • Overview
  • Documentation
  • How to Guides
  • Pricing
  • APIFreaks
  • Organization and Teams
  • Credits Usage API
  • IP Geolocation Lookup
  • Bulk IP Geolocation Lookup
  • Domain WHOIS Lookup
  • IP WHOIS Lookup
  • ASN Lookup
  • Domain WHOIS Historical Lookup
  • Domain WHOIS Reverse Lookup
  • Bulk Domain WHOIS Lookup
  • DNS Lookup
  • Historical DNS Lookup
  • Reverse DNS Lookup
  • Bulk DNS Lookup
  • Email Checker API
  • SSL Certificate Lookup
  • Domain Availability
  • Bulk Domain Availability API
  • Website Screenshot
  • Bulk Screenshot
  • Currencies Exchange Rates
  • Currency Converter
  • Currency Time Series
  • Currency Fluctuation
  • Geolocalized Currency Converter
  • Live Commodity Prices
  • Commodity Historical Prices
  • Commodity Fluctuation
  • Commodity Time Series
  • IBAN Validation
  • ZIP Code API
  • ZIP Code Search Inside Radius
  • ZIP Code Distance API
  • ZIP Code Search By City
  • Live Weather API
  • Weather Forecast API
  • Historical Weather API
  • Air Quality API
  • Marine Weather API
  • Flood Forecast API
  • Timezone Lookup
  • Timezone Converter
  • User Agent Parser
  • Bulk User Agent Parser
  • Astronomy API

ZIP Code API - Fast & Accurate ZIP Codes to Location Data

ZIP Code API is an accurate city-level location data service for ZIP codes and postal codes. You can use it to validate and find the primary location of ZIP codes and postal codes anywhere in the world.

ZIP Code API has a wide range of applications in location-based businesses. Some anticipated applications of our location by ZIP code lookup service are:

  • Understand the customers demographics.
  • Enable businesses to run targeted marketing campaigns based on geographic segmentation of audiences.
  • Use with business intelligence tools to analyze customers distribution and identify target markets.
  • Verify a user’s complete address using the ZIP code location. Improve data accuracy, reduce errors, or standardize formats.
  • Identify customer‘s location by the given ZIP code to prevent frauds in financial systems.
  • Auto-fill city, locality, and state in address forms when a ZIP code and country are available. An example of geocoding ZIP and postal codes.
  • Provide real-time ZIP code location access to enhance user experience in online applications.

You can integrate our ZIP Code API into your products with ease. Code snippets are available for many programming languages in each example below. You can follow each example as per need.

10K Free Credits, No Credit Card Required

Features

ZIP Codes & Postal Codes Validation

Lookup ZIP codes and postal codes to location data and validate if they exist where you're looking for them to be.

Lookup City by ZIP Code

Find ZIP codes location ( city, locality, state/province/region, country code in ISO 3166-2 letter format, latitude, and longitude) with our fast ZIP Code API.

Global ZIP Codes Support

ZIP Code API gives you access to a global database of ZIP codes and postal codes location. ZIP Code API supports all postal data service like:

  • United States Postal Service (USPS)
  • Royal Mail Postcode Address File (PAF)
  • Canada Post
  • Le Poste
  • Deutsche Post
  • India Post
  • Japan Post

Lookup ZIP Codes in Bulk

ZIP Code API supports up to 100 postal codes and ZIP codes lookup in one go. You can handle the bulk data with speed and accuracy.

JSON & XML Response Formats

ZIP codes lookup response supports JSON and XML formats. While the default response format is JSON.

Documentation

Single ZIP Code Lookup

API Endpoint

GET

https://api.apifreaks.com/v1.0/zipcode/lookup

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
JavaScript
C#
$ pip install requests

API Request

ParameterRequiredTypeDefaultDescription
countryNoStringAll countriesLimits the code's search to within a specified country. Country must be provided in ISO 3166-1 alpha-2 format.
codeYesString-Single ZIP code to validate or look up. Example: code=10009
formatNoStringjsonToggles response format to JSON or XML. Value must be 'json' or 'xml'. Response format is JSON by default. Set 'format' param to 'xml' to get XML response.

Bulk ZIP Codes Lookup

API Endpoint

POST

https://api.apifreaks.com/v1.0/zipcode/lookup

Test
LANGUAGE
Python
PHP
Java
Node
Ruby
JavaScript
C#
$ pip install requests

A maximum of 100 ZIP codes or postal codes can be included in the request body for a bulk lookup request.

API Request

ParameterRequiredTypeDefaultDescription
formatNoStringjsonToggles response format to JSON or XML. Value must be 'json' or 'xml'. Response format is JSON by default. Set 'format' param to 'xml' to get XML response.

For bulk ZIP code requests, include a codes array in JSON format (e.g., ‘10003‘, ‘12001‘, ‘35005‘) with up to 100 ZIP codes per request. Optionally, you can add a country parameter with the ISO 3166-1 alpha-2 code (e.g., ‘US‘, ‘PK‘) to filter results by country.

{
    "codes": [
        "54270",
        "50000"
    ],
    "country": "PK"
}

API Response

For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table. For ZIP Code Single Lookup API click here and for ZIP Code Bulk API click here.

HTTP Status Codes

HTTP StatusReasons
400
Only ISO 3166-1 alpha-2 codes country codes are supported.
404
None of the provided postal/zip codes were found in our database.

How-To-Guides

Here are the two most common uses of using our ZIP Code API:

  1. To verify that a postal code exists.
  2. To lookup the location of a postal code.

Validate ZIP Codes

To validate the existence ZIP code, send a GET request including your ZIP code in the code URL parameter. Here is a sample cURL request to validate that the 10009 ZIP code exists:

curl --location 'https://api.apifreaks.com/v1.0/zipcode/lookup?code=10009' --header 'X-apiKey: API-KEY'
# Response { "results": [ { "code": "10009", "country_code": "TW", "region": "Taipei City", "region_code": "TPE", "city": "Taipei City", "locality": "Zhongzheng District", "latitude": 25.04214, "longitude": 121.51987 }, { "code": "10009", "country_code": "IQ", "region": "Baghdad", "region_code": "BG", "city": "Baghdad", "locality": "Al Hurriya", "latitude": 33.3229, "longitude": 44.397804 }, { "code": "10009", "country_code": "GT", "region": "DEPTO DE SUCHITEPEQUEZ", "region_code": null, "city": "SAN PABLO JOCOPILAS", "locality": "", "latitude": 14.5833, "longitude": -91.45 }, { "code": "10009", "country_code": "KR", "region": "경기도", "region_code": "41", "city": "통진읍", "locality": "", "latitude": 37.7158, "longitude": 126.5952 }, { "code": "10009", "country_code": "US", "region": "New York", "region_code": "NY", "city": "New York County", "locality": "Manhattan", "latitude": 40.725872, "longitude": -73.98085 }, { "code": "10009", "country_code": "UA", "region": "Zhytomyr Oblast", "region_code": "18", "city": "Zhytomyr", "locality": "Koroliovskyi Raion", "latitude": 50.2649, "longitude": 28.6767 }, { "code": "10009", "country_code": "DZ", "region": "Bouira", "region_code": "10", "city": "Bouïra District", "locality": "Said Abid", "latitude": 36.3536, "longitude": 3.8415 } ] }

Response from ZIP Code API confirms that 10009 ZIP code is valid and exists in 9 countries of the world.

Lookup ZIP Code in a Country

To restrain the ZIP code lookup within a country, you need to send a GET request with ZIP code in the code URL parameter and country is ISO 3166-1 alpha-2 format in country URL parameter. Here is a cURL request to get the location for 35005 ZIP code assigned in US country using our ZIP Code API as follows:

curl --location 'https://api.apifreaks.com/v1.0/zipcode/lookup?code=35005&country=US' --header 'X-apiKey: API-KEY'
# Response { { "results": [ { "code": "35005", "country_code": "US", "region": "Alabama", "region_code": "AL", "city": "Jefferson County", "locality": "Adamsville", "latitude": 33.59224, "longitude": -86.947845 } ] } }

Bulk ZIP Codes Lookup

ZIP Code API's bulk lookup endpoint allows to search up to 100 ZIP codes and postal codes in one go.

To fetch detailed information or validate multiple ZIP codes in one request, simply send a POST request to the Bulk ZIP Code Lookup endpoint. Include your ZIP codes inside the codes array in the JSON body, and optionally pass the country parameter (ISO 3166-1 alpha-2) if you want to limit the results to a specific country.

Here is a cURL request to search 10003, 12001 and 35005 ZIP codes in US:

curl --location 'https://api.apifreaks.com/v1.0/zipcode/lookup' --header 'X-apiKey: API-KEY' --header 'Content-Type: application/json' --data '{ "codes": ["35005", "10003", "12001"], "country":"US" }'
# Response { "results": [ { "code": "10003", "country_code": "US", "region": "New York", "region_code": "NY", "city": "New York County", "locality": "Manhattan", "latitude": 40.73134, "longitude": -73.98873 }, { "code": "35005", "country_code": "US", "region": "Alabama", "region_code": "AL", "city": "Jefferson County", "locality": "Adamsville", "latitude": 33.59224, "longitude": -86.947845 } ] }

Since 12001 ZIP code doesn't exist in US, it isn't included in the response.

Getting the XML Response

ZIP Code API can provide response in the JSON and XML formats. JSON is the default response format for ZIP Code API. You can get the response in XML format by passing the URL parameter format=xml in the above requests.

Let's lookup 73045 ZIP code in US and get response in XML format.

curl --location 'https://api.apifreaks.com/v1.0/zipcode/lookup?format=xml&code=73045&country=US' --header 'X-apiKey: API-KEY'
# Response <CodeSearch> <results> <code_search> <code>73045</code> <country_code>US</country_code> <region>Oklahoma</region> <city>Harrah</city> <locality /> <latitude>35.4833</latitude> <longitude>-97.1734</longitude> </code_search> </results> </CodeSearch>

73045 ZIP code is assigned at Harrah, Oklahoma, US.

Pricing

To use the ZIP Code APIs, API credits are required. Charges apply only for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded. If an error occurs while processing the postal/zip code, credits will be refunded for that postal/zip code, and you will only be charged for successful lookups of postal/zip codes.

  • Single ZIP Code Lookup: For each successful lookup, 5 credit will be charged.
  • Bulk ZIP Code Lookup: For each successful lookup, 5 credit will be charged.

Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.

Price Estimation Calculator

Ready to get started?

Sign Up for Free

APIFreaks

API Catalog

  • Geolocation APIs
  • WHOIS APIs
  • DNS APIs
  • Email Validation APIs
  • SSL APIs
  • Domain APIs
  • Screenshot APIs
  • Currency APIs
  • Commodity APIs
  • Financial APIs
  • ZIP Code APIs
  • Weather APIs
  • Timezone APIs
  • User Agent APIs
  • Other APIs

Tools Catalog

  • Code Formatters
  • Data & Query Tools
  • Text Tools
  • Email Utilities
  • DNS Tools
  • Viewers
  • Converters
  • PDF Tools

Docs

  • APIs
  • Swagger Docs

Pricing & Accounts

  • Pricing
  • Sign up
  • Sign In

Company

  • About Us
  • Resources
  • Terms
  • Privacy

Copyright © 2025

Made in Pakistan