Search code examples
facebook-graph-apiinstagramsocial-networkinginstagram-graph-apisocial-media

How can I get engagement data over time for an Instagram business account user and media post (IG Graph API)?


I would like to know if there is a way to get engagement for a month (ex. get total engagement from current date minus 30 days) for an Instagram post in the Instagram Media Insights API or total engagement from a month from Instagram User Insights API.

As of now from the IG Media Insights, it seems you can only get cumulative engagement (see snippet below taken from IG Media Insights API:

{
  "data": [
    {
      "name": "impressions",
      "period": "lifetime",
      "values": [
        {
          "value": 264
        }
      ],
      "title": "Impressions",
      "description": "Total number of times the media object has been seen",
      "id": "17855590849148465/insights/impressions/lifetime"
    },
    {
      "name": "reach",
      "period": "lifetime",
      "values": [
        {
          "value": 103
        }
      ],
      "title": "Reach",
      "description": "Total number of unique accounts that have seen the media object",
      "id": "17855590849148465/insights/reach/lifetime"
    }
  ]
}

Thank you for your time :-)


Solution

  • For IG Media Insights you can only see lifetime metrics. If you wanted a monthly breakdown you would have to build a mechanism to query the lifetimes every month and calculate the delta to track monthly change.

    For IG Account Insights you can use metrics which offer days_28 period or use the since and until filtering.