Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

select date range to get insight of the page

I am using Graph API for getting insights of the page. For that I am using link like :

https://graph.facebook.com/MYPAGEID/insights/page_fans?access_token=MYACCESSTOKEN

This link gives me last three days of json object which is ok, but I want to specify date range in insights. I found end_date in documentation but not found start date.

Did any one know how I specify date range in this.

like image 716
Dharmendra Kumar Mistry Avatar asked Jun 01 '11 17:06

Dharmendra Kumar Mistry


People also ask

How do I find Page Insights?

Updated mobile browser experience. Tap in the top right of Facebook. Tap Pages, then go to your Page. Tap More at the top of your Page, then tap Insights.

How do you get insights on Instagram after 90 days?

On Instagram, you can view your account insights for any time period within the past 90 days. You can choose between the 4 preset timeframe options or select your own custom timeframe. To access account insights, go to your Instagram profile and tap the Insights button.

What is the range of data can you access in Page Insights?

Keep in mind that you can only access data in Page Insights for the last 2 years, and demographic data, such as age, gender and location, are available in Page Insights once there is data for 100 or more people. Pages categorized as a Community Page don't have Insights.

How do you set a date range in Google Analytics?

The date range selector is at the top right of every report except the Real-Time reports. Click the arrow next to the existing date range to open the controls. Select one of the following from the Date Range menu: Custom: Data for your custom date range.


1 Answers

You can use the since and until parameters. For example:

https://graph.facebook.com/MYPAGEID/insights/page_fans?since=2011-01-01&until=2011-05-05&access_token=MYACCESSTOKEN

The only limitation is that you the range you specify cannot include be longer than about 35 days, otherwise you'll get this exception:

OAuthException
(#604) The specified date range cannot exceed 3024000 seconds"

Also see FB's own description of this using these parameters here: http://developers.facebook.com/blog/post/478

like image 190
Zach Dennis Avatar answered Jan 03 '23 18:01

Zach Dennis