0

How can I get with foursquare API only user checkins from specific categories:

http://aboutfoursquare.com/foursquare-categories/parks-outdoors/

I only want users checkins on the beaches.

thx

kkatusic
  • 119
  • 1
  • 8

1 Answers1

3

Firstly, you can only access the check-in histories of people who have OAuthed your application. You can't just query foursquare for recent checkins.

Once a user has authorized your application, you can query the users/USER_ID/checkins endpoint to get their check-in history. You then can page through this history looking for check-ins into the categories you want.

For example, you can see all the fields of a check-in object here:

https://developer.foursquare.com/docs/responses/checkin

One of those fields is a 'venue' object, which looks like this:

venue-compact

As you can see it has a 'categories' list. So just check this list for the categories you want. Hope that helps

Matthew Rathbone
  • 8,144
  • 7
  • 49
  • 79
  • I know to do oAuth, but seems that categiries are defined only by their names. I must wirk around :( – kkatusic Apr 23 '12 at 23:29
  • I found on Foursquare where you can find all categories: [link](https://developer.foursquare.com/docs/venues/categories) and when you check e.g. last checkins perform operation that would eliminate checkins from categories you don't want. – kkatusic Apr 24 '12 at 13:35
  • Categories have id's as well as names. See here for the full list: https://developer.foursquare.com/docs/explore#req=venues/categories – Matthew Rathbone Apr 25 '12 at 19:50
  • Why this main categories that foursquare add has this long ID, do you know? – kkatusic Apr 26 '12 at 11:03