Instagram Media API

Photos, videos, stories, reels, and carousels

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /{user_id}/media List the posts published on an account · Instagram Get User Media #
Ask an LLM
“How do I list everything an Instagram account has posted?”
“Can I page through an account's posts a set number at a time?”
Tell an agent
List the media published by account {user_id}.
Get {limit} posts from account {user_id} starting after cursor {after}.
GET /{user_id}/stories List an account's stories · Instagram Get User Stories #
Ask an LLM
“How can I fetch the stories currently on my Instagram account?”
“Can I retrieve story media separately from regular feed posts?”
Tell an agent
List the stories on account {user_id}.
Get the stories for account {user_id} with fields {fields}.
GET /{media_id} Get details of a photo, video, reel or album · Instagram Get Media #
Ask an LLM
“How do I look up the caption, type and permalink of a single post by its media ID?”
“What fields can I read on one Instagram reel or album?”
Tell an agent
Show me media {media_id}.
Fetch fields {fields} for post {media_id}.
POST /{media_id} Turn comments on or off for a post · Instagram Update Media #
Ask an LLM
“Can I disable commenting on a post that's attracting trolls?”
“Is there a way to re-enable comments on a post where I switched them off?”
Tell an agent
Turn off comments on post {media_id}.
Set comment_enabled to {comment_enabled} on media {media_id}.
DELETE /{media_id} Delete a post, story, reel or carousel · Instagram Delete Media #
Ask an LLM
“How do I take down a post I published by mistake?”
“Can I delete a reel or carousel through the API?”
Tell an agent destructive · confirm first
Delete media {media_id}.
Permanently remove post {media_id} from the account.
GET /{media_id}/children List the items inside a carousel album · Instagram Get Carousel Children #
Ask an LLM
“How do I get the individual photos and videos inside a carousel post?”
“What media items make up a particular album on Instagram?”
Tell an agent
List the children of carousel {media_id}.
Get each item in album {media_id} with fields {fields}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/instagram:instagram-media-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

instagram-media-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Instagram Graph Media API
  description: The Instagram Graph API allows Instagram Professionals (Business and Creator accounts) to manage their presence on Instagram, including media publishing, comments, hashtags, mentions, insights, and messaging. Uses the Facebook Graph API infrastructure with OAuth 2.0 authentication.
  version: '21.0'
  contact:
    name: Meta for Developers
    url: https://developers.facebook.com/docs/instagram-api
  license:
    name: Meta Platform Terms
    url: https://developers.facebook.com/terms
servers:
- url: https://graph.facebook.com/v21.0
  description: Facebook Graph API (Facebook Login)
- url: https://graph.instagram.com/v21.0
  description: Instagram Graph API (Instagram Login)
tags:
- name: Media
  description: Photos, videos, stories, reels, and carousels
paths:
  /{user_id}/media:
    get:
      operationId: getUserMedia
      summary: Instagram Get User Media
      description: Get a collection of IG Media objects published on the account.
      tags:
      - Media
      parameters:
      - name: user_id
        in: path
        required: true
        description: The Instagram user ID.
        schema:
          type: string
      - name: fields
        in: query
        description: Comma-separated list of fields.
        schema:
          type: string
        example: id,caption,media_type,media_url,timestamp,permalink
      - name: limit
        in: query
        description: Maximum number of results per page.
        schema:
          type: integer
        example: 25
      - name: after
        in: query
        description: Cursor for pagination.
        schema:
          type: string
      - name: access_token
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of media objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{user_id}/stories:
    get:
      operationId: getUserStories
      summary: Instagram Get User Stories
      description: Get a collection of story IG Media objects on the account.
      tags:
      - Media
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
      - name: fields
        in: query
        schema:
          type: string
      - name: access_token
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of story media.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{media_id}:
    get:
      operationId: getMedia
      summary: Instagram Get Media
      description: Get fields on an Instagram photo, video, story, reel, or album.
      tags:
      - Media
      parameters:
      - name: media_id
        in: path
        required: true
        description: The IG Media ID.
        schema:
          type: string
      - name: fields
        in: query
        description: Comma-separated list of fields.
        schema:
          type: string
        example: id,caption,media_type,media_url,timestamp,like_count,comments_count
      - name: access_token
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Media object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: updateMedia
      summary: Instagram Update Media
      description: Enable or disable comments on a media object.
      tags:
      - Media
      parameters:
      - name: media_id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment_enabled:
                  type: boolean
                  example: true
                access_token:
                  type: string
      responses:
        '200':
          description: Update success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteMedia
      summary: Instagram Delete Media
      description: Delete an Instagram media object (post, story, reel, or carousel).
      tags:
      - Media
      parameters:
      - name: media_id
        in: path
        required: true
        schema:
          type: string
      - name: access_token
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Media deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  deleted_id:
                    type: string
                    example: '17854360229135492'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{media_id}/children:
    get:
      operationId: getMediaChildren
      summary: Instagram Get Carousel Children
      description: Get media objects within a carousel album.
      tags:
      - Media
      parameters:
      - name: media_id
        in: path
        required: true
        schema:
          type: string
      - name: fields
        in: query
        schema:
          type: string
      - name: access_token
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of child media.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    MediaList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Media'
        paging:
          $ref: '#/components/schemas/Paging'
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
    Paging:
      type: object
      properties:
        cursors:
          type: object
          properties:
            before:
              type: string
              example: QVFIUjRtc2c5NEl0ajN3
            after:
              type: string
              example: QVFIUmlKdXBzYWtyUml3
        next:
          type: string
          description: URL to fetch next page.
        previous:
          type: string
          description: URL to fetch previous page.
    Media:
      type: object
      properties:
        id:
          type: string
          example: '17854360229135492'
        caption:
          type: string
          example: 'Beautiful sunset at the beach! #photography'
        media_type:
          type: string
          enum:
          - IMAGE
          - VIDEO
          - CAROUSEL_ALBUM
          - REELS
          - STORIES
          example: IMAGE
        media_url:
          type: string
          example: https://scontent.cdninstagram.com/media/example.jpg
        thumbnail_url:
          type: string
          description: Thumbnail URL for videos.
        permalink:
          type: string
          example: https://www.instagram.com/p/ABC123/
        shortcode:
          type: string
          example: ABC123
        timestamp:
          type: string
          format: date-time
          example: 2026-04-17T12:00:00+0000
        like_count:
          type: integer
          example: 250
        comments_count:
          type: integer
          example: 15
        is_comment_enabled:
          type: boolean
          example: true
        is_shared_to_feed:
          type: boolean
          example: true
        alt_text:
          type: string
          description: Alt text for accessibility.
        username:
          type: string
          example: examplebusiness
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 authentication via Instagram Login or Facebook Login.
      flows:
        authorizationCode:
          authorizationUrl: https://www.facebook.com/dialog/oauth
          tokenUrl: https://graph.facebook.com/oauth/access_token
          scopes:
            instagram_basic: Read user profile and media.
            instagram_content_publish: Publish content on behalf of the user.
            instagram_manage_comments: Manage comments on media.
            instagram_manage_insights: Access insights and analytics.
            instagram_manage_messages: Manage Instagram Direct messages.
            pages_show_list: Show list of pages managed by user.
            pages_read_engagement: Read engagement data from pages.
externalDocs:
  description: Instagram Platform Documentation
  url: https://developers.facebook.com/docs/instagram-platform