Search by State Endpoint
On this page, we'll dive into the state search endpoint you can use to find all postal codes within a specific state or province.
This endpoint costs 1 credit per 10 postal codes returned (minimum 1 credit). For example, 50 results = 5 credits, 250 results = 25 credits. Use the limit parameter to control costs.
GET/v1/code/state
Search Codes by State
This endpoint returns all postal codes for a specified state or province.
Required attributes
- Name
state_name- Type
- string
- Description
State or province name. Example: Alaska
- Name
country- Type
- string
- Description
Two letter country code. Example: us
Optional attributes
- Name
limit- Type
- integer
- Description
Maximum number of results to return. Example: 100
Request
GET
/v1/code/statecurl -G https://api.zipcodestack.com/v1/code/state?state_name=Alaska&country=us&limit=100 \
-H "apikey: YOUR-API-KEY"
Full Response
{
"query": {
"state": "Alaska",
"country": "us"
},
"results": [
"99501",
"99502",
"99503",
"99504",
"99505",
"..."
]
}