Auto completer api maps

Hello everyone, can someone help me, how can I convert, the data that I get from the auto completer api
I basically want to do an auto completer, how can I convert the data I get from the api into a list
when I put this path
https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places&callback=initMap
it returns me a lot of data, I guess that data must be the addresses, now how do I convert that data into a list

It looks like you’re getting your data response in the wrong format. You’ll need it in JSON format. Are you using the Google Places API? Your URL should look something like this (see this link for examples):

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=1600+Amphitheatre&key=[YourKey]&sessiontoken=1234567890

But of course replacing [YourKey] with your actual authentication key value.

And the response you get should be in JSON format similar to this:

2 Likes

hi thanks for helping me, if it worked correctly


now how can I do an autocomplete?
or how do I get the street data in a list to do an autocomplete

Well, the part of the url in bold below is where you would type the partial text string to autocomplete:

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=1600+Amphitheatre&key=[YourKey]&sessiontoken=1234567890

So you can use a text “join” block to join the first part of that url with a variable (e.g. text input block value) and then with the last part of the url.

As for parsing the JSON, there are many examples on the forums but if you get stuck, post a screenshot and someone can help you.

1 Like