> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Instagram Video Metadata

> Get Instagram video metadata.

<Info>
  **Product**: Visual Intelligence — Social Media Scraping
  **Use case**: Fetch video metadata, transcripts, captions, and comments from YouTube, Instagram, TikTok, and Twitter/X
  **Host**: `https://mavi-backend.memories.ai/serve/api/v2`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

This endpoint allows you to retrieve metadata for an Instagram video.

<Note>
  Channel routing guide: see [Social Media Scraping Overview](/visual-intelligence/social-media-scraping-overview). Endpoints with a `channel` request field let you choose `apify`, `rapid`, or `memories.ai`; endpoints without this field use managed routing.
</Note>

<Note>
  **Pricing:**

  * **rapid** channel: \$0.01 per video
  * **memories.ai** channel: \$0.01 per video
  * **apify** channel: Charged at Apify's actual cost (higher and variable pricing)
</Note>

### Code Example

<CodeGroup>
  ```python Python theme={null}
  import requests

  BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
  API_KEY = "sk-mavi-..."
  HEADERS = {
      "Authorization": f"{API_KEY}"
  }

  def instagram_video_metadata(video_url: str, channel: str):
      url = f"{BASE_URL}/instagram/video/metadata"
      data = {"video_url": video_url, "channel": channel}
      resp = requests.post(url, headers=HEADERS, json=data)
      return resp.json()

  # Usage example
  result = instagram_video_metadata("https://www.instagram.com/reels/DLlGZiCOBQ0/", "apify")
  print(result)
  ```
</CodeGroup>

### Request Body

| Field      | Type   | Required | Description                                                                                                                                                                                                          |
| ---------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| video\_url | string | Yes      | The Instagram video URL. Must be a **Reel URL** (`/reels/<shortcode>/` or `/reel/<shortcode>/`). Post URLs (`/p/<shortcode>/`) are rejected with `HTTP 400` `"instagram url error"` — even when the post is a video. |
| channel    | string | Yes      | The channel name. Supported values: `apify`, `rapid`, `memories.ai`                                                                                                                                                  |

### Response

<Warning>
  **Response shape depends on the `channel` parameter** — same channel-dependent split as the YouTube and TikTok siblings. Verified live:

  * `channel: "apify"` — `data` is an **array** of flat metadata objects with `{inputUrl, id, type, shortCode, caption, hashtags, ...}`. May return `{url, error: "restricted_page", errorDescription}` for posts behind login walls.
  * `channel: "memories.ai"` — `data` is an **object** wrapping Instagram's internal GraphQL shape: `{data: {xdt_shortcode_media: {...}}, extensions, status}`.
  * `channel: "rapid"` — same alternative shape as `memories.ai`.

  The example below is the `memories.ai` GraphQL shape, **not** the apify shape the code example requests. Pick a channel per integration and expect to write a small adapter when switching.
</Warning>

<ResponseExample>
  ```json theme={null}
  {
    "code": 200,
    "msg": "success",
    "data": {
      "data": {
        "xdt_shortcode_media": {
          "__typename": "XDTGraphVideo",
          "id": "3667365614373573684",
          "shortcode": "DLlGZiCOBQ0",
          "thumbnail_src": "https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-15/...",
          "dimensions": {
            "height": 1136,
            "width": 640
          },
          "display_url": "https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-15/...",
          "display_resources": [
            {
              "src": "https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-15/...",
              "config_width": 640,
              "config_height": 1136
            }
          ],
          "dash_info": {
            "is_dash_eligible": true,
            "video_dash_manifest": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>...",
            "number_of_qualities": 1
          },
          "has_audio": true,
          "video_url": "https://scontent-jnb2-1.cdninstagram.com/o1/v/t2/f2/m86/...",
          "video_view_count": 27040,
          "video_play_count": 1799817,
          "product_type": "clips",
          "video_duration": 41.125,
          "clips_music_attribution_info": {
            "artist_name": "humansofny",
            "song_name": "Original audio",
            "uses_original_audio": true,
            "audio_id": "24313369781619226"
          },
          "is_video": true,
          "owner": {
            "id": "242598499",
            "username": "humansofny",
            "is_verified": true,
            "profile_pic_url": "https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-19/...",
            "full_name": "Humans of New York",
            "edge_followed_by": {
              "count": 12804266
            }
          },
          "edge_media_to_caption": {
            "edges": [
              {
                "node": {
                  "text": "I have the moves that they're looking for.",
                  "created_at": "1751404145"
                }
              }
            ]
          },
          "edge_media_to_parent_comment": {
            "count": 487,
            "edges": [
              {
                "node": {
                  "id": "18094151056886709",
                  "text": "Go for it sweetie!!!",
                  "created_at": 1762011704,
                  "owner": {
                    "username": "iam_carrongrazette"
                  }
                }
              }
            ]
          },
          "edge_media_preview_like": {
            "count": 27791
          },
          "taken_at_timestamp": 1751404144
        }
      },
      "extensions": {
        "is_final": true
      },
      "status": "ok"
    },
    "failed": false,
    "success": true
  }
  ```
