> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Instagram Graph API

> Your Instagram professional account through Meta's Graph API: profile, media, insights, comments and other businesses' public data.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/instagram.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=35109894465c27d45fac55eb845f15f0)

[Web Catalog · Social](https://docs.webrouter.net/data-apis.md?category=social)

Needs&#x20;

`INSTAGRAM_ACCESS_TOKEN`

Endpoints

7

Auth

Key in query

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api)

## Setup

| Variable | | What it is |
| - | - | - |
| `INSTAGRAM_ACCESS_TOKEN` | required | An access token for the Instagram professional account: a Facebook Login user or system-user token, or an Instagram Login token (Meta App Dashboard > Instagram > API setup) |
| `INSTAGRAM_GRAPH_HOST` | optional | graph.facebook.com for Facebook Login or a system-user token; graph.instagram.com for Instagram Login tokens. Default `graph.facebook.com`. One of `graph.facebook.com`, `graph.instagram.com`. |
| `META_GRAPH_API_VERSION` | optional | Graph API version. Meta retires old versions about two years after release. Default `v27.0`. One of `v27.0`, `v26.0`, `v25.0`, `v24.0`. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Only for Instagram business or creator accounts connected to your Meta app, with the permissions each call lists in its docs. Tokens are tied to the app user.
* Publishing is two calls: media.create\_container, then media.publish. Both change the account, so they are writes.
* Insights data can lag 48 hours; missing data comes back as an empty set, not 0.
* Paging uses cursors in paging.cursors.after; follow paging.next when present.

## Endpoints

GET

Get an Instagram professional account

Profile fields of the connected Instagram business or creator account.

