Graph API Version

Instagram Media Insights

This edge is for Instagram Ads and is part of the Marketing API.

Reading

Insights data

Graph API Explorer
GET /v2.10/{instagram-media-id}/insights HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{instagram-media-id}/insights'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{instagram-media-id}/insights",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{instagram-media-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:@"/{instagram-media-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
  • ads_management
  • instagram_basic
Page management Apps
No data
Other Apps
No data

Parameters

NameDescription
metric
list<enum {post_impressions, post_impressions_unique, story_viewed_impressions, story_viewed_impressions_unique, story_replies, story_navigation, shopping_product_click_count, shopping_outbound_click_count, tags_clicks_count, story_link_navigation, profile_views_from_impressions_count, follows_from_impressions_count, post_impressions_breakdowns, post_impressions_breakdowns_unique, post_impressions_breakdowns_unique_merged, post_actions_with_attribution_count}>

The list of metrics that needs to be fetched

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

The aggregation period

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

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.