I\'m trying to get ALL of a user\'s likes with FQL. Following is my research including what I\'ve tried and the problems with each attempt.
1) The most simple method
Sorry, you cannot pull all of the likes of a person using the /likes
endpoint. We limit it to anything that has a FB page, which is any open graph object, sans articles. For example, if you like an open graph object that has an og:type
of article
, we don't return that in the graph api likes
endpoint.
Try this FQL query:
SELECT user_id, object_id, post_id, object_type
FROM like
WHERE user_id = me()
I've been able to use FQL to get at some, but not all, of the stream likes. See: http://facebook.stackoverflow.com/questions/8496980/fql-like-table-not-returning-any-results
The queries I've got are:
1) Gives me stream items I've liked on page feeds:
SELECT post_id, source_id, message
FROM stream
WHERE source_id
IN (SELECT target_id FROM connection WHERE source_id=me() and is_following=1)
AND likes.user_likes=1
LIMIT 10
2) Gives me stream items I've liked from my feed that I myself posted:
SELECT post_id, source_id, message
FROM stream
WHERE source_id=me()
AND likes.user_likes=1
LIMIT 10
What's annoying is I cannot get user likes from stream items for Event stream items, Friend stream item, Group stream items, etc. Even though I have every permissions accepted for that user. It's not like I'm asking for secret information. As a matter of course, the user can like and remove likes of stream items via my app. It's just that I cannot query a complete list of the current stream items that have been liked by the user.