1
votes

I have a basic Foursquare API account and I'm using venue search, to:

  1. Search for a city location
  2. And then return venue results.

Pretty simple.

I'm using this api, but no photos seem to be available in the API feed for photos.

https://api.foursquare.com/v2/venues/explore?near=london&&client_id={MY-API-KEY}&client_secret={MY-SECRET-KEY}&v=201806044

I'm using ReactJS and making a simple axios request for this api. Code further below...

What's the best way to get photos for a venue? I search and stackoverflow and tried adding &venuePhotos=1 as suggested previously be a user, but that didn't work...

componentDidMount() {
    console.log('COMPONENT DID MOUNT');

    axios.get('https://api.foursquare.com/v2/venues/explore?near=london&&client_id={MY-API-KEY}&client_secret={MY-SECRET-KEY}&v=201806044&venuePhotos=1')
      .then(res => {
        console.log('DATA', res.data.response.groups[0].items);
        this.setState(
          { places: res.data.response.groups[0].items.slice(0,12)}
        );
      });
  }
1

1 Answers

0
votes

Beginning on May 31st, foursquare made five changes in order to simplify their API and maintain the quality of their service as their developer community grows.

https://developer.foursquare.com/docs/announcements#start-up-tier-launch

Venues search, explore, trending, similar, and next endpoints will return the following fields: venue name, venue ID, address, lat/long, and category. To access additional rich content for each venue, please call the details (venues/x) endpoint with venue ID as a parameter.

So, you should call the details (venues/x) endpoint.

https://developer.foursquare.com/docs/api/venues/details