Skip to main content
Socialift
Guide

Instagram Insights API: account and media metrics

The Instagram Insights API works at two levels: the account (GET /{ig-user-id}/insights) and the media object (GET /{ig-media-id}/insights). In 2025 Meta retired impressions and plays and introduced views in their place. The API only supports Business and Creator accounts, data can lag by up to 48 hours, and demographics return only the top 45 values.

Updated:

In short: how do you get Instagram stats through the API?

For account metrics, call /{ig-user-id}/insights with metric, period=day and metric_type=total_value; for post metrics, call /{ig-media-id}/insights. The permission depends on the login type: instagram_business_manage_insights with Instagram Login, instagram_manage_insights with Facebook Login. Personal accounts aren't supported — Business or Creator only.

If an account request omits since and until, the API looks back 24 hours. When there's no data, the API returns an empty set rather than 0 — don't record it as zero in your reports.

Login type: host and permissions

Login type: host and permissions — Capability matrix by platform
Instagram LoginFacebook Login
Hostgraph.instagram.comgraph.facebook.com
Facebook PageNot requiredThe Instagram account must be linked to a Page
Permissionsinstagram_business_basic, instagram_business_manage_insightsinstagram_basic, instagram_manage_insights, pages_read_engagement
Totals including adsNototal_likes, total_comments, total_views
Socialift SDKInstagram(app_id=..., app_secret=...)Instagram.via_facebook(app_secret=...) plus ig_user_id

On the Facebook Login path, if the user's Page role was granted through Business Manager, Meta's docs also list ads_management and ads_read.

Account-level metrics

The list from Meta's current reference. Regular metrics are requested with period=day.

Account-level metrics — Capability matrix by platform
MetricWhat it measuresBreakdown
viewsTimes your content (reels, posts, stories) was played or displayedfollower_type, media_product_type
reachUnique accounts that saw your content at least once, including adsmedia_product_type, follow_type
accounts_engagedAccounts that interacted with your content, including adsno
total_interactionsAll interactions across posts, stories, reels, videos and livemedia_product_type
likes, comments, saves, sharesIndividual interaction typesmedia_product_type
replies, repostsReplies and repostsno
follows_and_unfollowsAccounts that followed and unfollowedfollow_type
profile_links_tapsTaps on address, call, email and text buttonscontact_button_type
follower_demographics, engaged_audience_demographicsDemographics of followers and of the engaged audienceage, city, country, gender

yesno

Every metric supports metric_type=total_value; reach also supports time_series. Demographics use period=lifetime plus a timeframe.

Media metrics by content type

The valid set depends on media_product_type. Request an unsupported metric and the Graph API rejects the whole call.

Media metrics by content type — Capability matrix by platform
MetricFEEDREELSSTORY
viewsyesyesyes
reachyesyesyes
total_interactionsyesyesyes
shares, repostsyesyesyes
likes, commentsyesyesno
savedyesyesno
profile_visits, profile_activity, followsyesnoyes
ig_reels_avg_watch_timenoyesno
navigation, replies, link_clicksnonoyes

yesnoScroll the table sideways

likes and comments count organic interactions only. With Facebook Login you also get total_likes, total_comments and total_views, which include ad engagement.

2024–2025 changes: what was retired and what was added

This is exactly why code from older tutorials breaks.

2024–2025 changes: what was retired and what was added — Capability matrix by platform
MetricWhat happenedWhen
impressions (account and media)Retired, replaced by viewsv22.0 from January 21, 2025; all versions from April 21, 2025
plays, clips_replays_count, ig_reels_aggregated_all_plays_count (media)Retired, replaced by viewsSame dates
video_views (media)Retiredv21.0 from October 2, 2024; all versions from January 8, 2025
profile_views, website_clicks, email_contacts, phone_call_clicks, text_message_clicks, get_direction_clicks (account, time series)RetiredSame dates (v21.0)
last_14_days, last_30_days, last_90_days, prev_month (audience demographics timeframes)RetiredAll versions from August 19, 2024
views (account and media)AddedJanuary 21, 2025
reposts, reels_skip_rate, facebook_views, crossposted_viewsAddedDecember 3, 2025

For media created after July 2, 2024, impressions stopped working even earlier.

Demographics: who follows and who engages

follower_demographics (followers) and engaged_audience_demographics (people who interacted) are requested with period=lifetime, metric_type=total_value, a breakdown (age, city, country or gender) and a timeframe. The timeframe overrides since/until; the safe values are this_week and this_month.

Meta returns only the top 45 values. Keep that in mind when computing shares — cities outside the top 45, for example, simply aren't in the response.

Small accounts have limits: Meta doesn't return follower_count or online_followers for accounts with fewer than 100 followers, and demographics may come back empty. The Socialift SDK's ig.demographics doesn't raise in that case: it returns available: False with Meta's reason for that breakdown, and the other breakdowns still come through.

Time ranges, delay and retention

Data can be delayed by up to 48 hours: if yesterday's number changes tomorrow, that's expected. Re-fetch the last two days on every sync.

