Foursquare: Search for "Uncategorized" venues - api

I'm trying to research some data about foursquare usage in my city, for which I need to compile a list of all the venues. The most reasonable way seems to be, to poll for venues in a ne,sw area by category and splitting it up in smaller ones, if I get 50 venues per category (which is the response limit).
Thing is, there are some venues with the category set to "Uncategorized". E.g. https://foursquare.com/v/fonzi/4e20f6af45dd950bb020b1c1
How can I poll for those? Setting categoryId to Null, "" or "Uncategorized" didn't work.
I hope you can help :)
P.S. When doing a venues/search with intent: "browse", do you also get venues which are outside your limits, if the area is very small? It appears so to me, but I might be doing something wrong.

There's no way to filter your query to just uncategorized venues. Sorry!

Related

How to specify minimum checkins using Foursquare API?

I'm new to all this, but I was wanting to know how I can view popular Foursquare venues by using a longitude and latitude but also narrowing the search by specifying the exact amount of checkins at a place and also providing the radius.
I've figured out how to do some of the URL but don't know what to type exactly to specify the minimum amount of checkins.
"https://api.foursquare.com/v2/venues/search/?ll= 42.973423,-83.738894&radius=200"
That is what my URL is looking like, now I need help figuring out the last bit of information.
It's not possible to define a minimum number of checkins as a search parameter for the /v2/venues/search endpoint.
The response of /v2/venues/search request contains a stats field with a checkinsCount property. This would allow you to filter the results based on a checkinsCount threshold.

Sorting the response from the Foursquare Places API re:two word name?