</ResponseExample>

### Response Parameters

| Parameter                                                        | Type    | Description                                        |
| ---------------------------------------------------------------- | ------- | -------------------------------------------------- |
| code                                                             | string  | Response code indicating the result status         |
| msg                                                              | string  | Response message describing the operation result   |
| data                                                             | object  | Response data object containing Instagram metadata |
| data.data                                                        | object  | Instagram data object                              |
| data.data.xdt\_shortcode\_media                                  | object  | Instagram video media object                       |
| data.data.xdt\_shortcode\_media.id                               | string  | Video ID                                           |
| data.data.xdt\_shortcode\_media.shortcode                        | string  | Instagram short code                               |
| data.data.xdt\_shortcode\_media.thumbnail\_src                   | string  | Thumbnail image URL                                |
| data.data.xdt\_shortcode\_media.dimensions                       | object  | Video dimensions (height, width)                   |
| data.data.xdt\_shortcode\_media.display\_url                     | string  | Display image URL                                  |
| data.data.xdt\_shortcode\_media.video\_url                       | string  | Direct video URL                                   |
| data.data.xdt\_shortcode\_media.video\_view\_count               | number  | Number of video views                              |
| data.data.xdt\_shortcode\_media.video\_play\_count               | number  | Number of video plays                              |
| data.data.xdt\_shortcode\_media.video\_duration                  | number  | Video duration in seconds                          |
| data.data.xdt\_shortcode\_media.product\_type                    | string  | Product type (e.g., "clips")                       |
| data.data.xdt\_shortcode\_media.owner                            | object  | Video owner information                            |
| data.data.xdt\_shortcode\_media.owner.username                   | string  | Owner username                                     |
| data.data.xdt\_shortcode\_media.owner.full\_name                 | string  | Owner full name                                    |
| data.data.xdt\_shortcode\_media.edge\_media\_to\_caption         | object  | Video caption information                          |
| data.data.xdt\_shortcode\_media.edge\_media\_to\_parent\_comment | object  | Comments information                               |
| data.data.xdt\_shortcode\_media.edge\_media\_preview\_like       | object  | Likes information                                  |
| data.status                                                      | string  | Response status                                    |
| success                                                          | boolean | Indicates whether the operation was successful     |
| failed                                                           | boolean | Indicates whether the operation failed             |


## OpenAPI

````yaml POST /instagram/video/metadata
openapi: 3.1.0
info:
  title: Video Metadata & Transcript API Reference
  description: >-
    REST APIs for retrieving video metadata and transcripts from YouTube,
    Instagram, TikTok, and Twitter
  version: v1.0.1
servers:
  - url: https://mavi-backend.memories.ai/serve/api/v2
security:
  - ApiKeyAuth: []
