5

Given an authenticated user, can I find that user's liked posts on Facebook?

I've read about "stories" and "recent activities" but I can't seem to find out how to get this data for a specific user. Any help is appreciated!!

Thanks!!

Dante Cullari
  • 769
  • 13
  • 21
  • So I found some answers here: http://facebook.stackoverflow.com/questions/8496980/getting-user-likes-of-stream-items-via-fql-posts-comments-pictures-links-et and in the connecting pages, but I'm still not sure if any of them will really accomplish this..I'll keep this updated either way – Dante Cullari Jun 24 '12 at 03:00
  • anything work for you in teh end? – Steve Oct 07 '12 at 11:12
  • It's a cloudy issue..Facebook has started supporting different types of content, other than just fb pages, like Videos, which are logged when you like a youtube link. So support for this is getting better I think, but it still is not 100% reliable. On my app I was trying to get people to like videos and songs from soundcloud and youtube, and I wanted to see if they had actually liked those things on facebook. I ended up actually saving the likes on my site into my database and checking against that in the future, instead of relying on Facebook to "sometimes" return the right results. – Dante Cullari Oct 10 '12 at 20:52
  • UPDATE: As of v2.0 of the Facebook Graph API, there is a new endpoint category called Social Context API: "We've added a new endpoint to objects and apps that allow you to display a person's friend's actions on an object. For example, you might be able to answer the question "Which of my friends have watched this movie?" by looking at the /{movie-id}?fields=context endpoint. Or you could answer the question "Which of my friends play this game?" by looking at the /{game-app-id}?fields=context endpoint. The game app example is particularly useful for games that want to do cross-game promotions." – Dante Cullari Aug 07 '14 at 05:57
  • Still doesn't really address the issue head-on, but perhaps moving in the right direction - more info here on "context" here: https://developers.facebook.com/docs/facebook-login/social-context/v2.0 – Dante Cullari Aug 07 '14 at 05:58
  • 1
    this is the first post that google shows while searching for the problem. Has there been a solution to this, or is it still cloudy? Is there a filter where we can retreve all 'liked' photos/videos/articles (and so on..) – Zen Oct 05 '14 at 01:31
  • It seems from the lack of support that Facebook wants to avoid this kind of functionality, maybe because of fear of better 3rd-party aggregators or filters for the content on Facebook. Who knows, pretty odd though. Still no solution. – Dante Cullari Oct 19 '14 at 05:12
  • I believe they've finally started to make headway on this, at least from an Open-Graph perspective. Check out the new user_actions.{namespace} permissions: https://developers.facebook.com/docs/facebook-login/permissions/v2.2#reference-user_actions_music Also more on usage here: http://stackoverflow.com/questions/7540124/using-open-graph-api-can-i-see-when-users-add-to-playlist-or-star-tracks-in-spo – Dante Cullari Nov 14 '14 at 23:22
  • Also helpful regarding publishing Open-Graph actions: https://developers.facebook.com/docs/opengraph/guides/video.watches Just wish Facebook would use their own Open-Graph when people interact with these objects on their site. – Dante Cullari Nov 14 '14 at 23:43

1 Answers1

2

I hope it will be helpful. In official FB SDK with Graph Api v2.1 there is only one way (because fql is no longer available in 2.1) - for each post you should send request to https://graph.facebook.com/v2.1/{post-id}/likes. You can also use .../{post-id}/likes?limit=XXX. In response you will get an array of likes like this:

data": [
    {
      "id": "xxxxxxxx", 
      "name": "yyyyyy"
    }, 
    ....
]

Next you should try find there your user's id. If it here - user liked this post. If not - user not liked this post. This array also can contain paging data with link to next page with likes.

But here's one little problem - too much time if post contains thousands of likes. We asked Facebook about it recently and now we are waiting for an answer. It works good for posts with less than few thousands likes.

Eridana
  • 2,418
  • 23
  • 26
  • Awesome thanks! Doesn't exactly solve the problem unfortunately. Say I have a list of my friends. I'd love to see all the posts that my friends liked. Given just the ids of my friends, I couldn't create that list with the above method, unless I searched every post on Facebook. Still can't believe this isn't supported. Good tip though, thanks for your answer! – Dante Cullari Oct 19 '14 at 05:09
  • 1
    No problem! Yes, it seems, it isn't supported now. I'm sorry. Also FB said soon we couldn't read our feed because they will change permissions. [read_stream permission](https://developers.facebook.com/docs/facebook-login/permissions/v2.1#reference-read_stream) "The read_stream permission you use for getting the feed is only granted to apps building a Facebook-branded client on platforms where Facebook is not already available. For example, Android and iOS apps will not be approved for this permission. In addition, Web, Desktop and TV apps will not be granted this permission." – Eridana Oct 20 '14 at 04:28
  • Wow that is absolutely ridiculous! Thanks for letting me know! That pretty much makes a large portion of their existence useless now. I should be able to read my own stream from a 3rd-party if I want..that is sad. We should protest.. – Dante Cullari Oct 23 '14 at 23:18
  • Okay so not quite as bad as I thought. It looks as though [page-id]/feed is not affected by the read_stream permission redaction, which means you can still access page post level data. Definitely still a lot of usefullness in their api to that end, but would not want to see more closures like this in the future. – Dante Cullari Oct 24 '14 at 22:52