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.
/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:
- zipoptional- The ZIP Code to look up. 
- cityoptional premium only- Full name of the city to search (case-sensitive). 
- stateoptional premium only- 2-letter abbreviation of the state (case-insensitive). 
Headers
- X-Api-Keyrequired- API Key associated with your account. 
Sample Request Live Demo!
city
state
https://api.api-ninjas.com/v1/zipcode?city=Portland&state=ORHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[
  {
    "zip_code": "97201",
    "valid": true,
    "city": "Portland",
    "state": "OR",
    "county": "Multnomah County",
    "timezone": "America/Los_Angeles",
    "area_codes": [
      "503",
      "971"
    ],
    "country": "US",
    "lat": "45.5074",
    "lon": "-122.6898"
  },
  {
    "zip_code": "97202",
    "valid": true,
    "city": "Portland",
    "state": "OR",
    "county": "Multnomah County",
    "timezone": "America/Los_Angeles",
    "area_codes": [
      "971"
    ],
    "country": "US",
    "lat": "45.4803",
    "lon": "-122.6451"
  }
]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.