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"
}
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.
You need to add the fields you want to get now:
https://graph.facebook.com/FANPAGE_ID?access_token=ACCESS_TOKEN&fields=name,likes
Serach for "Declarative Fields" in the changelog: https://developers.facebook.com/docs/apps/changelog#v2_4
Edit: Since v2.7 of the Graph API, "likes" has been renamed to "fan_count". More information: https://developers.facebook.com/docs/apps/changelog
The would be the new API call:
https://graph.facebook.com/FANPAGE_ID?access_token=ACCESS_TOKEN&fields=name,fan_count
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With