Search code examples
foursquare

Foursquare API Venues.search() "categoryId" parameter issue with "near" param vs "ll" param


With Foursquare's API Endpoint Venues.search:

If the categoryId parameter is coupled with the ll parameter, it returns the expected response; filtered venues by category.

However, if I use categoryId parameter with the near parameter, the response does not have the venues filtered.

Sample:

Request with llreturns filtered venues by categoryId.

Request with near returns non-filtered venues by categoryId.

Thoughts?


Solution

  • The issue here is secondary category matching. The results look like they're not filtered correctly because the response from search only shows the primary category. The venues actually match on a secondary category, which you can see by looking at the venue detail response.