Reputation: 5585
I am using the Google Places API with the following search string
https://maps.googleapis.com/maps/api/place/queryautocomplete/json?key=AIzaSyDryrzCJoKA-XeN-f3Q2KDPdJHd27Nl7CoM&sensor=true&input=bri
The result back look like this:
{
"predictions" : [
{
"description" : "Bristol, United Kingdom",
"matched_substrings" : [
{
"length" : 3,
"offset" : 0
}
],
"terms" : [
{
"offset" : 0,
"value" : "Bristol"
},
{
"offset" : 9,
"value" : "United Kingdom"
}
]
}
... etc etc
],
"status" : "OK"
}
I can't see an 'id' or 'reference' property on any of the returned predictions results which is needed in order to then request the full details from the Google Places Details API.
Their documentation says I should see both these items. https://developers.google.com/places/documentation/autocomplete
Any one know what i am doing wrong?
Upvotes: 1
Views: 411
Reputation: 330
You're using the wrong method. You have to use autocomplete: https://developers.google.com/places/documentation/autocomplete
Upvotes: 2
Reputation: 21
You're using the "queryautocomplete" service. Query Autocomplete not returns the place id field. Try use autocomplete service with this url:
Upvotes: 1