> ## 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 Caption

> Get Instagram video caption.

<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 generate visual captions 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:** Base fee ($0.01/video) + Input tokens ($0.45/1M) + Output tokens ($3.75/1M) + Duration ($0.0001/sec)
</Note>

<Warning>
  This is an **asynchronous** endpoint. It returns a `task_id` immediately. You must configure a [Webhook](/visual-intelligence/getting-started/webhooks) to receive the processing results.

  If no webhook is configured on the account, the call is **rejected at submit time** with `HTTP 400`:

  ```json theme={null}
  {"code": 400, "msg": "An async request requires at least one webhook.", "data": null}
  ```

  Also accepts Reel URLs only — `/p/<shortcode>/` post URLs fail validation, same as `/instagram/video/metadata`.
</Warning>

### 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_caption(video_url: str):
      url = f"{BASE_URL}/instagram/video/mai/transcript"
      data = {"video_url": video_url}
      resp = requests.post(url, headers=HEADERS, json=data)
      return resp.json()

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

### Response

Returns the caption task information.

<ResponseExample>
  ```json Response theme={null}
  {
    "code": 200,
    "msg": "success",
    "data": {
      "task_id": "1cd78354af824c8eb1dafe4ed2435720"
    },
    "failed": false,
    "success": true
  }
  ```

  ```json Callback Response theme={null}
  {
    "code": 200,
    "message": "SUCCESS",
    "data": {
      "videoTranscript": {
        "data": {
          "data": [
            {
              "end_time": 9.0,
              "start_time": 0.0,
              "transcript": "A man with a tan, wearing a straw hat, sunglasses, black swim briefs, and lime green slides, stands on a sandy beach. He holds a red plastic cup in his left hand and gestures with his right hand as he speaks. The beach stretches behind him with distant trees and a few scattered people. He talks about having gastric bypass ten years ago and gaining some weight back."
            },
            {
              "end_time": 15.0,
              "start_time": 9.0,
              "transcript": "The man continues to speak on the beach, holding the red cup. He gestures with his right hand as he explains his biggest goal is to go on Dancing with the Stars and perform."
            },
            {
              "end_time": 22.0,
              "start_time": 15.0,
              "transcript": "The man on the beach, still in his straw hat and swim briefs, points his right index finger upwards and then gestures with his hands as he explains that he has the qualities and basics of what they look for in Dancing with the Stars."
            }
          ],
          "error_rate": 0.0,
          "usage_metadata": {
            "duration": 0.0,
            "model": "gemini-2.5-flash",
            "output_tokens": 813,
            "prompt_tokens": 15160
          }
        },
        "msg": "Video transcription completed successfully",
        "success": true
      },
      "audioTranscript": {
        "data": {
          "data": [
            {
              "end_time": 2.44,
              "speaker": null,
              "start_time": 0.0,
              "text": " I'm going to get a little personal."
            },
            {
              "end_time": 6.4,
              "speaker": null,
              "start_time": 2.44,
              "text": " I had gastric bypass 10 years ago."
            },
            {
              "end_time": 8.16,
              "speaker": null,
              "start_time": 6.4,
              "text": " I gained a little more."
            }
          ],
          "usage_metadata": {
            "duration": 41.235782,
            "model": "whisper-1",
            "output_tokens": 0,
            "prompt_tokens": 0
          }
        },
        "msg": "ASR transcription completed successfully",
        "success": true
      }
    },
    "task_id": "8b4e80ea9774438c83b681dc427a310c"
  }
  ```
</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 task information |
| data.task\_id | string  | Unique identifier of the caption task            |
| success       | boolean | Indicates whether the operation was successful   |
| failed        | boolean | Indicates whether the operation failed           |

### Callback Response Parameters

When the Instagram video caption generation is complete, a callback will be sent to your configured webhook URL.

| Parameter                                                | Type           | Description                                                                     |
| -------------------------------------------------------- | -------------- | ------------------------------------------------------------------------------- |
| code                                                     | string         | Response code (200 indicates success)                                           |
| message                                                  | string         | Status message (e.g., "SUCCESS")                                                |
| data                                                     | object         | Response data object containing both video and audio transcription results      |
| data.videoTranscript                                     | object         | Video transcription result object                                               |
| data.videoTranscript.data                                | object         | Inner data object containing video caption segments and usage information       |
| data.videoTranscript.data.data                           | array          | Array of video caption segments with timestamps                                 |
| data.videoTranscript.data.data\[].start\_time            | number         | Start time of the video segment in seconds                                      |
| data.videoTranscript.data.data\[].end\_time              | number         | End time of the video segment in seconds                                        |
| data.videoTranscript.data.data\[].transcript             | string         | Video transcription text describing the visual content                          |
| data.videoTranscript.data.error\_rate                    | number         | Error rate of the video caption (0.0 means no errors)                           |
| data.videoTranscript.data.usage\_metadata                | object         | Usage statistics for the video caption                                          |
| data.videoTranscript.data.usage\_metadata.duration       | number         | Processing duration in seconds                                                  |
| data.videoTranscript.data.usage\_metadata.model          | string         | The AI model used for video caption (e.g., "gemini-2.5-flash")                  |
| data.videoTranscript.data.usage\_metadata.output\_tokens | integer        | Number of tokens in the generated video caption                                 |
| data.videoTranscript.data.usage\_metadata.prompt\_tokens | integer        | Number of tokens in the input prompt                                            |
| data.videoTranscript.msg                                 | string         | Detailed message about the video caption result                                 |
| data.videoTranscript.success                             | boolean        | Indicates whether the video caption was successful                              |
| data.audioTranscript                                     | object         | Audio transcription result object                                               |
| data.audioTranscript.data                                | object         | Inner data object containing audio transcription segments and usage information |
| data.audioTranscript.data.data                           | array          | Array of audio transcription segments with timestamps                           |
| data.audioTranscript.data.data\[].start\_time            | number         | Start time of the audio segment in seconds                                      |
| data.audioTranscript.data.data\[].end\_time              | number         | End time of the audio segment in seconds                                        |
| data.audioTranscript.data.data\[].text                   | string         | Audio transcription text for this segment                                       |
| data.audioTranscript.data.data\[].speaker                | string \| null | Speaker identifier (null if speaker identification not enabled)                 |
| data.audioTranscript.data.usage\_metadata                | object         | Usage statistics for the audio transcription                                    |
| data.audioTranscript.data.usage\_metadata.duration       | number         | Audio duration in seconds                                                       |
| data.audioTranscript.data.usage\_metadata.model          | string         | The model used for audio transcription (e.g., "whisper-1")                      |
| data.audioTranscript.data.usage\_metadata.output\_tokens | integer        | Number of output tokens (0 for audio transcription)                             |
| data.audioTranscript.data.usage\_metadata.prompt\_tokens | integer        | Number of prompt tokens (0 for audio transcription)                             |
| data.audioTranscript.msg                                 | string         | Detailed message about the audio transcription result                           |
| data.audioTranscript.success                             | boolean        | Indicates whether the audio transcription was successful                        |
| task\_id                                                 | string         | The task ID associated with this transcription request                          |


## OpenAPI

````yaml POST /instagram/video/mai/transcript
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/mai/transcript:
    post:
      summary: Instagram Video Caption
      description: Get Instagram video caption.
      operationId: instagram_video_mai_transcript
      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/
              required:
                - video_url
      responses:
        '200':
          description: Transcription task information
          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:
                      task_id:
                        type: string
                        example: 1cd78354af824c8eb1dafe4ed2435720
                        description: Unique identifier of the transcription task
                    description: Response data object containing task information
                  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

````