Instagram Media Insights
The Instagram Media Insights Connector provides automated access to Instagram Graph API .
Prerequisites
The Instagram Media Insights connector requires the following:
You will need access to satisfy all the requirements listed as part of the section “Before You Start” of the Instagram API Getting Started guide.
In the Key Manager you will need to add a key for Facebook System User authentication (see below) — note that OAuth credentials are not supported.
This system user must satisfy the following criteria:
- The system user should be assigned to the Facebook pages that are connected to the Instagram pages to fetch.
- The
pages_read_engagement
andpages_show_list
permissions must be assigned tp the system user needed or you will receive an empty array of data when asking for pages. - The
instagram_basic permission
is needed or you won’t be able to see theid
of the connected Instagram page to fetch the data. - The
instagram_manage_insights
permission is needed to fetch Instagram insights data or you will get a permissions error.
If the app user was granted a role on the Page via the Business Manager, you will also need one of:
- ads_management
- business_management.
Facebook System User Authentication
You will need to add a Key with the Credential Type Facebook System User
with the following properties.
- System User Name
- You with need a System Username on Business Manager
- Access Token
- You will need to generate a System User Token in the Graph API Explorer as described in the Facebook Developer documentation
Scheduling
The Instagram Media Insights connector can be scheduled to ingest data once per day at a user-defined hour and timezone.
By default, the connector will run once at 6am PT.
See Daily Scheduling for more information.
Parameters
- api_version string
- required
- version of the Facebook API
Sample Switchboard Script
Media Insights
Note that if the media was posted before business account conversion, media insights is not available for that specific media. And those metrics wont be in the result.
download bundle t {
type: "instagram:media_insights";
key: "facebook_system_user";
api_version: "v14.0" // required parameter
table users using {};
table carousel_albums using {};
table images using {};
table videos using {};
table reels using {};
table stories using {};
} using{*};
User Insights
download t from {
type: "instagram:user_insights";
key: "facebook_system_user";
api_version: "v14.0" // required parameter
} using{*};