在美国特定城市的某个半径获取邮政编码

In my application, I want to get all the zip codes in some particular radius of a city of US. Now, I am trying to do like this find out the center of that city may be latitude and longitude and then get the zipcodes in the given radius.

Is there any other solution for this and any API suggestion to find zipcodes in given radius of a city ?

You can try the following approach, although I am not sure if it covers all possible postal codes:

  1. Search the places of type postal office setting center location and some radius in the places API radar search.

E.g.

https://maps.googleapis.com/maps/api/place/radarsearch/json?location=32.2987573%2C-90.1848103&radius=20000&type=post_office&key=YOUR_API_KEY

This will give you place IDs of postal offices.

  1. Execute reverse geocoding request for each place ID and extract a postal code from address components

E.g.

https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJU2h85nfRKYYRwRVeeGrQ6lY&key=YOUR_API_KEY

Visually, it looks like

enter image description here