You can get from the same api without any additional api or url call.
HTML
<input class="wd100" id="fromInput" type="text" name="grFrom" placeholder="From" required/>
Javascript
var input = document.getElementById('fromInput');
var defaultBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(-33.8902, 151.1759),
new google.maps.LatLng(-33.8474, 1512631)
)
var options = {
bounds: defaultBounds
}
var autocomplete = new google.maps.places.Autocomplete(input, options);
var searchBox = new google.maps.places.SearchBox(input, {
bounds: defaultBounds
});
google.maps.event.addListener(searchBox, 'places_changed', function() {
var places = searchBox.getPlaces();
console.log(places[0].geometry.location.G); // Get Latitude
console.log(places[0].geometry.location.K); // Get Longitude
//Additional information
console.log(places[0].formatted_address); // Formated Address of Place
console.log(places[0].name); // Name of Place
if (places.length == 0) {
return;
}
var bounds = new google.maps.LatLngBounds();
console.log(bounds);
});
}