Graph API Version

Page Insights

Insights Edge for a Facebook Page.

Global brand default Page returns its own insights data, while root Pages return integrated insights of the whole hierarchy of Pages.

Reading

This Page's Insights data. Global brand default Page will return its own insights data, while root Page will return integrated insights of the whole hierarchy.

Graph API Explorer
GET /v2.8/{page-id}/insights HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{page-id}/insights'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/insights",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/insights",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/insights"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • read_insights
Page management Apps
  • read_page_mailboxes
  • read_insights
  • manage_pages
  • publish_pages
  • pages_show_list
  • pages_manage_cta
  • pages_manage_instant_articles
  • pages_messaging
  • pages_messaging_phone_number
  • pages_messaging_subscriptions
Other Apps
Permissions are not usually requested.

Parameters

NameDescription
metric
list<A valid metric for an insights endpoint>

The list of metrics that needs to be fetched

period
enum{day, week, days_28, month, lifetime}

The aggregation period

since
datetime

Lower bound of the time range to consider

until
datetime

Upper bound of the time range to consider

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of InsightsResult nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
100Invalid parameter
3001Invalid query
190Invalid OAuth 2.0 Access Token

Creating

You can't perform this operation on this endpoint.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.