Facebook: How to get list of last friends checkins using graph API or FQL

2.1k Views Asked by At

The following Graph API gets the first checkin for each friend. How do you get the last checkin?

me/friends?fields=checkins.limit(1).fields(from,message,place.fields(id,name,location,likes,website,phone,description,checkins),tags)

Note that I can remove the limit but that is going to give me all the checkins which is not what I want.

2

There are 2 best solutions below

0
On

You can try use checkin api by FQL. I see only one way: use multi query in one request:

1) select post_id from checkin table from your friends (author_uid) order by timestamp (desc)

2) select page_id from location_post table, where posts from query (1)

3) get pages info from table page where page_id is set from (2)

As result, you get last checkins, but issue: this checkins don't grouped by friends. For example, you can get last (by date) checkins, that have one user.

0
On

I think this will be helpfull: https://stackoverflow.com/a/7743148/775109

A graph Api request for that is the following

https://graph.facebook.com/me/friends?access_token=yourToken
&fields=checkins.limit(1)&format=json&offset=0