Instagram Insights API Setup and Analytics Guide
Learn how to set up the Instagram Insights API via Facebook Graph API to automate reporting, access granular metrics, and optimize campaigns.

Introduction to Instagram Insights API for Analytics and Reporting
The Instagram Insights API—part of the Facebook Graph API—gives brands, influencers, and developers programmatic access to in-depth analytics from Instagram Business and Creator accounts. With it, you can pull key performance metrics, monitor audience trends, and measure the impact of individual posts or stories without relying on manual exports. This makes the API essential for those who want to create data-driven Instagram marketing strategies or integrate insights directly into dashboards and reporting systems.
Whether you manage a corporate social team, operate as a content creator, or develop analytics software, the Instagram Insights API lets you automate reporting, gain granular media-level data, and make real-time adjustments for better outcomes.

Key Benefits
- Automated reporting — Fetch metrics without manual export.
- Granular insights — Access both account-wide and media-specific data.
- Integration-ready — Feed data to business intelligence tools.
- Real-time optimization — Adjust campaigns based on fresh metrics.
---
Requirements to Access the API
Before working with the Instagram Insights API, ensure you meet these prerequisites:
- Instagram Business or Creator Account — Personal accounts are not eligible.
- Facebook Page linked to Instagram Account — Required for authentication flow.
- Facebook Developer Account — To register your app and manage API permissions.
- Facebook Graph API Permissions — Specifically `instagram_basic` and `instagram_manage_insights`.
---
Setting Up a Facebook Developer Account and Generating Tokens
Creating a Facebook Developer account is your first step for API access.

Step-by-Step Guide
- Create Developer Account
- Visit https://developers.facebook.com.
- Log in with your Facebook credentials.
- Accept terms and verify your account.
- Register an App
- Click "Create App" in the dashboard.
- Select “Business” as the app type.
- Fill in app details.
- Add Instagram Basic Display & Pages API
- In your app settings, add Instagram Graph API products.
- Generate Access Token
- In the user token generator, authenticate with the linked Instagram account.
- Request required permissions.
- Save the short-lived token and exchange for a long-lived token using Graph API calls.
## Example: Exchange short-lived for long-lived token
curl -X GET \
"https://graph.facebook.com/v17.0/oauth/access_token?
grant_type=fb_exchange_token&
client_id={app-id}&
client_secret={app-secret}&
fb_exchange_token={short-lived-token}"
---
Available Metrics and Dimensions
The Instagram Insights API provides metrics to assess different dimensions of account and media performance.
Metric | Description | Level |
---|---|---|
Impressions | Total views of the content | Media / Account |
Reach | Unique accounts reached | Media / Account |
Engagement | Total interactions (likes, comments, shares, saves) | Media |
Profile Views | Number of times profile was viewed | Account |
Follower Count | Total followers at end of each day | Account |
Video Views | Plays of a video or reel | Media |
---
Fetching User Insights
User insights deliver account-level analytics such as reach, profile views, and follower growth.
Endpoint
GET /{ig-user-id}/insights?metric=impressions,reach,profile_views
Sample Request:
curl -X GET \
"https://graph.facebook.com/v17.0/{ig-user-id}/insights?
metric=impressions,reach,profile_views&
period=day&
access_token={token}"
Notes:
- `period` can be `day`, `week`, or `month`.
- Use your Instagram User ID, available via the Graph API.
---
Fetching Media Insights
Media insights provide analytics for photos, videos, reels, and stories.
Common Metrics for Media
- `engagement`
- `impressions`
- `reach`
- `saved`
- `video_views`
Sample Request for Media:
curl -X GET \
"https://graph.facebook.com/v17.0/{ig-media-id}/insights?
metric=engagement,impressions,reach&
access_token={token}"

Specific Considerations:
- Story insights expire after 24 hours.
- Reel metrics include plays, shares, and saves.
- Carousel posts provide per-image metrics aggregated.
---
Handling Rate Limits and Pagination
The API enforces rate limits that differ based on token type and permissions.
Best Practices
- Batch requests using Graph API’s batch functionality.
- Use pagination with `after` and `before` cursors from responses.
- Implement retry logic with exponential backoff when hitting limits.
## Example pagination handling
curl "https://graph.facebook.com/v17.0/{ig-user-id}/media?after={cursor}&access_token={token}"
---
Integrating Insights Data into Dashboards and Reports
Once data is fetched, visualize it with BI tools such as Tableau, Power BI, or Google Data Studio.
Integration Steps:
- Schedule API calls via cron jobs or cloud functions.
- Store raw data in a secure database (MySQL, PostgreSQL, etc.).
- Transform it into business-friendly models.
- Connect BI tools to your database for reports and dashboards.
Common KPIs to Track:
- Engagement rate over time.
- Best-performing content types.
- Audience growth trends.
---
Use Cases for Brands and Creators
For Brands
- Optimize ad spend based on high-performing organic content.
- Refine targeting using audience demographic data.
For Creators
- Identify content formats that maximize reach.
- Monitor follower growth to evaluate collaboration impact.
---
Common Errors and Troubleshooting Tips
- Error: “Unsupported get request”
- Verify your account is Business or Creator type.
- Error: “OAuthException”
- Refresh expired access tokens regularly.
- Error: “Permissions error”
- Confirm required permissions are enabled in app settings.
---
Security Best Practices When Working with API Tokens
- Store tokens securely (use environment variables or secrets management).
- Avoid committing tokens to public repositories.
- Rotate tokens frequently to reduce risk.
- Limit granted permissions to essential scopes.
---
Future Updates and API Policy Changes
Meta periodically updates endpoints, permissions, and limits. Potential changes include:
- More robust real-time analytics.
- Access to extended historical data.
- Compliance updates for regional privacy regulations.
Stay informed via the Meta for Developers blog and API changelogs.
---
Conclusion: Leveraging Instagram Insights API for Social Media Success
By mastering the Instagram Insights API, brands and creators can automate reporting, integrate metrics into BI dashboards, and respond quickly to audience behavior changes. This data-centric approach eliminates guesswork, drives content optimization, and strengthens engagement strategies.
Start implementing the API today to power your Instagram growth with actionable analytics—track what matters, invest where you see results, and outpace competitors with informed social media decisions.