0

I have Page Id "252079588308065" in facebook. I just want to get the number of likes of this page using graph API or FQL.

Is it possible to get number of likes count of a particular page.

Please provide me a solution

Omega
  • 133
  • 1
  • 14
  • Maybe this is duplicate to [this one](http://stackoverflow.com/questions/9728279/getting-the-facebook-like-share-count-for-a-given-url) – ekostadinov Aug 20 '14 at 10:03
  • Or [this one too](http://stackoverflow.com/questions/12147642/how-to-count-likes-on-fb-page) – ekostadinov Aug 20 '14 at 10:09

1 Answers1

0

Here is a way of getting the like count using Graph API.

<?php
//The following code returns the Number of likes for any facebook page.

//Page Id of TechRecite.com. Replace it with your page.
$page_id = "138564926335348"; 
$likes = 0; //Initialize the count

//Construct a Facebook URL
$json_url ='https://graph.facebook.com/'.$page_id.'';
$json = file_get_contents($json_url);
$json_output = json_decode($json);

//Extract the likes count from the JSON object
if($json_output->likes){
    $likes = $json_output->likes;
}
//Printing the count
echo 'TechRecite.com has '.$likes.' Facebook Fans';
?>

Source: http://www.techrecite.com/get-facebook-likes-count-of-a-page-using-graph-api/

Mathias_
  • 323
  • 1
  • 4
  • 14