Forum Academy Marketplace Showcase Pricing Features

How do i display Google Places API Data?

Hello fellow Bubblers,

I’m having trouble figuring out how to use the Google Places API.

I’m trying to create a search application, where the user inputs their city and then is presented a list of nearby locations of various types (ex. art_gallery, book_store, amusement_park, etc).

I would like to present the results in a repeating group.

Inside that repeating group i would like to display the Name of the place, a short description, and a photo.
Something like this, but without the share and learn more button

I’m having trouble figuring out how to pass the Google Places data to each individual element. I’m not even sure if i’m setting up my repeating group correctly.

The Places data is available from Get Google Place’s xxxxxx (which is under Get Data From External API).

So Name, Address, Open Now etc

You pass in the Cell with the name of what you want to search in Query.

@NigelG thank you for taking the time to respond.

I’m still having trouble figuring out how to retrieve a list of google places inside a repeating group.

What i’m trying to do is as follows:

  • A user types a city in a search bar.

  • When the user clicks search.

  • I would like to do a Nearby Search Request for certain types of places (example: art_gallery, and aquariums), in and around the city that the user has entered.

  • Inside my repeating group i will have three visual elements. One visual element will display a Place Photo of the current cells google place. The second element will display the name of the current cells google “Place” (example - Pleiades Gallery). The third visual element will display a short description(summary information) of that “Place” (example - Pleiades Gallery is located in the heart of Chelsea, the vibrant and rapidly growing center of the visual arts in New York City - or whatever short description(summary information) Google Places API has stored in their database).

Example:
For example a user types in New York City in the search bar, then my application would do a nearby search for all the art_gallery(s), and aquariums in or near that city. It would return a list of specific google place types (art_gallery(s) and aquariums). In a repeating group, three elements will be displayed in each cell. One element will display the place photo, the second element will display the place name; and, the third element will display a short description(summary information) about the place.

If this is possible, would you be able to explain to me the step by step process on how to accomplish this.

This is a link https://bubble.io/page?type=page&name=google_places_api&id=forum_app&tab=tabs-1 to the Public Forum App if anybody would like to contribute.

Thank you for your time.

I have updated that page, and it sort of works. But there are a couple of issues …

  1. The type list in Bubble isn’t the full list in Google, so you don’t have gallery for example.

  2. I am not sure that the Text Search is the right thing to be using here, it is more likely that the Places API you want is the Nearby search. The text search needs a query parameter (it is like a “Cafes Near Me” Google Search).

So you can sort of do what you want by doing a text search for “Gallery” (as I have done). But what you really want, I think, is for a Nearby search to be implemented as well.

Maybe am missing something, so over to @emmanuel ?

Thanks again @NigelG for your time.

I really appreciate your help.

Let’s see what @emmanuel has to say.

What is missing to the current page?

What i can see on the app is that you’re trying to get a photo of a google place, but it’s not something that is returned by Google (at least not with our current plugin). Adding Photo by hand after ‘current cell’s google place’ won’t solve that…

Generally speaking, if you see something red in the editor, that means there is something fishy going on.

Think there are a couple of issues. Will email if it isn’t clear.

Yes, description and photos are not returned in the current API, although it looks like the Photos might be available ?

The API that we are using here seems to be the “Text Search” one, but I think it would be very useful to also have the “Radar Search”. This may well be a feature request !

As it stands the Type list on the Text Search doesn’t have the complete list of possible types. So that is maybe a bug ?

If Google returns such data (can you check), can you email us at support and we’ll look into it. Adding more fields is probably easy, adding Radar search is a bigger project.

What do you mean by “As it stands the Type list on the Text Search doesn’t have the complete list of possible types. So that is maybe a bug ?”?

No problem, will email :smile:

The lists of types supported is here.

https://developers.google.com/places/supported_types

This would seem to have a lot more values than allowed on the bubble type drop down.

I came across this post now and I wonder if there is a plan to get more data from the places API.

Here @NigelG explains how to get a Photo using the API connector

Is this something that could be easy to add on your plugin as you mentioned above @emmanuel? Here is the documentation, on “photos[]” https://developers.google.com/places/web-service/details

We can add that, but it’s a different call, so it’s a bit of work (not a quick fix). What is wrong with the API connector?

Nothing wrong. I just never used it but I’ll learn how to.