Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Get Historical "Facebook Page Likes" Data via Graph API or FQL

Was wondering if anyone knows how to get the historical data for any Facebook Page.

For example, number of fans for RedBull fan page on a given day in the past or for a given period that ends today so that I can show fan development of any page over a given period.

I tried it with the graph API and FQL (insights) but no luck.

https://graph.facebook.com/{USERNAME}/insights?fields=likes&period('week')&end_time_date('2011-06-26') --> empty result

Pulling the data via FQL also returns no results, plus it seems without a read_insights permission nothing is possible for page data

I'd need this to be available with only a generic user access token. This data is publicly available anyway. Result should be somewhat like this: http://www.socialbakers.com/facebook-pages/australia/

like image 970
Georg Avatar asked Feb 23 '12 01:02

Georg


People also ask

How do I get Facebook Page Insights on graph API?

You can access Page Insights by typing /insights after the name of your page in the URL field. This command will retrieve all of the Insights associated with your Page. Type "/insights" after your company name. Click the Submit button.

How do I find my like history on Facebook?

Visit your Likes tab and scroll down to your Where Your Page Likes Happened graph. This graph shows you where people liked your page. You can pick and day or select a date range to see the exact likes by location. Visit your Posts tab and scroll down to your All Posts Published list.

How do I use Facebook Graph API and extract data?

To use the Graph API Explorer tool, go to developers.facebook.com/tools/explorer. Generate the access token you need to extract data from the Facebook Graph API by selecting Get User Access Token from the App Token drop-down menu under the name of your app.

How do I pull data from Facebook?

If you want to download a copy of your information from Facebook, you can use the Download Your Information tool. Tap in the top right of Facebook. Scroll down and tap Settings. Scroll down to Your Facebook Information and tap Download Your Information.


1 Answers

https://graph.facebook.com/{{pagename}}/insights/page_views?access_token={{access_token_key}}&since=1420070400&until=1421625600

Since & until parameter in the above code takes in unix time. add necessary information in the {{ }} and this code should work.

like image 122
Pawan Kumar Avatar answered Jun 01 '23 04:06

Pawan Kumar