Buzby
Buzby

Reputation: 573

Foursquare Venues Explore API - no URL in results

I am using the Foursquare Venues Explore API - ie https://api.foursquare.com/v2/venues/explore - to retrieve venues around a certain location.

This call returns a collection of CompactVenue records, and according to this page - https://developer.foursquare.com/docs/responses/venue - it should "sometimes" include the url of the venue's website.

However, with the search I've been doing (around Covent Garden in London) I can't find a SINGLE venue with a URL returned which I find highly unlikely, so am I using this wrong, or are URLs no longer included in compacted venue responses?

The URL I'm using is -

https://api.foursquare.com/v2/venues/explore?client_id=[id]&client_secret=[secret]&ll=51.513144,-0.124396&radius=2520&section=drinks&time=any&v=20150409&m=foursquare&limit=50&sortByDistance=1&offset=0

Thanks

Upvotes: 1

Views: 1134

Answers (1)

Psest328
Psest328

Reputation: 6675

I copied your url and you're right, there are no venue urls.

Solution: If you remove the "m=foursquare" or change it to "m=swarm", they show up.

As they state on their website, foursquare occasionally makes changes to their api. It looks like the venue URL has become part of the swarm specific api. (pasted info on mode, which is what 'm' stands for, a bottom of answer). I have been doing my searching WITHOUT an m param and have had no issues. I suggest removing the param for now and see how the api evolves in the future.

Mode info found at https://developer.foursquare.com/overview/versioning:

The m Parameter

This parameter is required only if your v parameter is >= 20140806 and accepts values of foursquare or swarm.

Since there is only a single API that powers both Swarm and Foursquare, sometimes it makes sense for the same endpoint to return different information in its response, depending on context. The m (for "mode") param gives developers control over whether they want Swarm- or Foursquare-style API responses—for example, the Users Detail endpoint might return information check-ins with m=swarm but information about a user's tips with m=foursquare.

Unless your application evolves significantly, it seems unlikely that you will ever have to change the m param values you pass in.

Upvotes: 1

Related Questions