Get Photos from Google Place API

Hi guys,

I’m trying to get photos of places from Googe Place API when the user inputs a location and show them in a list.

I tried to follow some threads in the forum but I don’t seem to get it right.

So far, I created the external collection with a dummy place_id, and the test worked as you can see in the screenshot below:

How can I get and pass the place_id to get the photos and then show them in a list?
Also, is possible to create a relationship with an external collection?

Can anyone provide us with some help to get this feature up and running?

Would really appreciate it!

Thank you

Hi @SabtiZakaria,

A couple of links might be useful:
Get Google Place Images via API
Google place api returns results incorrectly

When I experimented with this, I created an external collectio for Places Photos, with URL https://maps.googleapis.com/maps/api/place/details/json, and added 2 result keys: first is “result” and second is “photos”. Also I pass place_id in a query param.
The goal is to get photo references from place details (Place Details  |  Places API  |  Google for Developers).

And then I display photos in a list of this external collection. Photos are displayed by URL: https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=PHOTOREFERENCEFROMTHECOLLECTION&key=YOURKEY.

A bit glitchy - sometimes old photos are displayed when place is changed - but works in general.

Best,
Victor.

Thank you Victor, it was very useful and I was able to get the photo reference and display the images.

But I believe this would be very costly in the long run especially since my images are displayed on the home page.

Is there any way to save the pictures somewhere instead of sending the request to the API each time?

Hi @SabtiZakaria,

Indeed it will be costly, especially if you have large user traffic on your front page. Unfortunately, Adalo doesn’t have image caching capabilities.

In theory, you can save these images to some external storage (S3 / Cloudinary / etc.), store the URL links to these images in some Adalo collection and then display images using lists in Adalo. But this will require some 3rd party platform to work (Make / Xano / etc.).

And I am not sure what will be cheaper - to use Google API or spend money on integration platforms.

Best,
Victor