Using the Foursquare API, is there any way to determine how distant a user was from the venue he checked in at? The checkin
object returned doesn't have any indication what the user GPS coordinates were.

- 5,845
- 3
- 18
- 22
3 Answers
Foursquare purposefully does not expose a "cheat" bit or the user's device reported distance from a venue via the API. The vast vast majority of users of foursquare do not cheat and the majority of "irregularities" between a user's reported location and the venue's location are due to poor GPS accuracy or are because the user is making a "post-check-in" at a location they were at but forgot to check into earlier.
My advice for developers re: cheating is to either ignore it and/or detect it after-the-fact.
Ignore cheats: The cost/benefit ratio of trying to detect cheating is generally not worth it. Not only is it effort to build an effective system, but you will you frequently have false positives where you penalize legitimate usage, causing you to disenfranchise users trying to use the system as intended, through no fault of their own. If you remain worried, then you can design your system such that the user either gains little by cheating (they're only depriving themselves, or the reward is physical so they gain nothing) or will have social pressures against cheating (e.g. foursquare's friend-scoped leaderboard means that it's generally clear to friends if a user is blatantly cheating, nullifying any real benefit to the cheating user)
Detect cheats after the fact: You'll have better luck/precision detecting cheating post-fact when you can look at the whole of a user's activity, rather than trying to make a decision with each check-in. A use who cheats often should be fairly easy to detect with a periodic job using simple rules. A user that cheats once out of 100 check-ins will be harder to detect, but that's going to be true no matter what mechanisms you chose to adopt (and you're better off with an occasional false negative than an occasional false positive)

- 4,627
- 2
- 17
- 16
Perhaps.
From the API docs for the Checkin response object:
Checkin Response
location Optional If the type of this checkin is "shout" or "venueless", this field may be present and may contains a lat, lng pair and/or a name, providing unstructured information about the user's current location.

- 1
- 1

- 23
- 5
-
That doesn't work because you can have a checkin at a venue 1000 miles from here, and still get the location information. The JSON has no differences (as far as I can tell) between a location you were nearby and a location far away. – Marcelo Calbucci Apr 12 '12 at 00:30
I think that cannot be done for a normal checkin with the current API. ll
(latitude and longitude) is even not a required field for a checkin in the current API version.

- 754
- 4
- 8