I\'d like to retrieve a place\'s location based on the name and address in Google Sheets, something like:
=PlaceAddress("White House, Washington, DC"
Instead of Google Places API you can also use Google Maps Geocoding API. The code from above just needs to be adjusted a bit:
function mapAddress(address) {
var API_KEY = 'yourapikeyhere';
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + address + '&lang=en&key=' + API_KEY;
var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
obj = JSON.parse(json);
addr = obj.results[0].formatted_address;
return addr;
}