paths:
  /instagram/video/metadata:
    post:
      summary: Instagram Video Metadata
      description: Get Instagram video metadata.
      operationId: instagram_video_metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                video_url:
                  type: string
                  description: The Instagram video URL
                  example: https://www.instagram.com/reels/DLlGZiCOBQ0/
                channel:
                  type: string
                  description: >-
                    The channel name. Supported values: apify, rapid,
                    memories.ai
                  enum:
                    - apify
                    - rapid
                    - memories.ai
                  example: apify
              required:
                - video_url
                - channel
      responses:
        '200':
          description: Video metadata information with detailed Instagram data
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: 200
                    description: Response code indicating the result status
                  msg:
                    type: string
                    example: success
                    description: Response message describing the operation result
                  data:
                    type: object
                    properties:
                      data:
                        type: object
                        properties:
                          xdt_shortcode_media:
                            type: object
                            description: Instagram video media object
                            properties:
                              __typename:
                                type: string
                                example: XDTGraphVideo
                              id:
                                type: string
                                example: '3667365614373573684'
                                description: Video ID
                              shortcode:
                                type: string
                                example: DLlGZiCOBQ0
                                description: Instagram short code
                              thumbnail_src:
                                type: string
                                example: >-
                                  https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-15/...
                                description: Thumbnail image URL
                              dimensions:
                                type: object
                                properties:
                                  height:
                                    type: number
                                    example: 1136
                                  width:
                                    type: number
                                    example: 640
                                description: Video dimensions
                              display_url:
                                type: string
                                example: >-
                                  https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-15/...
                                description: Display image URL
                              video_url:
                                type: string
                                example: >-
                                  https://scontent-jnb2-1.cdninstagram.com/o1/v/t2/f2/m86/...
                                description: Direct video URL
                              video_view_count:
                                type: number
                                example: 27040
                                description: Number of video views
                              video_play_count:
                                type: number
                                example: 1799817
                                description: Number of video plays
                              video_duration:
                                type: number
                                example: 41.125
                                description: Video duration in seconds
                              product_type:
                                type: string
                                example: clips
                                description: Product type
                              has_audio:
                                type: boolean
                                example: true
                                description: Whether the video has audio
                              owner:
                                type: object
                                description: Video owner information
                                properties:
                                  id:
                                    type: string
                                    example: '242598499'
                                  username:
                                    type: string
                                    example: humansofny
                                  full_name:
                                    type: string
                                    example: Humans of New York
                                  is_verified:
                                    type: boolean
                                    example: true
                                  profile_pic_url:
                                    type: string
                                    example: >-
                                      https://scontent-jnb2-1.cdninstagram.com/v/t51.2885-19/...
                                  edge_followed_by:
                                    type: object
                                    properties:
                                      count:
                                        type: number
                                        example: 12804266
                              edge_media_to_caption:
                                type: object
                                description: Video caption information
                                properties:
                                  edges:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        node:
                                          type: object
                                          properties:
                                            text:
                                              type: string
                                              example: >-
                                                I have the moves that they're looking
                                                for.
                                            created_at:
                                              type: string
                                              example: '1751404145'
                              edge_media_to_parent_comment:
                                type: object
                                description: Comments information
                                properties:
                                  count:
                                    type: number
                                    example: 487
                                  edges:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        node:
                                          type: object
                                          properties:
                                            id:
                                              type: string
                                              example: '18094151056886709'
                                            text:
                                              type: string
                                              example: Go for it sweetie!!!
                                            created_at:
                                              type: number
                                              example: 1762011704
                                            owner:
                                              type: object
                                              properties:
                                                username:
                                                  type: string
                                                  example: iam_carrongrazette
                              edge_media_preview_like:
                                type: object
                                description: Likes information
                                properties:
                                  count:
                                    type: number
                                    example: 27791
                              taken_at_timestamp:
                                type: number
                                example: 1751404144
                                description: Timestamp when the video was taken
                              dash_info:
                                type: object
                                description: DASH video information
                                properties:
                                  is_dash_eligible:
                                    type: boolean
                                    example: true
                                  video_dash_manifest:
                                    type: string
                                    example: <?xml version="1.0" encoding="UTF-8"?>...
                                    description: DASH manifest XML
                                  number_of_qualities:
                                    type: number
                                    example: 1
                              clips_music_attribution_info:
                                type: object
                                description: Music attribution information
                                properties:
                                  artist_name:
                                    type: string
                                    example: humansofny
                                  song_name:
                                    type: string
                                    example: Original audio
                                  uses_original_audio:
                                    type: boolean
                                    example: true
                                  audio_id:
                                    type: string
                                    example: '24313369781619226'
                        description: Instagram data object
                      extensions:
                        type: object
                        properties:
                          is_final:
                            type: boolean
                            example: true
                      status:
                        type: string
                        example: ok
                        description: Response status
                    description: Response data object containing Instagram metadata
                  success:
                    type: boolean
                    example: true
                    description: Indicates whether the operation was successful
                  failed:
                    type: boolean
                    example: false
                    description: Indicates whether the operation failed
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````