0

I need to make an PHP application where anybody can define a page name and get the public information of that page, specifically the followers count.

For example, Google's Facebook page (https://www.facebook.com/Google/) has 28.318.253 likes and 33.390.596 followers. How can I, programatically, get those numbers?

I want my final code to look something like this:

$page = "google";

// Some code logic, API calls or anything else

$likes = $pageData->likes_count;
$followers = $pageData->followers_count;

echo $likes; // Should output "28318253"
echo $followers; // Should output "33390596"
James Z
  • 12,209
  • 10
  • 24
  • 44
RBFraphael
  • 367
  • 1
  • 3
  • 13
  • https://stackoverflow.com/questions/14632000/graph-api-how-get-facebook-page-members-likes – soma Sep 24 '22 at 22:29
  • This question is a bit older (latest update dated from 2019), and is referencing Graph API v3. Today we have the Graph API v15 and A LOT OF THINGS has changed. BTW, I've tested the solutions mentioned in this post and no one has worked as expected. I need an updated help. – RBFraphael Sep 25 '22 at 13:20
  • You are right, a lot of things have changed. One of them is, that you don't just get access to data about public pages per se any more - you app would have to specifically apply for the feature [Page Public Metadata Access](https://developers.facebook.com/docs/features-reference/page-public-metadata-access). – CBroe Sep 26 '22 at 06:31
  • @CBroe I've read about that permission, but can't figure out how to test it before requesting an app review to apply. I've tried to send an app review with this, but since my app is under development, they recused my app review. I think this is weird because we need a finished app to apply to Facebook app review before finishing integrations within the app. – RBFraphael Sep 30 '22 at 12:55
  • Test your functionality with a page you have admin access to, and a page token. – CBroe Sep 30 '22 at 13:02

0 Answers0