Zip Code API
The Zip Code API enables you to look up detailed information for every ZIP Code in the United States. You can input ZIP Codes directly, or search for ZIP Codes using city and state parameters.
If you're looking for Canadian postal codes, use the Postal Code API instead.
Checking API status...
/v1/zipcode GET
https://api.api-ninjas.com/v1/zipcode
Returns a list of ZIP Code details matching the input parameters.
Parameters
At least one of the following parameters must be set:
zipoptionalThe ZIP Code to look up.
cityoptional premium onlyFull name of the city to search (case-sensitive).
stateoptional premium only2-letter abbreviation of the state (case-insensitive).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
Returns a JSON array of objects, each with the following properties:
zip_codeThe ZIP Code.
validWhether the ZIP Code is valid.
cityThe city name associated with the ZIP Code.
stateThe 2-letter state abbreviation (e.g., CA, NY, TX).
countyThe county name associated with the ZIP Code.
timezoneThe timezone for the location (e.g., America/Los_Angeles).
area_codesAn array of area codes associated with the ZIP Code.
countryThe country code (e.g., US).
latThe latitude coordinate of the ZIP Code location.
lonThe longitude coordinate of the ZIP Code location.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/zipcode?zip=90210Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[
{
"zip_code": "90210",
"valid": true,
"city": "Beverly Hills",
"state": "CA",
"county": "Los Angeles County",
"timezone": "America/Los_Angeles",
"area_codes": [
"310",
"424"
],
"country": "US",
"lat": "34.0901",
"lon": "-118.4065"
}
]Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/zipcode?zip=90210" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.