Media metrics are stored for up to 2 years. Story metrics are only available for 24 hours — collect them while the story is live. Story metrics with values below 5 return error code 10, and individual items inside an album have no insights at all.

For long-range reporting, the reliable approach is a daily snapshot stored in your own database. The Socialift SDK's ig.insights caps the window at 30 days and never lets until go past today, so request long periods in 30-day chunks.

Setting up stats collection in 5 steps

  1. Check the account type

    The Instagram account must be Business or Creator. For Facebook Login, it's linked to a Facebook Page.

  2. Request the insights permissions

    Instagram Login: instagram_business_basic and instagram_business_manage_insights. Facebook Login: instagram_basic, instagram_manage_insights, pages_read_engagement. Serving other people's accounts requires App Review for these.

  3. Collect account metrics daily

    Request views, reach, accounts_engaged, total_interactions and friends with period=day, and store them every day.

  4. Request media metrics by content type

    Look up media_product_type first (FEED, REELS, STORY), then request the matching set. Collect stories within 24 hours.

  5. Pull demographics weekly or monthly

    Request follower_demographics with timeframe=this_month, once per breakdown, and store the result with a date.

Python: account, media and demographics

Facebook Login path: a Page token plus the Instagram account ID.

instagram_stats.py
import asyncio, os
from datetime import date, timedelta
from socialift import Instagram

async def main() -> None:
    token = os.environ["PAGE_TOKEN"]
    ig_user_id = os.environ["IG_USER_ID"]
    async with Instagram.via_facebook(app_secret=os.environ["FACEBOOK_APP_SECRET"]) as ig:
        week = await ig.insights(
            token, ig_user_id=ig_user_id, since=date.today() - timedelta(days=7), until=date.today()
        )
        print(week["since"], week["until"], week["metrics"])

        for post in await ig.media(token, ig_user_id=ig_user_id, limit=5):
            print(post["id"], post["media_type"], await ig.media_insights(post["id"], token))

        demo = await ig.demographics(token, ig_user_id=ig_user_id)
        for cut, data in demo.items():
            print(cut, data["values"] if data["available"] else data["reason"])

asyncio.run(main())

On the Instagram Login path, create the client with Instagram.from_env(), pass an Instagram user token, and ig_user_id becomes optional.

When a post has no insights (an old post or an expired story), media_insights returns an empty dict instead of raising.

What the Socialift SDK actually requests

Knowing which metrics each method asks for helps you build reports correctly.

What the Socialift SDK actually requests — Capability matrix by platform
MethodGraph API requestReturns
ig.insights/{ig-user-id}/insights: reach, profile_views, website_clicks, accounts_engaged, total_interactions; period=day, metric_type=total_value. Defaults to the last 30 days; the window never exceeds 30 dayssince, until and a metrics dict
ig.media_insightsReads media_type and media_product_type first, then the matching set. Image: reach, likes, comments, saved, shares, total_interactions, profile_visits. Video and Reels: the same plus views (without profile_visits). Carousel: reach, likes, comments, saved, shares, total_interactions. Story: reach, replies, navigation, total_interactions{metric: value} or an empty dict
ig.demographicsfollower_demographics, period=lifetime, timeframe=this_month; breakdowns in separate calls: age,gender, city, countryavailable plus values or reason per breakdown
Notes and limits

Heads-up: Meta's current account metric list no longer includes profile_views or website_clicks (their time series versions were retired in January 2025). If ig.insights returns a metric error, that's the likely cause.

Tips for a reporting pipeline

  • Use views instead of impressions and plays — update legacy dashboards.
  • Don't store an empty response as 0: it means "no data".
  • Re-fetch the last 48 hours daily — numbers may not be final yet.
  • Collect story insights within 24 hours.
  • Keep daily snapshots yourself and request long periods in chunks.
  • Handle missing permissions (PermissionError) separately from token problems (AuthError).

← Back to blog

Frequently asked questions

Why doesn't impressions work in the Instagram API anymore?

Meta retired impressions in v22.0 from January 21, 2025, and in all versions from April 21, 2025. Use the views metric instead — it's available at both account and media level.

What's the difference between views and reach?

views counts how many times content was played or displayed (one person can be counted several times). reach counts unique accounts that saw the content at least once.

Can I get insights for a personal Instagram account via the API?

No. The Insights API only supports Business and Creator accounts. Switch the account to a professional account in the Instagram app settings.

Why are my demographics empty?

Usually the account is too small or the timeframe isn't supported. Use this_week or this_month, request each breakdown separately, and remember the response holds at most 45 values.

Can I fetch story insights later?

No — story metrics are only available for 24 hours. Schedule collection when the story is published and store the result in your own database.

How far back can I get Instagram insights?

Meta stores media metrics for up to 2 years. For long account-level history, the reliable approach is taking and storing your own daily snapshots.

Sources

  1. Meta: Instagram User Insights
  2. Meta: Instagram Media Insights
  3. Meta: Instagram Platform changelog
  4. Meta: Graph API v21.0 changelog

Related pages