I'm using Google Places to search for a place (Maybe I need Google Maps in order to get my desired goal):
https://maps.googleapis.com/maps/api/place/details/json?placeid=Eh9SdWUgU3RhbmlzbGFzLCBDb2xtYXIsINem16jXpNeq&language=hi&key=myKey
Response:
{
"html_attributions" : [],
"result" : {
"address_components" : [
{
"long_name" : "Rue Stanislas",
"short_name" : "Rue Stanislas",
"types" : [ "route" ]
},
{
"long_name" : "Colmar",
"short_name" : "Colmar",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Haut-Rhin",
"short_name" : "Haut-Rhin",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Grand Est",
"short_name" : "Grand Est",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "फ़्रांस",
"short_name" : "FR",
"types" : [ "country", "political" ]
},
{
"long_name" : "68000",
"short_name" : "68000",
"types" : [ "postal_code" ]
}
],
"adr_address" : "\u003cspan class=\"street-address\"\u003eRue Stanislas\u003c/span\u003e, \u003cspan class=\"postal-code\"\u003e68000\u003c/span\u003e \u003cspan class=\"locality\"\u003eColmar\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eFrance\u003c/span\u003e",
"formatted_address" : "Rue Stanislas, 68000 Colmar, France",
"geometry" : {
"location" : {
"lat" : 48.0799554,
"lng" : 7.3526162
},
"viewport" : {
"northeast" : {
"lat" : 48.0813043802915,
"lng" : 7.353965180291502
},
"southwest" : {
"lat" : 48.0786064197085,
"lng" : 7.351267219708498
}
}
},
"icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
"id" : "e5f239bd54d6e0156e898767330506c2e45735a5",
"name" : "Rue Stanislas",
"place_id" : "ChIJn4hibt5lkUcRrCcB7Govsis",
"reference" : "CmRbAAAAygsTgSHpHE4OFcumAyXCPTWOY9qepgdVPY0_CI72WMFxhSQsGZ6bgEUyDr7i8lAbiEYjFD4QQC4v-M2LfFZKmRiq8IpBnxCkUqf0kUN2cE8I68Fb6o7eAit2N_33jLBWEhBBalp6JYpcV78RkMWeAGrvGhToTkaPAXWlULgE8fOuVtkx5hf_6g",
"scope" : "GOOGLE",
"types" : [ "route" ],
"url" : "https://maps.google.com/?q=Rue+Stanislas,+68000+Colmar,+France&ftid=0x479165de6e62889f:0x2bb22f6aec0127ac",
"utc_offset" : 120,
"vicinity" : "Colmar"
},
"status" : "OK"
}
I have a few problems with this response:
1. I need the place ids for each: locality, administrative_area_level_2, administrative_area_level_1
.
In order to get them - do I have to send 3 more requests to google places ? And in case I have to - how can I get a precise result for a specific place without using id (If I have to use text-search
with Haut-Rhin
I can maybe get a few more results)?
Even when sending
language=hi
I got only the country translated.Colmar belongs also to
Alsace
region and it's not mentioned anywhere.