How can I watch a Foursquare venue for check-ins? - api

The FourSquare API seems to be very user-centric: After logging in via OAuth I can see my friends check in, and which of my friends are currently checked into a given venue.
I'm looking for something more venue-centric, where I can get a list of everybody currently checked into a venue (friends and non-friends), or ideally receive a notification each time there is a new check-in at a specific venue. Is this possible with the existing V2 API?

I know you asked this 2 months ago and surely found an answer already but to answer your question directly.
where I can get a list of everybody currently checked into a venue
(friends and non-friends)
The FourSquare version 2 API has a venues endpoint
https://foursquare.com/dev/merchant/index_docs.html
A sample call will give you a stats field in the response
https://api.foursquare.com/v2/venues/5104
Stats:
Contains checkinsCount (total checkins ever here) and usersCount (total users who have ever checked in here).
for more venue information, FourSuare has a subset to the version 2 API called the venues project with more venue driven data you can update and mine through.
https://developer.foursquare.com/venues/index

You can check the venue checkins and mayors, comments, etc. Easily with the foursquare API, just check the API documentation for which calls can you make.
I wrote a handy article about how to connect to the foursquare api and make calls to it through PHP, you can find it here http://ryokuweil.wordpress.com/2011/08/29/how-to-use-the-foursquare-api-v2-with-oauth-and-php/

Authenticated calls /venues/herenow will return a list of people currently checked in. See https://developer.foursquare.com/docs/venues/herenow.html
To receive notifications when new users check-in to a venue, you need to have your application authorized by a manager of the foursquare venue, then enable your app (on foursquare.com/oauth) for the foursquare Venue Push API

Related

Using the Foursquare API, can one verify who verified a venue?

If users link their foursquare account to my site, via oauth2, when I pull a venue from the foursquare API would I be able to test if the current user is the same user who verified the venue (assuming the venue is verified)?
Or... is it possible to use the foursquare API to know who verified a venue?
I'm trying to build a service which venue owners/managers can use to help their business. However, I'll need a way to verify they are the owners/managers of the venue. I believe a very effective way to do this would be to force them to link their foursquare account, and then test if their account was the one that verified the venue.
If that's not possible, what's the standard way this is performed?
Instead of testing if a venue is managed by the current OAuth'd user, would it make more sense to get all of the venues that the current user manages? You can do that through our venues/managed endpoint.
Also in general, your approach of requiring the user to OAuth is correct and pretty standard for these style of apps. Our info on our merchant platform should be able to help you out.

Is there any way I can retrieve twitter user's email Id (Objective-c)?

https://dev.twitter.com/docs/faq#6718
If twitter doesn't provide any API, then how does foursquare retrieve them?
Foursquare has provision to list out the user's foursquare-friends who have registered with twitter.
It also provides API which shows friends of users who commonly appear in 'foursquare friend's list' as well as 'twitter followers list' of the user.
In both the above cases comparison can be made only through email.
Please help.
There's no way for you to get an e-mail from Twitter. Except, of course, by asking the person to give it.
What FourSquare does need no access to the e-mail. Matching is based on the Twitter name, not on the e-mail.
In the comments you say
My friend has registered in both Twitter and Foursquare. The only field common in her profile is the email id. No other fields match. She comes in the 2nd list which i have mentioned above.
but then you admit
After she has registered with FourSquare, went to her profile, clicked on friends -> Add Friends -> opted Twitter. She was asked to login to Twitter and thus she did it
This means that now FourSquare have access to her Twitter as well as your. Foursquare knows her Twitter id and your twitter id and can access Twitter (using Twitter API) to see who is following is following who. In other words when you say
The only field common in her profile is the email id. No other fields match.
You are wrong. Once she connected her FourSquare profile with her Twitter, all data that is accessible via Twitter API is in fact (at least potentially) part of her Foursquare profile.
But she needed to explicitly connect the two profiles (which she did when she opted to add friends to her Foursquare profile using Twitter).

Foursquare Checkins API

What are the informations from a user that are avaible, by default, for users that are not his "friend"s ?
Can i have the list of "checkins" from any Foursquare user only by making API requests ?
What kind of information about a user i can fetch, without having him as my friend (friend of the account used to perform the API requests) on foursquare ?
On linkedin, for example, i could fetch his Company, but if the user used to perform the API requests had this user as a friend, i could fetch the whole "company history" . Is there any restriction like this one on foursquare ?
Thanks in advance
You can try this out yourself at the API Explorer to see: https://developer.foursquare.com/docs/explore#req=users/1234
As you can see, even if you're not friends with this user, you can see their name, friends' names, contact info (Twitter/Facebook), and checkin counts, but not the actual checkins themselves. You will need to be friends with this user to see their checkin history.
Note that if you make this request without authentication (e.g., https://api.foursquare.com/v2/users/1234 with no oauth_token ) then you can't see any information about them.

using foursquare api v2 to get herenow of a venue

on the documentation page, https://developer.foursquare.com/overview/venues, it says that
The Venues Platform lets developers use foursquare as their location
layer. Applications can search our database and find information
including tips, photos, check-in counts, and here now. Searches can be
done near a point or through a whole city, and they can be restricted
to trending or recommended places. The platform offers all of this
without requiring end user authentication and is available at high
rate limits.
however, when i send request like:
https://api.foursquare.com/v2/venues/4ad7a112f964a520050d21e3/herenow?client_id=myclientid&client_secret=myclientsecret&v=20120119
i got this:
{"meta":{"code":200},"response":{"hereNow":{"count":16,"items":[]}}}
is there anything i need to do, such as register as a venue platform developer, to get the list of people who are here? thanks!
You cannot get the users information without authenticating [ :( ]
Check out the documentation at the herenow endpoint page.
Specifically the first line:
Provides a count of how many people are at a given venue. If the request is user authenticated, also returns a list of the users there, friends-first.

Question about twitter api

I want to create a simple Twitter application, but I have a problem. I want to show the user information about his followers, but this requires one API request to get a list of all user IDs following him, and then many additional API requests to get the user information corresponding to the user IDs that were just fetched. Is it possible to get user info for many followers in one request?
Use the Followers method:
http://api.twitter.com/1/statuses/followers.xml (Twitter API Documenation)
It returns detailed information about each follower.