As per Foursquare API documentation, I am trying to match a popular venue but it only seems to work when I change the intent away from "match".

https://api.foursquare.com/v2/venues/search?intent=match&limit=1&client_id=...&client_secret=...&v=20140203&near=new%20york%2C%20ny&query=bowery%20ballroom

(no results)

But if I change the intent to browse, it does work:

https://api.foursquare.com/v2/venues/search?intent=browse&limit=1&client_id=...&client_secret=...&v=20140203&near=new%20york%2C%20ny&query=bowery%20ballroom

(proper result)

I noticed that if I change my browse to use the ll, it does work:

https://api.foursquare.com/v2/venues/search?intent=match&limit=1&client_id=...&client_secret=...&v=20140203&ll=40.7202418%2C-73.9933523&query=bowery%20ballroom

(proper result)

I am looking for the proper way to get the venue for a particular venue name, city, and state. I bet this would work if NYC were small but that's not the case. That being said, there is only one Bowery Ballroom so finding it shouldn't be that hard!

The only option I've seen mentioned here is to not use intent=match - I will do that if I have too but I don't understand why this would be required if I know the exact city, state, venue name.

Thanks!

有帮助吗?

解决方案

Passing in intent=match makes the search very sensitive to the lat/lon that you supply. It's likely that using simply near=new%20york%2C%20ny geocodes to a lat/lon that's too far away from the intended result.

intent=match is generally suited for developers who have their own kind of venues database and want to harmonize against ours (e.g., "I know that Bowery Ballroom is at (x, y). I wonder what the venue ID for this on Foursquare is?")

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top