I want to access followers of this page, but it is only showing this much of data

30 views Asked by At

I am trying to access the followers/likers of this page but it is showing only this much of data. How can i access all the info of this page.

category "Utilities" link "http://localhost/cricshots/" name "cricketshotsofficial" id "1996682000635998"

Trying to get the access using this code:

$json_url = 'https://graph.facebook.com/' . $facebook_page_id.'?access_token=' . $access_token ;

Expect the output to be the complete details of this page or only the followers of the page

1

There are 1 answers

5
Strange On

This is an updated and working code snippet which can be used to retrieve Facebook like count of a specific page. To use this code snippet you’ll need a Facebook App ID and Secret Key.

<?php
function fbLikeCount($id,$appid,$appsecret){  // $id = Fb Page id
  $json_url ='https://graph.facebook.com/'.$id.'?access_token='.$appid.'|'.$appsecret.'&fields=fan_count';
  $json = file_get_contents($json_url);
  $json_output = json_decode($json);
  //Extract the likes count from the JSON object
  if($json_output->fan_count){
    return $fan_count = $json_output->fan_count;
  }else{
    return 0;
  }
}
echo fbLikeCount('coregenie','___APPID___','___APPSECRET___');
?>

Please edit your page name, app id, app secret.