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

# Get YouTube transcript

> Returns the transcript of a YouTube video in the requested format. Identify the video by either `video_url` or `video_id`. Requires a **Basic** license. This route is rate limited.

Set `with_metadata: true` to include video metadata in the response — note that the **metadata fields require a Pro license**; a Basic key returns the transcript with an upgrade placeholder in `metadata`.



## OpenAPI

````yaml /api-reference/youtube/openapi.json post /youtube/transcript/v2
openapi: 3.1.0
info:
  title: Magic Meal Kits — YouTube API
  version: 1.0.0
  description: >-
    Pull a YouTube video's transcript (and optional metadata) in the format your
    automation needs. Backs the **MMK YouTube Transcript** Make.com app.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://{deployment}/api/v1
    description: Your Magic Meal Kits deployment
    variables:
      deployment:
        default: magic-meal-kits-xxxxx.run.app
        description: Your Cloud Run host (without protocol)
security:
  - ApiKeyAuth: []
tags:
  - name: Transcript
    description: Fetch a video transcript.
  - name: Metadata
    description: Fetch video metadata.
paths:
  /youtube/transcript/v2:
    post:
      tags:
        - Transcript
      summary: Get YouTube transcript
      description: >-
        Returns the transcript of a YouTube video in the requested format.
        Identify the video by either `video_url` or `video_id`. Requires a
        **Basic** license. This route is rate limited.


        Set `with_metadata: true` to include video metadata in the response —
        note that the **metadata fields require a Pro license**; a Basic key
        returns the transcript with an upgrade placeholder in `metadata`.
      operationId: getTranscriptV2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranscriptRequest'
            example:
              video_url: https://www.youtube.com/watch?v=dQw4w9WgXcQ
              format: json
              preferred_lang: en
              with_metadata: false
      responses:
        '200':
          description: Transcript result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptResponse'
              example:
                video_id: dQw4w9WgXcQ
                format: json
                content: >-
                  [{"text":"We're no strangers to
                  love","start":0.0,"duration":3.5}]
                success: true
                retry_info:
                  total_attempts: 1
                  failed_attempts: 0
        '400':
          description: Invalid request, missing video identifier, or unsupported format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptResponse'
        '404':
          description: Video or transcript not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptResponse'
        '504':
          description: Upstream timed out fetching the transcript
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptResponse'
components:
  schemas:
    TranscriptRequest:
      type: object
      description: Provide either `video_url` or `video_id`.
      properties:
        video_url:
          type: string
          description: Full YouTube URL. Use this or `video_id`.
        video_id:
          type: string
          description: 11-character YouTube video ID. Use this or `video_url`.
        preferred_lang:
          type: string
          description: >-
            Preferred caption language (ISO code, e.g. `en`, `ko`). Falls back
            to the default track when unavailable.
        format:
          type: string
          enum:
            - xml
            - json
            - vtt
            - srt
          default: xml
          description: Output format for `content`.
        with_metadata:
          type: boolean
          default: false
          description: >-
            Include video metadata in the response. Metadata fields require a
            Pro license.
    TranscriptResponse:
      type: object
      properties:
        video_id:
          type: string
        format:
          type: string
        content:
          type: string
          description: The transcript rendered in the requested `format`.
        success:
          type: boolean
        error:
          type: string
        metadata:
          $ref: '#/components/schemas/VideoMetadata'
        retry_info:
          $ref: '#/components/schemas/RetryInfo'
    VideoMetadata:
      type: object
      properties:
        title:
          type: string
        author_name:
          type: string
        author_url:
          type: string
        thumbnail_url:
          type: string
        thumbnail_maxres_url:
          type: string
        channel_id:
          type: string
        xml_feed_url:
          type: string
          description: Channel RSS feed URL.
        subscriber_count:
          type: string
        view_count:
          type: integer
          format: int64
        like_count:
          type: integer
          format: int64
        channel_handle:
          type: string
        date_published:
          type: string
          format: date-time
          nullable: true
        upload_date:
          type: string
          format: date-time
          nullable: true
    RetryInfo:
      type: object
      description: Diagnostics about transcript/metadata fetch attempts.
      properties:
        total_attempts:
          type: integer
        failed_attempts:
          type: integer
        errors:
          type: array
          items:
            type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Your deployment's API key (MMK_API_KEY).

````