Reputation: 1822
I have Facebook like button on my website, created as following:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2fexample.com&layout=button_count&show_faces=false&width=110&action=like&colorscheme=light&height=35"
scrolling="no" frameborder="0"
allowTransparency="true">
</iframe>
Like count at the moment is displayed as 1,5 k
. I would like to get exact number of likes.
I have tried to query http://graph.facebook.com/?id=http%3A%2F%2Fexample.com
, but response I am getting is:
{
"id": "http://example.com",
"shares": 349
}
I have also tried to use FQL:
http://graph.facebook.com/fql?q=SELECT
like_count,total_count,click_count,commentsbox_count
FROM link_stat
WHERE url='http%3A%2F%2Fexample.com'
And response is:
{
"data": [
{
"like_count": 251,
"total_count": 349,
"click_count": 0,
"commentsbox_count": 0
}
]
}
How can I get exact count number?
Upvotes: 2
Views: 2285
Reputation: 6607
The exact like count is the total_count you see there. For some reason Facebook counts comments and shares as a like with its like button.
Don't forget that http://example.com is different than https://example.com and http://www.example.com/ Make sure you add up all those aliasses.
Upvotes: 1