N8N Tools - Instagram Enhanced
Actions8
Overview
The "Get Media Insights" operation of the Instagram Enhanced node retrieves analytical metrics for a specific Instagram media item (such as a photo, video, or carousel post). This operation is useful for social media managers, marketers, and content creators who want to measure the performance and engagement of their Instagram posts. By obtaining insights like impressions, reach, engagement, saves, video views, likes, comments, and shares, users can better understand audience interaction and optimize future content strategies.
Practical examples:
- A marketer wants to track how many people viewed and engaged with a recent promotional video.
- A content creator analyzes which posts have the highest saves and shares to tailor future content.
- A social media analyst gathers data on multiple posts to report on overall campaign effectiveness.
Properties
| Name | Meaning |
|---|---|
| Media ID | The unique identifier of the Instagram media item for which insights are requested. |
| Metrics | The list of insight metrics to retrieve. Options include: |
| - impressions: Total number of times the media was shown | |
| - reach: Number of unique accounts that saw the media | |
| - engagement: Total interactions (likes, comments, shares) | |
| - saved: Number of times the media was saved by users | |
| - video_views: Number of video views (for video media types) | |
| - likes: Number of likes | |
| - comments: Number of comments | |
| - shares: Number of times the media was shared |
Output
The output JSON contains the requested insight metrics for the specified media item. Each metric corresponds to a key-value pair where the key is the metric name and the value is the metric's count or measurement.
Example output structure (simplified):
{
"impressions": 1234,
"reach": 1000,
"engagement": 150,
"saved": 20,
"video_views": 500,
"likes": 120,
"comments": 30,
"shares": 10
}
If binary data were involved (not applicable here), it would typically represent media files or attachments, but this operation only returns JSON insight data.
Dependencies
- Requires an active Instagram Graph API connection authenticated via OAuth2 or API key credentials configured in n8n.
- Uses an external validation call to a third-party API service ("N8N Tools API") to verify subscription and API key validity before executing operations.
- The node depends on internal helper classes that wrap Instagram API endpoints for media and insights management.
Troubleshooting
Invalid subscription or API key error:
If the node throws an error indicating invalid subscription or API key, verify that your API credentials are correctly set up and active. Check the API key and OAuth tokens in n8n credentials.Media ID not found or invalid:
Ensure the provided Media ID exists and belongs to the authenticated Instagram account. Invalid or mistyped IDs will cause errors.Insufficient permissions:
The Instagram account must have the necessary permissions to access media insights. Make sure the connected Instagram Business or Creator account has granted required scopes.Rate limiting or API errors:
Instagram Graph API enforces rate limits. If you encounter rate limit errors, consider reducing request frequency or batching requests.
Links and References
- Instagram Graph API - Media Insights
- Instagram Graph API - Media Node
- n8n Documentation - Creating Custom Nodes
- N8N Tools API Documentation (for subscription and API key management)