Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a site with a lot of pages that have a Facebook like button.

Is there a way to get all the pages that were liked with the number of likes?

share|improve this question
add comment

closed as off-topic by bybe Jul 9 '13 at 19:01

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on general programming problems are off-topic here, but can be asked on Stack Overflow." – bybe
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 1 down vote accepted

This question has been asked a few times on Stack Overflow and is best suited on their since it requires coding via Facebooks API, Thanks to Rink for pointing out the below information.

SOURCE: How to get number of likes from Facebook Button

There are two ways to get the number of facebook likes.

Graph API

http://graph.facebook.com/?ids=http%3a%2f%2ffacebook.com

Result is JSON: (For some reason 'likes' are called 'shares')

{
   "http://facebook.com": {
      "id": "http://facebook.com",
      "shares": 35641554,
      "comments": 339
   }
}
  1. FQL

    http://api.facebook.com/method/fql.query?query=select+total_count+from+link_stat+where+url="http://facebook.com"

Result:

<?xml version="1.0" encoding="UTF-8"?>
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true">
  <link_stat>
    <total_count>35641554</total_count>
  </link_stat>
</fql_query_response>
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.