Find if Foursquare venue mayor is currently at the venue - foursquare

I am looking for a way to know whether the Foursquare venue mayor is currently checked in. Several 4sq apps show whether the mayor is at the venue when you check i but I am not able to find how to do this using the 4sq API. Any help would be appreciated.

The venue aspect returns a hereNow block which lists all people who have publicly shared their location.
It also returns a mayor block, listing the ID of the current mayor.
This means that you can simply iterate through the hearNow list and see if the mayor shows up. Easy!

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

how to add new category to foursquare

I see that there is no very useful category in the foursquare category list provided by API.
This category is "Car services".
And what's more important for me in RU locale is that it should be "Автосервис" or "Станция технического обслуживания авто".
Now many venues are marked with the wrong category because of the absence of these categories.
For example, car service venues are marked as "Automotive Shops" or in Russian "Магазин автотоваров". This is completely the wrong meaning.
So the question is how can I request for the addition of a new category?
Unfortunately there's no way to add venue categories via the Foursquare API, but please feel free to reach out to Foursquare support directly with your feedback: http://support.foursquare.com/requests/new

searching venues by name only

i'm building a small application for searching on venues by it's name
i'm using the Foursquare API v2 . the venue search interface
https://developer.foursquare.com/docs/venues/search
the problem is you have to state the LL property or the near property
so queires that work now is search for macdonald's near chigaco
but what if i want to search for all venues with that keyword , without satisfying a place near it ?
You currently need to pass a location (ll or near) for venues/search -- foursquare does not support searching for venues without a geographical scope.
There is a highly experimental "global" intent for venues search, but it's not supported in any way.

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