Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Foursquare: Photos on venues/photos but not on venues/explore?

If you use Foursquare's API venues/explore to get venues in a certain area, you get in the response the number of photos. For example, the default query generated when you press the "Try It" button in the API documentation:

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

Gives something like:

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

But no photo URL of the venue.

If you try the venues/photos to retrieve the photos of this venue, you get a full list of photos:

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

Response:

    <...>
    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.

The venues/explore API seems to include the url of a photo in some rare cases. Why is that? Is there a way of getting a photo for each venue using /explore, not /photos?

like image 268
user1463862 Avatar asked Jun 29 '12 01:06

user1463862


1 Answers

There is a way to get a (singular) photo via the explore endpoint. You have to 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 venue JSON object.

like image 168
Sullivan Avatar answered Oct 04 '22 21:10

Sullivan