Facebook – How to get fan page likes count using graph api

facebookfacebook-graph-api

How can I get fan page likes count using graph api? Earlier it was here:

https://graph.facebook.com/FANPAGE_ID/?access_token=ACCESS_TOKEN

but now it's return only:

{
   "name": "Fanpagename",
   "id": "0000000000"
}

Best Answer

For the graph api version 2.7, the term to get likes count is changed, Now you will have to write

https://graph.facebook.com/FANPAGE_ID?access_token=ACCESS_TOKEN&fields=name,fan_count

FANPAGE_ID can be the username or the page_id of any fb page. ACCESS_TOKEN must be replaced with access token.