Google Places API limited results and request for additionnal fields

Hi all,
Please find below some questions about the Google Places API:

Not sure if i did a wrong setup or not, but when I want to display a list of markers (restaurants or whatever) on a map or repeating groups, it never shows more than 20 results. Is there a reason for that? It’s quite blocking for the app i am trying to build since I would need a comprehensive list of places in a many city…

Could we save additional information from the google places API, like the category of the place? That would be very useful.

What would be the best way to save these google places? So far, I did it using a click on marker that creates a new thing, but as i will need to do it for many places in many cities, it may take some time so I was wondering if there is a better way to do that? Like saving the whole list of markers displayed at once?

Many thanks for your help
Sam

Yes, Google limits the Nearby and Text calls to 20 (Radar is 200). However it does provide a “next page” token, but we don’t have access to that in Bubble.

Once we have Arrays supported in the API Connector Plugin, you should be able to do all this and more, such as bring back photos.

Thank you Nigel. I have read some of your posts and it seems the radar search only returns ID right? Is it possible with the ID to retrieve atleast the name, address, etc.?

Don’t know if i should wait for Arrays to be implemented in the API connector plugin or find a workaround in the meantime, i guess that will depend on the timeline for such release. @georgeciobanu Any idea when this could be implemented? thanks

Hey Sam,

We just enabled array support for the API connector. Please see API Connector - use most JSON APIs directly from Bubble
Hope this is what you need!

2 Likes

As if by magic :slight_smile:

Hi George, sounds great,! I am not very familiar with the API connector yet but according to Nigel that should help a lot with I need to do, so thanks for the good news!

Nigel, you may hear from me soon :slight_smile:

Cheers,
Sam

Not currently working I am afraid, but we will get there :smile:

Yes u saw you posts… i am sure we will :slight_smile:
i’ll stay tuned!

Ok, so I can do a Place Search, return PlaceId, then get the Place Details …

Works nicely (put each Place API call text value in a group, rather than on the text element I suggest).

Now onto photos …

The photo reference call returns a PNG it seems … which Bubble doesn’t like.

1 Like

Thanks Nigel. Are you able to reproduce it with the radar search to extend the call to 200?
I saw how manage to make the photo work, which is nice.

I haven’t had time to look deeper into it but does it allow us to save all these data?

It is very much the same. Use the Radar Bubble Places plugin, and do the same call to Google Place.

Feel free to mess with the example. Just don’t change all the text to Greek like others have done :dizzy_face: :slight_smile:

1 Like

Hi Nigel. I have been playing a bit with the API connector and google places API but i am wondering if this the appropriate way for what i am trying to do, so before spending too much time on it i would like to have your opinion:
My app will many cities and each of them will contain a comprehensive list of places (restaurant, bars, museums, etc.)
So i am looking for a way to display and save a list on each type of places so that I can implement my own system of reviews.
The fields I would need to retrieve are: Name, Type, Address, GPS, photo, country and city.

To have a comprehensive list, the radar search seems appropriate, but seems limited in terms of fields, and using the nearby, 20 is definitely not enough… (I may be wrong but that’s my understanding)

My other idea was to have an input with an autocomplete searching for Places, and once saved, it saves the required fields, but no idea if that is feasible… (and will be time consuming)

As you seem well informed on the Google Places stuffs, may i ask you what you think of this matter? :slight_smile:

Cheers,
Sam

Depends on whether you want to list of Places to be dynamic or static.

If you just store the Google PlaceId against your review, you could look up the Bubble data for each Place returned.

If you just wanted a static list you might be better off extracting the Place Data into a spreadsheet an uploading to Bubble.

The Radar search can do the 200 place search for you.

Thanks a lot! I went for the first option and it works quite well. I still need to come up with a “clever” way to build the general data structure but this is big step for me :slight_smile:

The only “issue” I have is that I do have the standard key to run the google places API, but i can’t find where to get the 2 other keys you used (Photoreference and placeid)?

@NigelG
I was kind of wondering the same thing. I see that in the google places API you can access the phone # of a location, the address, hours of operation, etc. But those don’t seem to be available in bubble. Do I need to use bubble’s API connector to be able to get those fields and use them?

Thanks!

Yes, you use the PlaceId in another API call.

OK, so I’m assuming I can get the PlaceId from my geo location through google’s API and then I pass that PlaceId to get all the data I’m looking for?

Is there already an example of that somewhere?

You can use the native Bubble Google Place plugin if you like.

That returns Place ID.

I then do a single call to the Place API via the Connector and populate a group.

This avoids having to do an API call per element you want to show.

Thanks a bunch @NigelG! I’ll give that a shot. I’m curious though, in the last photo, under parameters, for key ‘placeid’, where does the number in the value field come from? Is that a key given by google? Also, what does Client-safe check-mark mean?

Thank you!

That PlaceId in the API is a real PlaceId that is used to populate bubble’s data. So you pop a PlaceId in, and hit Validate and bubble knows what data to use.

Then in the Design tab you replace that “dummy” PlaceId with the actual PlaceId from your locations.

“Client Safe” refers to whether the parameter is able to be sent to the browser or not. In this case the Place ID is not anything secret, so it is client safe and we have the option to set it on the front end. However the API key is secret, and we don’t want it visible, so it isn’t client safe and is hidden on the server. Therefore we don’t have the option to overwrite it on the front end.

1 Like