title: Use Google place autocomplete web service with Latitude & Longitude
body: <p>I want to use Google place autocomplete webservice: <a href="https://developers.google.com/places/web-service/autocomplete" rel="nofollow noreferrer">https://developers.google.com/places/web-service/autocomplete</a></p>
  
  <p>to search for locations based upon a query (e.g. "High Street"). I also want the latitude and longitude of each place.</p>
  
  <p>It seems that the only way to do this using the web service is to:</p>
  
  <ol>
  <li><p>Perform an autocomplete search e.g. </p>
  
  <blockquote>
    <p><a href="https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&amp;types=(cities)&amp;language=en_GB&amp;key=YOUR_API_KEY" rel="nofollow noreferrer">https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&amp;types=(cities)&amp;language=en_GB&amp;key=YOUR_API_KEY</a></p>
  </blockquote></li>
  <li><p>Loop through each result and do a separate query for each location (see <a href="https://developers.google.com/places/web-service/details" rel="nofollow noreferrer">https://developers.google.com/places/web-service/details</a>):</p>
  
  <blockquote>
    <p><a href="https://maps.googleapis.com/maps/api/place/details/json?placeid=PLACE_ID&amp;key=YOUR_API_KEY" rel="nofollow noreferrer">https://maps.googleapis.com/maps/api/place/details/json?placeid=PLACE_ID&amp;key=YOUR_API_KEY</a></p>
  </blockquote></li>
  </ol>
  
  <p>That means if I have 10 results, I have to do 10 additional web requests! That means 11 in total (1 for autocomplete, and 10 more for each place request).</p>
  
  <p>This is very inefficient!</p>
  
  <p>Surely there is a better way than this, as Google Maps on Android shows the distance of each place to your current location, indicating that the latitude and longitude is returned as shown by this screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/KWb1al.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KWb1al.png" alt="Android Google Maps Search"></a></p>