Zip Code Search Endpoint
On this page, we'll dive into the zip code search endpoint you can use to validate any given zip code and retrieve its location information.
This endpoint costs 1 credit per postal code found. For example, searching 5 codes that all exist = 5 credits, searching 10 codes where only 7 are found = 7 credits.
Search A Zip Code
This zip code search endpoint provides information about location information for the specified postal codes.
Required attributes
- Name
codes- Type
- string
- Description
Comma-separated list of zip codes (max 100). Example: 99501,90210
Optional attributes
- Name
country- Type
- string
- Description
Two letter country code. Example: us
Response Properties
- Name
city, state, state_code- Type
- string
- Description
The place and the first administrative level (US state, German Bundesland, Austrian Bundesland).
city_enandstate_enhold the English names where they differ.
- Name
province, province_code- Type
- string | null
- Description
The second administrative level below the state, e.g. a US county or a German Landkreis.
nullwhere the country has none.
- Name
community, community_code- Type
- string | null
- Description
The third administrative level, e.g. a municipality, where the country has one.
- Name
accuracy- Type
- integer | null
- Description
How precise the coordinates are:
1estimated,4geocoded place,6centroid of the addresses in the code.
Need to check a code a user typed? /v1/validate tells you whether it exists and has the country’s format. Need the code for a GPS position? Use /v1/reverse.
Request
curl -G "https://api.zipcodestack.com/v1/search?codes=1010&country=AT" \
-H "apikey: YOUR-API-KEY"
Full Response
{
"query": {
"codes": [
"1010"
],
"country": "AT"
},
"results": {
"1010": [
{
"postal_code": "1010",
"country_code": "AT",
"latitude": 48.2077,
"longitude": 16.3705,
"city": "Wien, Innere Stadt",
"state": "Wien",
"city_en": "Wien, Innere Stadt",
"state_en": "Wien",
"state_code": "09",
"province": "Wien Stadt",
"province_code": "900",
"community": "Wien, Innere Stadt",
"community_code": "90101",
"accuracy": 4
}
]
}
}