Radius Search Endpoint
On this page, we'll dive into the radius search endpoint you can use to find all postal codes within a given radius.
This endpoint costs 10 credits per request.
GET/v1/radius
Find Codes Within Radius
This endpoint returns all postal codes within a specified radius of a given postal code.
Required attributes
- Name
code- Type
- string
- Description
The postal code to search around. Example: 99501
- Name
radius- Type
- integer
- Description
The radius to search within (max 500). Example: 50
- Name
country- Type
- string
- Description
Two letter country code. Example: us
Optional attributes
- Name
unit- Type
- string
- Description
Unit for distance calculation. Options: km, miles. Default: km
Request
GET
/v1/radiuscurl -G https://api.zipcodestack.com/v1/radius?code=99501&radius=50&country=us&unit=km \
-H "apikey: YOUR-API-KEY"
Full Response
{
"query": {
"code": "99501",
"unit": "km",
"radius": 50,
"country": "us"
},
"results": [
{
"code": "99502",
"city": "Anchorage",
"state": "AK",
"city_en": "Anchorage",
"state_en": "Alaska",
"distance": 5.23
},
{
"code": "99503",
"city": "Anchorage",
"state": "AK",
"city_en": "Anchorage",
"state_en": "Alaska",
"distance": 8.45
}
]
}