Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

You can try with the following FQL queries or graph API requests for facebook pages,

Graph API

http://graph.facebook.com/nb4cinema

FQL

SELECT name,about,description, fan_count,talking_about_count FROM page WHERE username= 'stackoverflowpage'

In case of FQL tables: To read the page table you need no access_token to get public information, or information about public pages that are not demographically restricted. any valid access_token to get all information about a page that the current session user is able to see.

We have a test fan page. This has poor figures (<10 fans). Statistics are not available due to the lack of fans and likes on that page.

Allthough, conversocial spits out some statistics. They mixed fans and likes to some extent and so my impression is, that they simply parse the page code in order to get what you see.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top