Instagram insights Graph API
Version 14.0
Collection of function to retry Instagram media insights
Instagram Graph API
The Instagram Graph API allows Instagram Professionals — Businesses and Creators — to use your app to manage their presence on Instagram. The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.
The API is intended for Instagram Businesses and Creators who need insight into, and full control over, all of their social media interactions. If you are building an app for consumers or you only need to get an app user’s basic profile information, photos, and videos, consider the Instagram Basic Display API instead.
The API is built on the Facebook Graph API. If you are unfamiliar with the Facebook Graph API, please read our Facebook Graph API documentation to learn how it works before proceeding.
Overview
The Instagram Graph API is a collection of Facebook Graph API endpoints that allow apps to access data in Instagram Professional accounts (both Business and Creator accounts). If you are unfamiliar with the Facebook Graph API, please read our Graph API documentation before proceeding.
Base URL
All endpoints can be accessed via the graph.facebook.com host.
more info https://developers.facebook.com/docs/instagram-api/overview
Getting Started
more info https://developers.facebook.com/docs/instagram-api/getting-started
IG User Media
you can use this function to retry the list of all media
response
{
‘data’: [
{
‘id’: ‘183063567070311111’,
‘caption’: “Hello world !!!”,
‘is_comment_enabled’: True,
‘comments_count’: 0,
‘like_count’: 5,
‘media_type’: ‘IMAGE’,
‘media_url’: ‘https://scontent-lga3–1.cdninstagram.com/v/t51',
‘permalink’: ‘https://www.instagram.com/p/Cf6-fT0I4jHsds/'
}
}
more info
https://developers.facebook.com/docs/instagram-api/reference/ig-media
IG Media Insights
you can use this function to retry the insights for each post via media_id
response
{
‘data’: [
{
‘name’: ‘impressions’,
‘period’: ‘lifetime’,
‘values’: [
{
‘value’: 13
}
],
‘title’: ‘Impressions’,
‘description’: ‘Total number of times the media object has been seen’,
‘id’: ‘183063567072222/insights/impressions/lifetime’
},
{
‘name’: ‘engagement’,
‘period’: ‘lifetime’,
‘values’: [
{
‘value’: 5
}
],
‘title’: ‘Engagement’,
‘description’: ‘Total number of likes and comments on the media object’,
‘id’: ‘183063567072222/insights/engagement/lifetime’
},
{
‘name’: ‘reach’,
‘period’: ‘lifetime’,
‘values’: [
{
‘value’: 12
}
],
‘title’: ‘Reach’,
‘description’: ‘Total number of unique accounts that have seen the media object’,
‘id’: ‘183063567072222/insights/reach/lifetime’
},
{
‘name’: ‘saved’,
‘period’: ‘lifetime’,
‘values’: [
{
‘value’: 0
}
],
‘title’: ‘Saved’,
‘description’: ‘Total number of unique accounts that have saved the media object’,
‘id’: ‘183063567072222/insights/saved/lifetime’
}
]
}
more info
https://developers.facebook.com/docs/instagram-api/reference/ig-media/insights