Foursquare: Photos on sites / photographs, but not locally / in search?

If you use Foursquare API objects / explorers to get places in a specific area, you get the number of photos in response. For example, the default query created when you clicked the Try Now button in the API documentation:

https://api.foursquare.com/v2/venues/explore?ll=40.7,-74

It gives something like:

<...> venue: { id: "4de1b34ec65b7a3e2109e46f", name: "Beekman Beer Garden", <...> photos: { count: 371, groups: [ ], } 

But there is no place photo url.

If you try places / photos to get photos of this place, you will get a complete list of photos:

https://api.foursquare.com/v2/venues/4de1b34ec65b7a3e2109e46f/photos?group=venue

Answer:

  <...> id: "4fecf72ae4b0f9f20ef5f4ae", <...> prefix: "https://irs0.4sqi.net/img/general/", suffix: "/Ch8l3fTBYzszVoOiDcWoklClo9wbWseLr2ZXBbde4es.jpg", <...> id: "4fecd642e4b0f3117eb4d2e3", <...> prefix: "https://irs1.4sqi.net/img/general/", suffix: "/kWzECY2VMssTWex1GNZITP-YlWzWDHZYsV5p2k4tsEk.jpg", <...> 

As you can see, there are a lot of public photos for the venue.

In some cases, the API locations / studies seem to contain the URL of the photograph. Why is this? Is there a way to get a photo for each place using / explore rather than / photos?

+7
source share
2 answers

There is a way to get a (single) photograph through the endpoint of the study. You must add the venuePhotos parameter to your call with a value of 1. Example:

 https://api.foursquare.com/v2/venues/explore/?near=austin&venuePhotos=1&client_id=CLIENTID&client_secret=CLIENTSECRET&v=20131124 

Photos are returned as part of the JSON object.

+10
source

There is no single call to get the found set of places + photos.

/ places / search returns only the number of photos.

/ places / researchers often return a photograph (either as part of a meeting place, or as part of a clue related to the venue).

For places that do not have a linked photo from / place / study, you need to call / places / VENUE_ID / photos for information about the photo.

+1
source

All Articles