Reputation: 329
I have been google searching and stack trolling for something like this but can't seem to find the right formula so I thought I would ask ....
What I'd like to do is use the Graph API rather then FQL - our application is running with php/graph api calls already, would like to keep it all together.
Here is the FQL :
SELECT url,
normalized_url, share_count, like_count, comment_count,
total_count,commentsbox_count, comments_fbid,
click_count FROM link_stat WHERE url='http://www.google.com'
Tried a bunch of different things, can't seem to translate it - I am going to assume that Link_stat doesn't exist in the graph api, as there is no doc's on it.
Figure if it was possible someone might have accomplished it.
Sample Of What I'd Like
https://graph.facebook.com/XXXXX/?ids=http:google.com ( somethin like that )
Upvotes: 0
Views: 3526
Reputation: 2006
I don't think it's possible to get like count from the graph api, you should use FQL link_stat table. FQL is not deprecated.
You can try using,
http://graph.facebook.com/?id=http://www.google.com
and it would return result,
{
"id": "http://www.google.com",
"shares": 7991103,
"comments": 807
}
EDIT
https://developers.facebook.com/docs/reference/fql/
On August 17, 2016, FQL will no longer be available and cannot be queried. To migrate your app, use the API Upgrade Tool to see the Graph API calls you can make instead.
https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url='http://www.google.com'
And this would return,
{
"data": [
{
"url": "http://www.google.com",
"normalized_url": "http://www.google.com/",
"share_count": 4989540,
"like_count": 1317162,
"comment_count": 1684401,
"total_count": 7991103,
"commentsbox_count": 807,
"comments_fbid": 396269740024,
"click_count": 265614
}
]
}
There is a REST API method for the same which is currently deprecated.
http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.google.com
Please Note:Facebook is deprecating the REST API https://developers.facebook.com/blog/post/616/ It would be better to choose Graph API/FQL methods.
Reference link :Retrieving facebook share count via api
Upvotes: 3