API Freaks logoAPI Freaks logo
⌘K

    Documentation

  • Pricing

  • Resources

  • Tools

  • Contact us

⌘K
Sign InGet Started For Free
  • Overview
  • Documentation
  • How to Guides
  • Pricing
  • APIFreaks
  • Organization and Teams
  • Credits Usage API
  • IP Geolocation Lookup API
  • 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
  • SSL Certificate Lookup
  • Domain Availability API
  • Bulk Domain Availability API
  • Screenshot API
  • Bulk Screenshot API
  • Currencies Exchange Rates API
  • Currency Converter API
  • Currency Time Series API
  • Currency Fluctuation API
  • Geolocalized Currency Converter
  • Live Commodity Prices
  • Commodity Historical Prices
  • Commodity Fluctuation API
  • Commodity Time Series API
  • Timezone Lookup
  • Timezone Converter
  • Zipcode Lookup API
  • User Agent Parser
  • Bulk User Agent Parser
  • Astronomy API

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

ZIP Code Lookup API provides the ZIP codes and postal codes to location data (city, state/province/region, country, latitude and longitude) and you can use it to find a postal code or ZIP code assigned anywhere in the world (to validate) or do ZIP code to city look-ups.

Seamlessly integrate our ZIP Code Lookup API in your applications to provide location-based services like setting up delivery routes, understanding the customers' demographics, running area-specific digital marketing campaigns, validating an address using the given postal code or ZIP code to improve data accuracy or address completion or correct errors or standardize formats, identifying a customer based on the provided ZIP/postal code to prevent frauds and many other use cases are there to efficiently use the ZIP Code Lookup API.

10K Free Credits, No Credit Card Required

Features

Validate a ZIP Code

Verify that a ZIP code or a postal code is a valid one and exists where you’re looking for it to be.

ZIP Code to Location Lookup

Search & locate any ZIP code or postal code in the world with our fast ZIP Code Lookup API. You can restrain the search within a country as well.

Worldwide ZIP Codes & Postal Codes Support

ZIP Code Lookup API supports search for ZIP codes and postal codes assigned anywhere in the world.

Search ZIP Codes in Bulk

Our ZIP Code Lookup API allows to lookup up to 100 postal codes and ZIP codes lookup in one go. Quickly handle bulk data accurately.

Documentation

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
codeYesArray-Comma separated list of postal / zip codes.
countryNoStringAll countriesCountry code in ISO 3166-1 alpha-2 format. If not provided, search results will be returned from all countries.

You can pass up to 100 comma-separated postal/ZIP codes in the code URL parameter.

API Response

For a comprehensive view of the API response structure and detailed field descriptions, explore the interactive Response Table by clicking here.

HTTP Status Codes

HTTP StatusReasons
400
(1) A maximum of 100 postal/zip codes can be processed per request. (2) 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 Lookup API:

  1. 1. to verify that a postal code exists; and
  2. 2. to lookup the location of a postal code.

You can perform the above operations in bulk for up to 100 postal codes or ZIP codes in one request to the ZIP Code Lookup API. Let's see some example use cases.

Validate Multiple ZIP Codes

To validate the existence of one or more ZIP codes, you need to send a GET request passing your ZIP codes in the code URL parameter in your request. Here is a sample curl request to validate that 35005 and 10009 ZIP codes are valid and exist:

curl --location 'https://api.apifreaks.com/v1.0/zipcode/lookup?code=35005,10009' --header 'X-apiKey: YOUR_API_KEY'
# Response { "results": [ { "code": "10009", "country_code": "DZ", "region": "Bouira", "city": "Ain Bessem Yahiaoui Larbi", "locality": "", "latitude": 36.3536, "longitude": 3.8415 }, { "code": "10009", "country_code": "GT", "region": "DEPTO DE SUCHITEPEQUEZ", "city": "SAN PABLO JOCOPILAS", "locality": "", "latitude": 14.5833, "longitude": -91.45 }, { "code": "10009", "country_code": "KR", "region": "Gyeonggi", "city": "Gimpo", "locality": "Gimpo-si", "latitude": 37.715855, "longitude": 126.60026 }, { "code": "10009", "country_code": "US", "region": "New York", "city": "New York", "locality": "", "latitude": 40.7262, "longitude": -73.9796 }, ... ... ... { "code": "35005", "country_code": "KW", "region": "Al-Asimah", "city": "Doha", "locality": "Doha (Block 5)", "latitude": 29.321714, "longitude": 47.82254 }, { "code": "35005", "country_code": "ES", "region": "Islas Canarias", "city": "Las Palmas de Gran Canaria", "locality": "Las Palmas de Gran Canaria", "latitude": 28.099379, "longitude": -15.413368 }, { "code": "35005", "country_code": "US", "region": "Alabama", "city": "Jefferson", "locality": "Adamsville (Adamsville)", "latitude": 33.592857, "longitude": -86.99402 } ] }

You can see that the 35005 and 10009 ZIP codes are assigned at many locations in the world. That's that way to verify that the ZIP codes are valid.

The above response is clearly not readable or say “usable” except checking the existence of ZIP codes The response from ZIP Code Lookup API returns city, region, country_code, latitude, and longitude along with the searched ZIP codes. You can further skim down the search to lookup within a country to make the response useful for address auto-completion, user verification or some other use cases.

Lookup Multiple ZIP Codes in a Country

To restrain the ZIP codes lookup within a country, you need to send a GET request with ZIP codes 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 (country, state/province/region, city, county, latitude and longitude) for 35005 and 10009 ZIP codes assigned in US country using our ZIP Code Lookup API as follows:

curl --location 'https://api.apifreaks.com/v1.0/zipcode/lookup?code=35005,10009&country=US' --header 'X-apiKey: YOUR_API_KEY'
# Response { "results": [ { "code": "10009", "country_code": "US", "region": "New York", "city": "New York", "locality": "", "latitude": 40.7262, "longitude": -73.9796 }, ... { "code": "35005", "country_code": "US", "region": "Alabama", "city": "Jefferson", "locality": "Adamsville (Adamsville)", "latitude": 33.592857, "longitude": -86.99402 } ] }

Getting the XML Response

ZIP Code Lookup API can provide response in the JSON and XML formats. JSON is the default response format for ZIP Code Lookup 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: YOUR_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 Lookup API, 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.

For each successful request, 5 credits will be charged for ZIP Code Lookup.

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
  • SSL APIs
  • Domain Availability APIs
  • Screenshot APIs
  • Currency APIs
  • Commodity APIs
  • Timezone APIs
  • Zipcode APIs
  • User Agent APIs
  • Other APIs

Tools Catalog

  • Formatters & Beautifiers
  • Converters & Optimizers
  • Viewers & Validators

Docs

  • Documentation
  • Swagger Docs

Pricing & Accounts

  • Pricing
  • Sign up
  • Sign In

Company

  • About Us
  • Resources
  • Terms
  • Privacy

Copyright © 2024

Made in Pakistan