[Open](#instagram-user-get)

GET

List an account's media

The posts, reels and carousels of the account, newest first (stories are excluded).

[Open](#instagram-media-list)

GET

Get one post

Fields of a single media object.

[Open](#instagram-media-get)

GET

Get a post's insights

Reach, views, interactions and other metrics for one media object.

[Open](#instagram-media-insights)

GET

Get account-level insights

Reach, views, follower and interaction metrics for the account.

[Open](#instagram-user-insights)

GET

List comments on a post

Top-level comments of a media object (add replies via fields=replies).

[Open](#instagram-comments-list)

GET

Look up another business or creator account

Public profile counts and recent media of any Instagram professional account, by username.

[Open](#instagram-business-discovery)

### Get an Instagram professional account

GET

`/{ig_user_id}`

`instagram.user.get`

Profile fields of the connected Instagram business or creator account.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`ig_user_id` required</td><td>string</td><td>path</td><td>The Instagram account id (app-scoped). Example `17841400000000000`</td></tr>
    <tr><td>`fields`</td><td>string</td><td>query</td><td>Comma-separated: id, username, name, biography, followers\_count, follows\_count, media\_count, profile\_picture\_url, website. Example `username,followers_count,follows_count,media_count`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-user) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-profile), [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-company-social-metrics), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-users-get), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-get), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-reactions), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-reactions)

```python Python theme={null}
router.call_data_api("instagram.user.get", {'ig_user_id': '17841400000000000', 'fields': 'username,followers_count,follows_count,media_count'})
```

```text MCP theme={null}
call_data_api(endpoint="instagram.user.get", params={"ig_user_id": "17841400000000000", "fields": "username,followers_count,follows_count,media_count"})
```

### List an account's media

GET

`/{ig_user_id}/media`

`instagram.media.list`

The posts, reels and carousels of the account, newest first (stories are excluded).

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ig_user_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The Instagram account id.
      </td>
    </tr>

    <tr><td>`fields`</td><td>string</td><td>query</td><td>Comma-separated media fields: id, caption, media\_type, media\_url, permalink, thumbnail\_url, timestamp, like\_count, comments\_count, ... Example `id,caption,media_type,permalink,timestamp,like_count,comments_count`</td></tr>

    <tr>
      <td>
        `since`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Start of a time range: Unix timestamp or strtotime value.
      </td>
    </tr>

    <tr>
      <td>
        `until`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        End of a time range: Unix timestamp or strtotime value.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-user/media) · Same job: [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-social-posts), [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-posts), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-list), [Edges](https://docs.webrouter.net/data-apis/edges.md#edges-post-extract), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-feed), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-videos-search)

> [!NOTE]
>
> * Returns up to the 10,000 most recent media. Stories come from the /stories edge, not here.
> * media\_url is missing for some videos (licensed audio, reels with downloads off): fall back to permalink or thumbnail\_url.
> * fields: without it only ids come back.

### Get one post

GET

`/{ig_media_id}`

`instagram.media.get`

Fields of a single media object.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ig_media_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Media id.
      </td>
    </tr>

    <tr><td>`fields`</td><td>string</td><td>query</td><td>Comma-separated: id, media\_type, media\_url, permalink, shortcode, thumbnail\_url, timestamp, username, alt\_text, comments\_count, like\_count, is\_comment\_enabled; caption and media\_product\_type need Facebook Login. Example `id,media_type,permalink,timestamp,like_count,comments_count`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-media) · Same job: [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-social-posts), [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-posts), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-list), [Edges](https://docs.webrouter.net/data-apis/edges.md#edges-post-extract), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-feed), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-videos-search)

### Get a post's insights

GET

`/{ig_media_id}/insights`

`instagram.media.insights`

Reach, views, interactions and other metrics for one media object.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ig_media_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Media id.
      </td>
    </tr>

    <tr><td>`metric` required</td><td>string</td><td>query</td><td>Comma-separated: reach, views, shares, total\_interactions, likes, comments, saved, follows, profile\_visits, ...; which exist depends on the media type. Example `reach,views,total_interactions`</td></tr>

    <tr>
      <td>
        `period`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        day, week, days\_28, month, lifetime or total\_over\_range.
      </td>
    </tr>

    <tr>
      <td>
        `breakdown`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        action\_type (only with profile\_activity) or story\_navigation\_action\_type (only with navigation).
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-media/insights) · Same job: [akta.pro](https://docs.webrouter.net/data-apis/akta.md#akta-company-social-posts), [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-posts), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-articles-list), [Edges](https://docs.webrouter.net/data-apis/edges.md#edges-post-extract), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-feed), [FastMoss](https://docs.webrouter.net/data-apis/fastmoss.md#fastmoss-videos-search)

> [!NOTE]
>
> * Needs a professional account and the insights permission. Albums have no insights; story metrics expire after 24 hours; stories with under 5 viewers answer error 10.
> * Missing data returns an empty set, not 0. Data can lag 48 hours.

### Get account-level insights

GET

`/{ig_user_id}/insights`

`instagram.user.insights`

Reach, views, follower and interaction metrics for the account.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ig_user_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The Instagram account id.
      </td>
    </tr>

    <tr><td>`metric` required</td><td>string</td><td>query</td><td>Comma-separated metrics, e.g. reach, views, follower\_count, follows\_and\_unfollows, profile\_links\_taps. Example `reach,views`</td></tr>
    <tr><td>`period` required</td><td>string</td><td>query</td><td>day for most metrics, lifetime for demographics. Example `day`</td></tr>
    <tr><td>`metric_type`</td><td>string</td><td>query</td><td>time\_series or total\_value. One of `time_series`, `total_value`</td></tr>

    <tr>
      <td>
        `breakdown`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        contact\_button\_type, follow\_type or media\_product\_type; only with metric\_type=total\_value.
      </td>
    </tr>

    <tr>
      <td>
        `timeframe`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        For demographic metrics: this\_month, this\_week, last\_14\_days, last\_30\_days, last\_90\_days, prev\_month (the last four unsupported from v20.0).
      </td>
    </tr>

    <tr>
      <td>
        `since`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Unix timestamp; with until, an inclusive range. Default window is the last 24 hours.
      </td>
    </tr>

    <tr>
      <td>
        `until`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Unix timestamp.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-user/insights) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-charts-query), [Close](https://docs.webrouter.net/data-apis/close-crm.md#close-crm-reports-activity), [Cloudflare](https://docs.webrouter.net/data-apis/cloudflare.md#cloudflare-analytics-graphql), [Google Analytics 4 (Data API)](https://docs.webrouter.net/data-apis/google-analytics.md#google-analytics-report-run), [Klaviyo](https://docs.webrouter.net/data-apis/klaviyo.md#klaviyo-campaigns-report), [Microsoft Graph (Microsoft 365)](https://docs.webrouter.net/data-apis/microsoft-graph.md#microsoft-graph-reports-active-users)

> [!NOTE]
>
> * follower\_count and online\_followers need 100+ followers. Demographics return the top 45 only. Data can lag 48 hours. impressions is deprecated: use views.

### List comments on a post

GET

`/{ig_media_id}/comments`

`instagram.comments.list`

Top-level comments of a media object (add replies via fields=replies).

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ig_media_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Media id.
      </td>
    </tr>

    <tr><td>`fields`</td><td>string</td><td>query</td><td>Comma-separated: id, text, timestamp, replies, ... Example `id,text,timestamp,replies`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-media/comments) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-comments), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-comments-list), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-comments), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-profile-comments), [Hacker News Search (Algolia)](https://docs.webrouter.net/data-apis/hn-algolia.md#hn-algolia-item-get), [Influencers Club](https://docs.webrouter.net/data-apis/influencersclub.md#influencersclub-posts-details)

> [!NOTE]
>
> * Newest first, at most 50 per query, top-level only unless replies is requested. Cannot be filtered by time.

### Look up another business or creator account

GET

`/{ig_user_id}`

`instagram.business_discovery`

Public profile counts and recent media of any Instagram professional account, by username.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `ig_user_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Your own Instagram account id.
      </td>
    </tr>

    <tr><td>`fields` required</td><td>string</td><td>query</td><td>business\_discovery.username(\<name>)\{public fields and media\{...}}. Example `business_discovery.username(instagram){followers_count,media_count,media{caption,like_count,comments_count,permalink}}`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.facebook.com/docs/instagram-platform/instagram-graph-api/reference/ig-user/business_discovery) · Same job: [AnyAPI](https://docs.webrouter.net/data-apis/anyapi.md#anyapi-facebook-profile), [Aviato](https://docs.webrouter.net/data-apis/aviato.md#aviato-company-social-metrics), [DEV Community](https://docs.webrouter.net/data-apis/dev-to.md#dev-to-users-get), [Facebook Pages (Graph API)](https://docs.webrouter.net/data-apis/facebook.md#facebook-page-get), [Fetchin](https://docs.webrouter.net/data-apis/fetchinio.md#fetchinio-post-reactions), [HarvestAPI](https://docs.webrouter.net/data-apis/harvestapi.md#harvestapi-linkedin-post-reactions)

> [!NOTE]
>
> * Read-only, public data only; age-gated accounts return nothing. Needs Facebook Login with instagram\_manage\_insights.
> * The media edge pages with before/after cursors but no next link: build the next request yourself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.