8

Is it possible to retrieve all the posts, user ever 'liked'?

FQL? API? I could not find a way. FB gurus out there, your help would be appreciated.

ohnoes
  • 5,542
  • 6
  • 34
  • 32

3 Answers3

2

Use the Stream.get API call.

If you specify only one user ID in the source_ids array, you can return the last 50 posts from that user's profile stream (Mini-Feed) for the last 180 days. If you specify more than one user ID in the source_ids array, you can return posts in those streams only from the last 9 days.

You can make FQL calls to retrieve likes from the stream table:

SELECT likes FROM stream WHERE source_id = [user_id] 

This will return the user's likes for the last 180 days.

Pierre-Antoine LaFayette
  • 24,222
  • 8
  • 54
  • 58
  • Thanks, but that doesn't answer my question. I want it *all* ;-) – ohnoes Aug 26 '09 at 07:42
  • SELECT post_id, likes FROM stream WHERE source_id = [userid] and likes.user_likes = 1 – Jon Davis Jan 12 '10 at 22:59
  • Seems like the new link to stream.get is http://developers.facebook.com/docs/reference/rest/stream.get/ – qasimzee Aug 10 '11 at 04:09
  • If people are wondering why it only returns 5 results, then remember to add a limit parameter, like "LIMIT 100" to the end of the query. Otherwise it will limit to 5. Like this: `SELECT likes FROM stream WHERE source_id = '1234-your-fb-id' LIMIT 100` – FooBar Dec 29 '13 at 15:55
1

I was trying to find out the videos (Youtube and Howcast) that either I liked or posted or shared. Here is the FQL, see if it can be useful to someone:

fql?q=SELECT post_id, actor_id, target_id, message, attachment, permalink, likes
      FROM stream
      WHERE filter_key in ('other', 'owner')
        AND is_hidden = 0 AND (attachment.caption = 'www.youtube.com'
        oR attachment.caption = 'www.howcast.com' )
Sicco
  • 6,167
  • 5
  • 45
  • 61
Yogesh G
  • 11
  • 1
0

The Graph API makes this easy now:

https://graph.facebook.com/[fbid]/likes

MZamkow
  • 305
  • 1
  • 2
  • 6
  • 3
    this does not include liked stream postst or like button clicks. only stuff user is a "fan of" meaning liked facebook pages. – The Surrican May 10 '11 at 10:12
  • 1
    I was trying to do the same thing... what ive found is that the likes are stored by objects and no for users... so the object has an array of people who likes that object, but u dont have access to that table (which has the object_id, user_is). it's stupid that you cant get a simple count of likes – Guido Zanon Feb 07 '12 at 06:13