Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get proper Facebook likes count for URL

I need to get proper count of likes per URL, identical with the count shown in Like button bubble, but all ways I tried returns wrong count, sample - in moment of writing some CNN article shows 117 likes with this code:

<div class="fb-like" data-send="false" data-layout="box_count" 
  data-width="90" data-show-faces="false" data-action="recommend" 
  href="http://www.cnn.com/2013/06/14/world/europe/london-underground-lego/index.html">
</div>

Anyway when querying for this via FQL it returns totally different result (only 34 likes):

https://graph.facebook.com/fql?q=SELECT like_count FROM link_stat WHERE url='http://www.cnn.com/2013/06/14/world/europe/london-underground-lego/index.html'

(Of course CNN sample is just a sample - I can not publish my real case now, however results are similar - in both cases counts doesn't match :/)

Question: is there some other absolutely sure way for fetching URL's likes via any Facebook API?

like image 391
biesior Avatar asked Jun 15 '13 21:06

biesior


People also ask

How to find Most popular Posts on Facebook Page?

Visit your Posts tab and scroll down to the All Posts Published list. Sort posts by Likes, Comments, and Shares to see the total engagement by type for each post. Visit your Posts tab and click on Top Posts From Pages You Watch.


1 Answers

The number shown inside the CNN article, which at this very moment is 131, represents the total amount of times that link was shared, liked, or commented on.

So, according to the reference, use the following FQL to get that number:

https://graph.facebook.com/fql?q=SELECT total_count FROM link_stat WHERE url='http://www.cnn.com/2013/06/14/world/europe/london-underground-lego/index.html'

like image 60
Cassio Avatar answered Oct 03 '22 05:10

Cassio