Search code examples
foursquare

How to get multiple sub-categories when using Foursquare Venue Search API?


I seem to be having trouble doing an API call for two separate sub-categories in a single API call via venues/search. The two sub-categories are Grocery and Health Food Stores.

https://api.foursquare.com/v2/venues/search?ll=43.250021,-79.866091&radius=25000&intent=browse&categoryId=4bf58dd8d48988d118951735,50aa9e744b90af0d42d5de0e

If I do this search, only Grocery will show up. Same if I try with Farmer's Markets or Gluten-Free restaurants. What am I doing wrong, or is there a glitch in the API?


Solution

  • I just tested this and it appears to work with multiple categories. It's possible that this is because Health Food Stores, Farmer's Markets, and Gluten-Free restaurants are all uncommon categories, and grocery stores are very common, so they are crowding out the results because of your large search radius. You can try

    • decreasing the radius
    • making separate requests for each category