Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the most popular Foursquare venue in each category in a given city?

Tags:

foursquare

According to Foursquare API, Venues/Explore returns a list of recommended venues near the current location, Venues/Search returns a list of venues near the current location, optionally matching the search term. So in both cases, the return-list is the collection of venues near the current location. Not the global collection for a given city. In this case, how does 'Plan my next trip' find the most suitable place for each category in a given city? Thanks!

like image 407
Arman Avatar asked Nov 26 '25 01:11

Arman


1 Answers

You can send a geocodable string (such as the city name) as the near parameter in the Search API, leaving the ll (lat/long) parameter empty. This will search in the entire city and not rank results by distance to a specific point.

From the docs:

near    Chicago, IL

required unless ll is provided. A string naming a place in the world. If the near string is not geocodable, returns a failed_geocode error. Otherwise, searches within the bounds of the geocode. Adds a geocode object to the response. (Required for query searches)

like image 153
agentofuser Avatar answered Nov 28 '25 17:11

agentofuser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!