I wonder if anyone knows or has a tool which allows to extract the list of users IDs who liked or commented a Facebook post (especially a page post).
I've tried many softwares that claim performing this task in vain...
If you have a miracle, please share the love. I'd be glad to have either a software name, a java script, or anything that can do so.
Thank you all.
Would you mind telling what are you going to do with this?
Answer
263907926200 is the sample post id used
Through browser
https://graph.facebook.com/263907926200/comments
https://graph.facebook.com/263907926200/likes
Through API Explorer
->/v2.2/263907926200/comments
->/v2.2/263907926200/likes
FQL Method if you have an old app
Likes
https://graph.facebook.com/fql?q=SELECT user_id FROM like WHERE post_id = "xxxxx_xxxxx"
Comments
https://graph.facebook.com/fql?q=SELECT fromid FROM comment WHERE post_id ="xxxxx_xxxxx"
Related
I am trying to query the FB graph API for all of my posts. I would like the result set to only feature items that I've posted on my timeline. Not other users, and not my likes or comments.
The documentation is extremely confusing and most of the knowledge I've gained is through trial and error. To date, the only proposed solutions to this I've found online require the use of FQL (such as in this similar question: Facebook graph api- how to get user feed,with out posts about likes and comment by the user?) however the FB documentation states that FQL is deprecated and will not be supported in the future so I would like to avoid it. Additionally this is currently structured as a url request and if at all possible, I would like to keep it so.
To date, I've tried:
/[userid]?fields=posts.limit(100).fields( picture, link, created_time, from, message, description, object_id )
which will get me all of my posts with the data fields I require, but it also includes "Likes" and when I "Comment" anywhere - which I don't want.
/[userid]?fields=feed.limit(100).fields( picture, link, created_time, from, message, description, object_id )
which returns only posts - but also includes posts made by others on my timeline (and I don't want those either).
It seems unclear to me if there is any more robust way to work with these different feed types as documented:
https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/
Can anyone tell if there is a way to either limit the "feed" edge to only my posts (not including others posting to my timeline) or filter the "posts" edge to remove the "likes" and "comments"?
Instaead of /feed, you can use /posts.
More info here:
https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed
It's not possible as far as I know to generally apply filters to the Graph API calls, except very little exceptions.
/user/feed is an example (https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed/#read), where you can specify either with=location or filter={stream_filter}.
{stream_filter} in this case is a result of the filter_key field of the following FQL query:
select filter_key, name from stream_filter where uid=me()
Maybe you can try
GET /me/feed?filter=app_2915120374
which should give you the status updates.
I need a way to learn if a user had shared a post (link, video, photo etc.) which is published by a Facebook page. I have the object_id and link of the post, and user_id of the user considered. Is there a Graph API or FQL (or something else) solution to ask Facebook if the user re-shared the post or not? Or is it possible to get a list people who shared the post? So, I can extract my answer from this list.
Note that I know it is possible to find the answer by crawling the user's wall feed. But it is time consuming and I need a more efficient way.
Thanks in advance.
You can use the following FQL to get the data you're looking for.
SELECT via_id, created_time, owner_comment
FROM link
WHERE owner = me()
You can then compare via_id against the posts author (page ID) to determine if this share came from the page in question.
Unfortunately, there seems to be a bug with the data return where some of the via_ids come back as 0. There is a ticket in with Facebook which, at the time of this post, has been open for three weeks at medium priority. I have no idea if this issue is specific to my app or affects everyone, but that's the query to get what you want.
I've been scouring the docs for a while now and can't seem to find a way to accomplish this. The information is available publicly (on a facebook page ... the link says "View all # shares") but I can't seem to find a way to access this info either via FQL or the graph API.
I know I can get a list of likes for a given post:
https://graph.facebook.com/87236249496_134765166623967/likes
The goal is to get a list of people who've shared -- but there doesn't seem to be the same sort of thing for shares. Am I missing something?
You can do it via "graph.facebook.com/OBJECT_ID/sharedposts" connection:
I figure it out this connection via metadata=1 parameter:
Go to... http://www.facebook.com/ajax/shares/view/?target_fbid=10154612868272801&__a=1
10154612868272801 is Facebook story ID, __a stands for asynchronous.
You will see large amount of text/JSON, it is basically HTML & JS for little popup window. There is portion of text like hovercard.php?id=# where # is Facebook user ID, using preg_match_all you then get all of the user ID's who shared that post.
Eg: 100000541151971 (Eric) and 9204448 (Courtney)...
Unfortunately, you must be logged into Facebook to do first step, figure it out :)
I think you can get the share_count from stream table by FQL query just like
SELECT type, source_id, share_count, permalink, description, post_id, actor_id, target_id, message , share_count
FROM stream
WHERE filter_key = 'others' and post_id = '87236249496_134765166623967'
you can test it https://developers.facebook.com/tools/explorer/
Note: you have to take the read_stream permissions as explained here
Tye this link: https://graph.facebook.com/134765166623967/sharedposts (with a valid access_token)
The id in the link is the wallpost id (87236249496_134765166623967) minus the page id (87236249496) and minus the underscore.
You'll also need the read_stream permission
I know you're looking to get at shares through the post_id, but can you settle for finding shares by page_id instead of post_id?
If you can, then you can use the following FQL to get the data you're looking for.
SELECT via_id, created_time, owner_comment
FROM link
WHERE owner = me()
You can then compare via_id against the posts author (page ID) to determine if this share came from the post author in question.
Unfortunately, there seems to be a bug with the data return where some of the via_ids come back as 0. There is a ticket in with Facebook which, at the time of this post, has been open for three weeks at medium priority. I have no idea if this issue is specific to my app or affects everyone, but that query might get you what you want.
I am trying to execute following FQL and the result is always an empty XML
https://api.facebook.com/method/fql.query?query=SELECT post_id, comments.count FROM stream where post_id = 167995709886177
<fql_query_response list="true"/>
This is the post and it has lot of comments and LIKEs
http://www.facebook.com/ryanleslie/posts/167995709886177
Please help
#Anz just go through facebook developer section. all your doubt solve their
You need to use a URL like this:
https://graph.facebook.com/100002725117360_142921995808637?access_token=154407880175|16a3d55d6e4be468d6a131bc.1-100002735407608|IhahmvIUsur7GuZ45rxRj3boXtE
The bolded id (100002725117360_142921995808637) is the ID of the post. The part before the underscore is the user id of the person on whose wall the post appears, and the part after is probably the ID you are using in the example.
This will give you everything you need -- comments, likes, etc. If you want even narrower info, you can do that with URLs like this:
https://graph.facebook.com/100002725117360_142921995808637/likes?access_token=154407880175|16a3d55d6e4be468d6a131bc.1-100002735407608|IhahmvIUsur7GuZ45rxRj3boXtE
Note: this is a test user account, so I'm not exposing anyone's private info here.
Using the Facebook API with the FQL language, how can I get a list of the users that liked a given URL? I got the URL and want to query Facebook to see how many people and what users liked that URL.
Using PHP or ASP.Net... doesn't matter, just want to know how to write the FQL query.
Sadly this data isn't available. What's possible via the Link Graph API objects and the link FQL table is just retrieving a given instance in which a link was shared by a user. You can get the count of likes on a user's posting of a link, but this likely isn't what you want.
Discussed this 3-6 months ago with guys at Facebook, and the consensus then was also that getting this data via API is impossible. As far as I know things haven't changed, and there are some privacy arguments for keeping this data out of the API.
'SELECT user_id FROM like WHERE object_id IN (SELECT link_id from link WHERE url = 'YOUR URL HERE' AND owner = 'YOUR USER ID HERE' '
Like FQL Table
Link FQL table
In order to access user's likes, the application needs to have user_likes permission from the user. After that if you access http://graph.facebook.com/me/likes with appropriate access tokens, all the object IDs (including external websites), the current user has liked will be listed.
(this is in reply to bounty question, which seems a bit different from the original question asked on this page)
It's not using FQL but...you can see the most recent 500 users that have like your page by going to: https://www.facebook.com/browse/?type=page_fans&page_id={id} but you would have to scrape this to get the information and it won't work for more people besides the most recent 500. Here's the gotcha, you've gotta be an admin of the page_id to see it.
You can only get the fans of pages that you are an administrator for. So you have to provide an access token with your request associated with an admin account of the page you are trying to get the fans.
Facebook's FQL documentation here: https://developers.facebook.com/docs/reference/fql/page/ tells you how to do it. Run the example SELECT name, fan_count FROM page WHERE page_id = 19292868552 and replace the page_id number with your page's id number and it will return the page name and the fan count.