I'm trying to figure out how to get the total number of comments, posts, likes and fans for any given Facebook fan page and date range using the Facebook API's. I need to be able to do this without the user having to log into Facebook to give the app permissions. This does seem to be possible, as this site is able to do it https://app.conversocial.com/profiler/ .But I don't know how they are doing it.
I've looked into the 'insights' fql table, but this always seems to return empty results. And I've also looked into the 'link_stats' fql table but this doesn't allow a date range to be set.
Does anyone have any idea on how to do this?
Tap in the top right of Facebook. Tap Pages, then go to your Page. Tap Insights at the top of your Page. To see more insights or to export insights, log into Facebook from a computer.
To find the Pages to Watch feature, go Insights and click on Overview. Scroll down the page to the Add Pages section (it's just below the Your 5 Most Recent Posts box). Facebook Pages to Watch monitors other pages' content.
Using the menu in the upper left, navigate to “Business Settings”. From the “People and Assets” menu, select “Pages”. Select the Page that you want access to and click on the “Add People” button. Add yourself with at least the “Page analyst” Role in order to have access to Page Insights for that Page.
You are right. What they are doing is not possible by using the normal Graph API or/and the FQL.
However, Facebook also provides support for two other APIs:
Access to these APIs is restricted to a limited set of media publishers and usage requires prior approval by Facebook.
I think that they are using the Public Feed API. The documentation of the Public Feed API lists some of the publishers that have been using this API and the site you've mentioned in the question is not in the list. The documentation also doesn't mention anything about getting the Page Insights, but I think it might support this feature (as I see no other way of doing it).
Or, they might be using any other such restricted API which is not yet available to the public and not even documented on the developers website, but is currently in beta/testing phase.
To get the number of fans and the talkabout count, just query the appropriate Open graph ID for the relevant page. For example, for Coca Cola (https://www.facebook.com/cocacola) this is done via
https://graph.facebook.com/40796308305
To get all public infos (Posts etc) use the following request
https://graph.facebook.com/40796308305/feed?access_token={ACCESS_TOKEN}
where {ACCESS_TOKEN} can either be an App Access Token or a personal one. Consider that you can only see public entries.
The ability to query the date ranges is not provided via Facebook ad far as I know. I guess the https://app.conversocial.com/profiler/ application queries each page that is in its index once a day, and saves the results. That's how they're able to provide historical data.
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