Google Places API can return what you ask for. However, you need to input a GPS coordinate rather than another zip code. (Tip: you can use Geocoding API to turn zip code into GPS coordinate: 开始使用 | Geocoding API | Google for Developers)
You can see the documentation of Places API here: Nearby Search (New) | Places API | Google for Developers
I have tested the following for example: This request returns a list of postal_codes around a set GPS location within 10 miles radius:
{
"includedTypes": [
"postal_code"
],
"maxResultCount": 10,
"locationRestriction": {
"circle": {
"center": {
"latitude": 37.7937,
"longitude": -122.3965
},
"radius": 10
}
}
}
And this is the response. See that there are two zip codes within that range.
{
"places": [
{
"name": "places/ChIJ49w0El-AhYAR9WVSnuOiWM8",
"id": "ChIJ49w0El-AhYAR9WVSnuOiWM8",
"types": [
"postal_code"
],
"formattedAddress": "San Francisco, CA 94111, USA",
"addressComponents": [
{
"longText": "94111",
"shortText": "94111",
"types": [
"postal_code"
],
"languageCode": "en-US"
},
{
"longText": "San Francisco",
"shortText": "SF",
"types": [
"locality",
"political"
],
"languageCode": "en"
},
{
"longText": "San Francisco County",
"shortText": "San Francisco County",
"types": [
"administrative_area_level_2",
"political"
],
"languageCode": "en"
},
{
"longText": "California",
"shortText": "CA",
"types": [
"administrative_area_level_1",
"political"
],
"languageCode": "en"
},
{
"longText": "United States",
"shortText": "US",
"types": [
"country",
"political"
],
"languageCode": "en"
}
],
"location": {
"latitude": 37.795936200000007,
"longitude": -122.4000032
},
"viewport": {
"low": {
"latitude": 37.737043047943466,
"longitude": -122.40595407106871
},
"high": {
"latitude": 37.807227869417872,
"longitude": -122.36739405166658
}
},
"googleMapsUri": "https://maps.google.com/?cid=14940870862299096565",
"utcOffsetMinutes": -420,
"adrFormatAddress": "\u003cspan class=\"locality\"\u003eSan Francisco\u003c/span\u003e, \u003cspan class=\"region\"\u003eCA\u003c/span\u003e \u003cspan class=\"postal-code\"\u003e94111\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eUSA\u003c/span\u003e",
"iconMaskBaseUri": "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet",
"iconBackgroundColor": "#7B9EB0",
"displayName": {
"text": "94111",
"languageCode": "en-US"
},
"shortFormattedAddress": "San Francisco"
},
{
"name": "places/ChIJDXK6UmKAhYARfzuOY6DDgeM",
"id": "ChIJDXK6UmKAhYARfzuOY6DDgeM",
"types": [
"postal_code"
],
"formattedAddress": "San Francisco, CA 94105, USA",
"addressComponents": [
{
"longText": "94105",
"shortText": "94105",
"types": [
"postal_code"
],
"languageCode": "en-US"
},
{
"longText": "San Francisco",
"shortText": "SF",
"types": [
"locality",
"political"
],
"languageCode": "en"
},
{
"longText": "San Francisco County",
"shortText": "San Francisco County",
"types": [
"administrative_area_level_2",
"political"
],
"languageCode": "en"
},
{
"longText": "California",
"shortText": "CA",
"types": [
"administrative_area_level_1",
"political"
],
"languageCode": "en"
},
{
"longText": "United States",
"shortText": "US",
"types": [
"country",
"political"
],
"languageCode": "en"
}
],
"location": {
"latitude": 37.789018299999995,
"longitude": -122.39150629999999
},
"viewport": {
"low": {
"latitude": 37.782449057926875,
"longitude": -122.40352908852206
},
"high": {
"latitude": 37.800181956998415,
"longitude": -122.38168098330425
}
},
"googleMapsUri": "https://maps.google.com/?cid=16393599212237765503",
"utcOffsetMinutes": -420,
"adrFormatAddress": "\u003cspan class=\"locality\"\u003eSan Francisco\u003c/span\u003e, \u003cspan class=\"region\"\u003eCA\u003c/span\u003e \u003cspan class=\"postal-code\"\u003e94105\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eUSA\u003c/span\u003e",
"iconMaskBaseUri": "https://maps.gstatic.com/mapfiles/place_api/icons/v2/generic_pinlet",
"iconBackgroundColor": "#7B9EB0",
"displayName": {
"text": "94105",
"languageCode": "en-US"
},
"shortFormattedAddress": "San Francisco"
}
]
}