We are trying to query the Foursquare api to query for a two word name:
Cava Grill in Gaithersburg, MD
We are trying this via:
https://api.foursquare.com/v2/venues/search?intent=checkin&query=cava%20grill&near=gaithersburg,%20md&limit=1&oauth_token=SEB14NBLGO4HMFTOXQX0JZTSVGM41ENNKE0X1RXHCI5XP3P5&v=20150420
(don't worry ... this is the public API key from the FS page)
Two odd behaviors:
Even though we are explicitly searching for the Cava Grill in Gaithersburg, MD ... the Bethesda, MD one comes up first in the results (odd, why??)
Chipotle Mexican Grill shows up in this result set ... we suppose because of the word "Grill"
So ...
a. anyone know why the Bethesda one would show up higher in the result set? (Should we just narrow the radius tighter?)
b. anyone know if we can look for the "entire query" vs. each word in the query?
Results are queried and sorted differently based on your intent. If you're looking for a specific venue, I suggest changing your intent from checkin to match. Browse may also be a good choice depending on future search params
Here's the nutshell on the intents:
intent=checkin returns a list of venues where the user is most likely is located
intent=browse returns a list of most relevant venues for a requested region, not biased by distance from a central point.
intent=match returns a single result that, with high confidence, is the corresponding foursquare venue for the query-based request
I hope this helps

Why does Foursquare search not return venues closest to my specified location?

I'm noticing something odd with foursquare search API. When I specify a latitude and longitude of a location in my city, I'm not getting venues that are closest to me.
For search parameters I'm using:
ll = 47.620918,-122.318455 (a neighborhood in Seattle, WA)
intent = browse
radius = 48 280 (approx 30 miles)
categoryId = 4d4b7105d754a06374d81259 (food), 4d4b7105d754a06376d81259 (nightlife)
venues/search?ll=47.620918,-122.318455&intent=browse&radius=42820&categoryId=4d4b7105d754a06374d81259,4d4b7105d754a06376d81259
I would expect this query to return me venues that are closest to the specified lat+long location and in the food or nightlife categories. This isn't what I'm seeing. Instead, the first venue in the array is a venue that is 768 meters away, the second is 2162 meters, the third is 722 meters.
There are food and nightlife venues that are much closer than 700 meters to that latitude and longitude.
One could argue that I should take the results and sort them myself based on the distance attribute but this seems flawed for 2 reasons:
If the venue list being returned isn't closest to my location, I'm missing out on a lot of venues since they couldn't all fit within the max limit of the query results. So even if I sorted based on distance attribute, I'm only sorting venues that shouldn't be considered nearby.
The reason I specify a lat+long to the search API is to have foursquare do the heavy lifting for me on what is "nearby". If I need to sort then what's the point? There's an argument to be made that foursquare shouldn't return venues that are more relevant to you, but this is why I'm using intent=browse instead of intent=checkin'
For intent=browse, the docs say:
Find venues within a given area. Unlike the checkin intent, browse searches an entire region instead of only finding Venues closest to a point.
what am I doing wrong such that I'm not getting the closest venues return to the specified lat+long?
Just like the docs say, when you use intent=browse, Foursquare doesn't "only [find] Venues closest to a point." When you use intent=browse with a ll/radius, imagine this as setting up a region and asking Foursquare for the "best" results from this region. It is not saying "find me the results starting at this ll growing until the radius."
In general, Foursquare search does not guarantee results in any particular order unless it's specified under the description for the intent, and unfortunately none of these specify that the results will be returned sorted by increasing radius.
I know this is a old thread, just wanted to let people know that you can use sortByDistance=1 as parameter to sort venues the closest to the location.

CategoryId in venues search not working correctly

In foursquare Api documentation for "Search venues" https://developer.foursquare.com/docs/venues/search it states
"categoryId - A comma separated list of categories to limit results to. This is an experimental feature and subject to change or may be unavailable. If you specify categoryId you may also specify a radius. If specifying a top-level category, all sub-categories will also match the query."
Realise its supposed to be experimental, but when I provide Food category i.e. 4d4b7105d754a06374d81259, it only returns a few local results, the rest are miles away. However if I execute same search on website sing Food category, it returns correctly lots of results, assuming its the last bit "If specifying a top-level category, all sub-categories will also match the query" is not working , i.e. its not searching sub-categories ?
Any fix work around for this ?
Thanks,
Neil Pepper
You're making a /venues/search request with its default intent of intent=checkin. This returns a filter on nearby results, heavily biased by distance since it's trying to guess where the user might be checking in.
Foursquare Explore uses the /venues/explore endpoint and attempts to return recommended results for a query. If you want to get the sorts of results you get in that tool, call /venues/explore?section=food

Foursquare Venue API & Number of Results

Is it possible to get more than 50 results from the Foursquare Venues API? (https://developer.foursquare.com/docs/venues/search.html)
The default limit is 50, but it does not make any mention of pagination or offset to get additional listings.
Please advise.
As answered here
The API docs here can help.
Foursquare searching is very closely linked to the location 'point' (the 'll' param on the query) that you provide. The simple answer is that to find more venues within a given area, you need to simply query again with a different location 'point' within that area.
Two queries, both at points close to one another:
https://api.foursquare.com/v2/venues/search?ll=40.700,-74.000&limit=50
https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50
will get you two different sets of venues (that may overlap, depending on how close the points are).
The default intent for the search method is 'checkin', which will return the 50 most popular locations closest to that point. If instead you want to look at all the venues within an area, you can use the 'browse' intent. This takes either a 'radius' parameter, in which case it returns venues inside a circle around the given point with the given radius, or it takes two coordinates representing the 'sw' and 'ne' corners of a rectangle. So, you could do:
https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50&intent=browse&radius=50
which will give you 50 venues within the 50m circle around that point. A smaller radius will reduce the number of venues returned. So, by varying the radius and the point at which you search (or the size and position of the rectangle described by the 'sw' and 'ne' parameters), you can get more venues returned.
Hope that helps.
For the record, Foursquare now offers a pagination parameter in their API request:
"offset - Used to page through results."
https://developer.foursquare.com/docs/venues/explore