Instagram API Engagement — Get Metrics Programmatically (2026)
How to get Instagram engagement data via the Graph API. Endpoints, rate limits, and code examples for likes, comments, reach, and impressions.
Published April 16, 2026
The Instagram Graph API provides programmatic access to engagement metrics: likes, comments, shares, saves, reach, impressions, and follower demographics. Here is how to use the API to pull engagement data for your Instagram Business or Creator account.
Available Engagement Metrics
The Instagram Graph API exposes engagement data through two main endpoint groups:
Media Insights (Per-Post Metrics)
Request: GET /{media-id}/insights
| Metric | Description | Available For |
|---|---|---|
| impressions | Total times the media was displayed | Posts, Reels, Stories |
| reach | Unique accounts that saw the media | Posts, Reels, Stories |
| engagement | Total likes + comments + saves + shares | Posts, Reels |
| likes | Total likes (called "total_interactions" for some media types) | Posts, Reels |
| comments | Total comments | Posts, Reels |
| saved | Times the media was saved | Posts, Reels |
| shares | Times the media was shared | Reels |
| plays | Total video plays | Reels, Videos |
| video_views | Total video views (3+ seconds) | Stories, Videos |
Account Insights (Profile-Level Metrics)
Request: GET /{user-id}/insights
| Metric | Description | Period |
|---|---|---|
| impressions | Total times content was displayed | day, week, days_28 |
| reach | Unique accounts that saw any content | day, week, days_28 |
| follower_count | Total followers (delta available) | day |
| profile_views | Profile page visits | day |
| website_clicks | Clicks on website link in bio | day |
| email_contacts | Clicks on email button | day |
| get_directions_clicks | Clicks on directions button | day |
| online_followers | Followers online by hour | lifetime |
| audience_city | Top cities of followers | lifetime |
| audience_country | Top countries of followers | lifetime |
| audience_gender_age | Gender and age distribution | lifetime |
Code Example (Node.js)
const accessToken = 'YOUR_ACCESS_TOKEN'
const userId = 'YOUR_IG_USER_ID'
// Get account-level insights for the last 28 days
async function getAccountInsights() {
const metrics = 'impressions,reach,follower_count,profile_views'
const url = https://graph.instagram.com/${userId}/insights?metric=${metrics}&period=days_28&access_token=${accessToken}
const response = await fetch(url)
const data = await response.json()
return data.data
}
// Get engagement metrics for a specific post
async function getPostEngagement(mediaId) {
const metrics = 'impressions,reach,engagement,saved,shares'
const url = https://graph.instagram.com/${mediaId}/insights?metric=${metrics}&access_token=${accessToken}
const response = await fetch(url)
const data = await response.json()
return data.data
}
Rate Limits
The Instagram Insights API follows standard Graph API rate limits:
- 200 calls per user per hour for most endpoints
- Insights data is cached and may have a 24-48 hour delay for some metrics
- Historical data is available for up to 2 years (account insights) or the lifetime of the media (post insights)
Common Issues
"Unsupported metric" error: Not all metrics are available for all media types. Stories have different metrics than Posts and Reels. Check Meta's documentation for media-type-specific metric availability.
Data delays: Some metrics (especially reach and impressions) can take 24-48 hours to finalize. Do not expect real-time data for analytics use cases.
Token expiration: Long-lived tokens expire after 60 days. Implement token refresh logic to maintain uninterrupted API access.
Using SociaHive's Analytics Instead
If you do not want to build your own analytics integration, SociaHive provides engagement analytics through its dashboard — pulling data from the same Instagram Graph API but presenting it in a visual, actionable format.
Frequently Asked Questions
Can I get Instagram engagement data for any account?
No. You can only access engagement data for Instagram Business or Creator accounts that have authorized your app. You cannot pull metrics for competitors or accounts you do not manage.
Is the Instagram Insights API free?
Yes. The Instagram Graph API, including insights endpoints, is free to use. Meta does not charge for API calls. Your only costs are hosting your application.
How do I calculate engagement rate from the API?
Engagement rate = (likes + comments + saves + shares) / reach × 100. Pull the individual metrics from the media insights endpoint and calculate. Our free Instagram Engagement Rate Calculator does this automatically.
Ready to automate your Instagram?
Start free, plans from $29/mo. 14-day free Pro trial included.
Get Started