After completing the setup guide, you should verify that you are able to make a successful request.
curl --get --include 'https://us-zipcodes.p.rapidapi.com/codes/5033' \
-H 'X-RapidAPI-Key: SIGN-UP-FOR-KEY' \
-H 'X-RapidAPI-Host: us-zipcodes.p.rapidapi.com'
A success request would return a HTTP Status code of 200 and response looking similar to:
{
"zip_code": "05033",
"state": "Vermont",
"state_code": "VT",
"city": "Bradford",
"population": 2572,
"timezone": "America/New_York",
"latitude": 44.00888,
"longitude": -72.15799
}
Search using city name and return all macthed zip codes. It returns first 20 result.
curl --get --include 'https://us-zipcodes.p.rapidapi.com/codes?q=abc' \
-H 'X-RapidAPI-Key: SIGN-UP-FOR-KEY' \
-H 'X-RapidAPI-Host: us-zipcodes.p.rapidapi.com'
A success request would return a HTTP Status code of 200 and response looking similar to:
[
{
"zip_code": "54413",
"state": "Wisconsin",
"state_code": "WI",
"city": "Babcock",
"population": 149,
"timezone": "America/Chicago",
"latitude": 44.28432,
"longitude": -90.13183
}
]
A sample postman collection can be found here