I’m using Google Places API to retrieve data about places, but couldn’t find how to get a picture of that place, Google Places API just provides icon which is not the same. I need the photo you get when you search for a place in Google Maps in a web browser for example. There is usually more pictures from Panoramio, but Panoramio API can only search for pictures by location and not by a particular restaurant or hotel name for example. Any ideas?
I’m using Google Places API to retrieve data about places, but couldn’t find how
Share
The Places API will give you the coordinates (latitude and longitude) in the place detail response; you can then send the coordinates to the Panoramio API.
For example (drawing from examples in the API docs):
https://maps.googleapis.com/maps/api/place/details/json?reference=<big long key for place>&sensor=true&key=AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPIResponse:
We can see that the coordinates are
“location” : {
“lat” : -33.8669710,
“lng” : 151.1958750
}
Then we can send a request to Panoramio, inserting the coordinates, plus a little wiggle room on either side (I did +/- 0.002 degrees, a shape 200 m x 200 m square at the equator, generally smaller).
http://www.panoramio.com/map/get_panoramas.php?set=public&from=0&to=20&minx=-33.868&miny=151.193&maxx=-33.864&maxy=151.197&size=medium&mapfilter=trueYou may need to do some filtering of the responses to get the closest photo, but this should give you something to work with.