foursquare

Foursquare API: how to explore venues within an administrative division such as ‘borough’


I am a beginner user of Foursquare API.

Most of the Foursquare techniques I learned so far is to do query such as search for or explore from a single location point (e.g. a café or a hotel) in a single geographical coordinate pair of longitude and latitude.

My question is, if it is possible to make an query to explore venues within an area, instead of in the vicinity of a single location point. By ‘an area’, I specifically mean the unit of the administrative division, such as a borough, of a neighbourhood.

In other words, my intending query, if possible, would start from an area specification of the administrative division of my interest (e.g. borough), such as its name or its border’s geographic coordinates—as a 'key' to link with Foursquare data, rather than start from a single location point.

I downloaded GeoJson file that already defined the geographical coordinates of the border of the administrative division of neighbourhoods in a city that I am interested in (link: http://cdn.buenosaires.gob.ar/datosabiertos/datasets/barrios/barrios.geojson). Just FYI, in this link, the neighbourhood is described as ‘barrio’ and the border is defined in the form of 'Polygon'.

I just wonder if I can use an area specification—either the name of an administrative division or a set of the geographic coordinates of an administrative division's border—as a key to make an query about venues such as restaurants, hospitals, and polices within the unit of an administrative division (e.g. borough) from corner to corner.

I guess that the underlying question is if Foursquare side has such info stored in somewhere in its system: if not, my contemplated approach would not work. Or there might be a totally different workaround to achieve my goal.

If anyone can advise me on this matter, I would highly appreciate it.

Thanks


Solution

  • Given the parameters listed in the docs I think that the best approach would be to use the ll or near parameters and also include a radius so you can limit the search for a given area or region.

    To get the middle point for the polygon I guess you would need to do some math but shouldn't be that difficult.

    Besides this I think there doesn't seem to be any other parameter in Foursquare API to search by area or by a coordinates array (polygon).

    Anyways, I would suggest that you go through the Foursquare API docs for both search and explore endpoints and check for yourself.