{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript API: Video Captions to Text & RAG Chunks",
    "description": "Get the transcript of any YouTube video, playlist or channel as clean text, timestamped segments and LLM-ready RAG chunks. Input: video URLs or IDs. Output: one JSON row per video with text, segments, chunks, chapters, language and status. Failed videos are free.",
    "version": "0.1",
    "x-build-id": "JBod6ZAXpsFwNNg8O"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plainprobe~youtube-transcript-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plainprobe-youtube-transcript-ai",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/plainprobe~youtube-transcript-ai/runs": {
      "post": {
        "operationId": "runs-sync-plainprobe-youtube-transcript-ai",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/plainprobe~youtube-transcript-ai/run-sync": {
      "post": {
        "operationId": "run-sync-plainprobe-youtube-transcript-ai",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "videos": {
            "title": "Videos, playlists or channels",
            "type": "array",
            "description": "One per line: video URLs or IDs (watch, youtu.be, Shorts, live), playlist URLs, channel URLs (/channel/UC…, /@handle) or search result URLs. Playlists and channels are expanded up to 'Max videos per playlist, channel or search'.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Optional. Each query is searched on YouTube (videos only) and the top results are transcribed.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "Max videos per playlist, channel or search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit of videos taken from each playlist, channel or search (1 to 1,000). Channels are listed newest first.",
            "default": 20
          },
          "preferredLanguages": {
            "title": "Preferred transcript languages",
            "type": "array",
            "description": "Language codes in order of preference (en, fr, es, pt-BR…). Uploaded captions are preferred over automatic ones in the same language. Leave empty to get the video's original language.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "languageFallback": {
            "title": "Fall back to the original language",
            "type": "boolean",
            "description": "If none of the preferred languages exists, return the original-language transcript (flagged languageMatched: false). Off: such videos get status language_unavailable and are not charged.",
            "default": true
          },
          "preferAutoCaptions": {
            "title": "Prefer automatic captions",
            "type": "boolean",
            "description": "Pick YouTube's automatic (speech-recognition) track before uploaded captions in the same language.",
            "default": false
          },
          "includeChunks": {
            "title": "RAG chunks",
            "type": "boolean",
            "description": "Add 'chunks': consecutive passages up to 'Chunk size', never crossing a chapter, each with start/end seconds, chapter title and a timestamped link for citations.",
            "default": true
          },
          "chunkMaxChars": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum characters per RAG chunk (200 to 20,000). 1,500 characters ≈ 350 tokens.",
            "default": 1500
          },
          "includeSegments": {
            "title": "Timestamped segments",
            "type": "boolean",
            "description": "Add 'segments': every caption line with start and duration in seconds.",
            "default": true
          },
          "includeMarkdown": {
            "title": "Markdown",
            "type": "boolean",
            "description": "Add 'markdown': a readable document with metadata, chapter headings and [m:ss] paragraph timestamps.",
            "default": false
          },
          "includeSrt": {
            "title": "SRT subtitles",
            "type": "boolean",
            "description": "Add 'srt': the transcript as an SRT subtitle file (string).",
            "default": false
          },
          "includeVtt": {
            "title": "WebVTT subtitles",
            "type": "boolean",
            "description": "Add 'vtt': the transcript as a WebVTT file (string).",
            "default": false
          },
          "includeDescription": {
            "title": "Video description",
            "type": "boolean",
            "description": "Add the full video description.",
            "default": true
          },
          "includePublishDate": {
            "title": "Publish date and category",
            "type": "boolean",
            "description": "Add publishDate and category (one extra light request per video).",
            "default": true
          },
          "cleanText": {
            "title": "Remove sound annotations",
            "type": "boolean",
            "description": "Remove [Music], [Applause], ♪ and similar annotations from the text and segments.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel videos",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Videos processed at the same time (1 to 20).",
            "default": 5
          },
          "outputFormat": {
            "title": "Output field names",
            "enum": [
              "auto",
              "plainprobe",
              "johnvc",
              "starvibe"
            ],
            "type": "string",
            "description": "Switching from another transcript Actor? Send your existing input unchanged (youtube_url, channel, channel_url, languages, language, max_videos, output_formats are understood) and the output also carries that Actor's field names (video_id, timestamped, non_timestamped, transcript_text, ...). Our own fields are always kept.",
            "default": "auto"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}