How can I get checkins in a certain location on Foursquare? - foursquare

I guess the title is pretty self-explanatory. I want to get all the checkins in a certain area given the latitude and longitude.
All I've been able to find is https://developer.foursquare.com/docs/checkins/recent and https://developer.foursquare.com/docs/venues/venues, but neither of them are useful for me.
I'm pretty sure there has to be a way, but I can't find it.

Use this api and filter by "hereNow" count for each venue, this will give you count of people currently in that location
https://api.foursquare.com/v2/venues/search
more details here: https://developer.foursquare.com/docs/venues/search

Related

Can I get list of all categories that foursquare API could return to me?

Can I get list of all categories that foursquare could return to me ?
https://developer.foursquare.com/docs/responses/category.html (link to category object description)
I know that the new categories could be created, and some deleted. But I just would like to prepare my app to be able to handle some categories in special way, and I need to know in advance what they could be.
Thanks for time in advance.
This should include all possible Foursquare categories. It's this endpoint: https://developer.foursquare.com/docs/api/venues/categories
Foursquare also provides an up-to-date category hierarchy without using the API. Useful if you just want to take a look at the list without doing a call.
Interestingly on that page, they also provide "Supported Countries" where the category "can only appear on venues in those countries".
https://developer.foursquare.com/categorytree

What does the Foursquare venues/search return?

Does anyone know what the Foursquare venues/search return? Does it give the up-to-date Foursquare venues or all the venues ever created for an area? I read this page https://developer.foursquare.com/docs/venues/search but it was not that specific. It goes like: "Returns a list of venues near the current location, optionally matching a search term". Does anyone have more information about this?
In my experience, the search request doesn't distinguish user created places like "Joe Bob's House" from a business like "Starbucks." It returns all of the nearby places best matched to this particular user if the intent is to checkin, or all of the nearby places if the intent is to browse for "coffee," for example.
Does that answer your question?
You should take a closer look at the intent parameter on that page. You can specify the type of results you're looking for. Depending on your needs, you might also want to check out venues/explore

Sphinx "reverse" search

We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.

Feature request: Add search radius to the Suggestion Complete Venues api method

I'm integrating the suggestion complete venues search into my site. It's pulling back results from places that are way to far away from the city we want to search in. Can you add a search radius param to the api method?
A radius parameter is in fact available, though documentation for this parameter was missing. Thanks for pointing this out, documentation will be added.

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

Resources