Is there a way to batch multiple reverse-geocoding requests on the Google Maps API?
I only see simple requests possible: https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY
Is there a way to batch multiple reverse-geocoding requests on the Google Maps API?
I only see simple requests possible: https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=YOUR_API_KEY
Google Geocoding Api Web Service
No, it doesn't let you, as you already noticed, to add multiple addresses, because the required parameter is not an array as stated by documentation:
Required parameters in a reverse geocoding request: latlng — The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address.
You didn't specify the code context that you are using. Can I suggest you to implement another Google Api? It will be a lot easier to do multiple request via code.
Google Geocoding Javascript Api
With this Api you can do multiple requests like this:
var locations = [
{ lat: -31.563910, lng: 147.154312 },
{ lat: -33.718234, lng: 150.363181 },
{ lat: -33.727111, lng: 150.371124 },
{ lat: -33.848588, lng: 151.209834 }
];
var geocoder = new google.maps.Geocoder();
for (i = 0; i < locations.length; i++) {
geocodeAddress(locations[i]);
}