I’m using Google Places Auto complete API. If I search for a particular suburb, let’s say Richmond in Victoria, Australia I get the following address components returned:
0:Object
long_name: "Richmond"
short_name: "Richmond"
types: Array[2]
0: "locality"
1: "political"
1: Object
long_name: "Victoria"
short_name: "VIC"
types: Array[2]
0: "administrative_area_level_1"
1: "political"
2: Object
long_name: "Australia"
short_name: "AU"
types: Array[2]
0: "country"
1: "political"
This is great, however Richmond is a suburb of Melbourne and for the purpose of my app I need to know this. How can I get the API to return the parent city if the locality is within one? If you look at the following URL you can see that it places Richmond in Melbourne, Victoria, Australia so I’m assuming it’s possible somehow to get this information via the API?
https://maps.google.com/maps/place?q=Richmond&ftid=0x6ad64259018db945:0x5045675218ce810
Use the returned Latlng to reverse geocode: https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding