Holiday Sale! Get over 30% off when you subscribe to an annual plan!

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.

(4.3)

From 4,878 users

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
418ms468ms493ms643ms1338ms

Didn't find what you were looking for? Suggest an improvement


/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:

  • zip  optional

    The ZIP Code to look up.

  • city  optional premium only

    Full name of the city to search (case-sensitive).

  • state  optional premium only

    2-letter abbreviation of the state (case-insensitive).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

Returns a JSON array of objects, each with the following properties:

  • zip_code

    The ZIP Code.

  • valid   premium only

    Whether the ZIP Code is valid.

  • city   premium only

    The city name associated with the ZIP Code.

  • state

    The 2-letter state abbreviation (e.g., CA, NY, TX).

  • county   premium only

    The county name associated with the ZIP Code.

  • timezone

    The timezone for the location (e.g., America/Los_Angeles).

  • area_codes   premium only

    An array of area codes associated with the ZIP Code.

  • country

    2-letter ISO 3166-1 alpha-2 country code (e.g., US, CA, etc.).

  • lat

    The latitude coordinate of the ZIP Code location (centroid).

  • lon

    The longitude coordinate of the ZIP Code location (centroid).

Sample Request Live Demo!

zip
city premium
state premium

Try this API endpoint with all available parameters in our API playground

https://api.api-ninjas.com/v1/zipcode?zip=90210

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
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.