{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript API: Subtitles, Captions & Whisper AI",
    "description": "Transcribe YouTube to text: transcripts, subtitles and captions from videos, Shorts, channels, playlists and search. Whisper AI speech-to-text for videos without captions (paid plans), translation, SRT/VTT and LLM chunks. Works with MCP agents and n8n. From $1.80 per 1,000.",
    "version": "0.3",
    "x-build-id": "R9UEuMEOCXfMWrwLc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/0xdevinci~youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-0xdevinci-youtube-transcript-scraper",
        "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/0xdevinci~youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-0xdevinci-youtube-transcript-scraper",
        "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/0xdevinci~youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-0xdevinci-youtube-transcript-scraper",
        "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": {
          "urls": {
            "title": "YouTube URLs (videos, Shorts, channels, playlists)",
            "type": "array",
            "description": "One link per line, in any mix and with no limit on how many. Videos: youtube.com/watch?v=..., youtube.com/shorts/..., youtu.be/..., embed links or bare video IDs. Channels: youtube.com/@handle, youtube.com/channel/UC..., /c/ and /user/ links, or a channel tab (/videos, /shorts, /streams). Playlists: youtube.com/playlist?list=.... A youtube.com/results?search_query=... link works as a search. A video found in several sources is processed once.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search YouTube",
            "type": "array",
            "description": "Optional. Search terms, one per line, e.g. \"retrieval augmented generation tutorial\". Each search gives up to \"Max videos per search\" videos in YouTube's relevance order. Only videos published after and Include Shorts apply here too.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Transcript languages (in order of preference)",
            "type": "array",
            "description": "Language codes, most wanted first, for example en, it, de, es, pt-BR. For each video the first language that has a transcript is used; human-made subtitles are preferred over automatic captions in the same language.",
            "items": {
              "type": "string"
            },
            "default": [
              "en"
            ]
          },
          "anyLanguageFallback": {
            "title": "Fall back to any available language",
            "type": "boolean",
            "description": "When none of your languages exists for a video, return the first transcript it has (uploader subtitles first) instead of failing with TranscriptNotFound. availableLanguages always lists what the video has.",
            "default": false
          },
          "translateTo": {
            "title": "Translate to",
            "pattern": "^$|^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})?$",
            "type": "string",
            "description": "Optional language code, e.g. it, en, es, de, fr, pt, ja. A native track in this language is used when the video has one; otherwise YouTube's automatic translation. Translation is guaranteed on paid Apify plans: if YouTube does not deliver it, an AI text model translates the segments keeping their timestamps (charged as ai-translation per started minute of video), and if even that fails you get the original transcript with a warning, free of charge. On the free plan, when YouTube does not deliver the translation you get the original transcript with a warning, charged as a normal transcript."
          },
          "aiTranslationFallback": {
            "title": "Translate with AI when YouTube cannot",
            "type": "boolean",
            "description": "Paid Apify plans: when YouTube does not deliver its automatic translation (it often rate-limits it), translate the transcript with an AI text model on Groq, keeping every timestamp. Charged as ai-translation per started minute of video, only after the translation succeeded and within your maximum cost per run. If the AI translation fails too, the original transcript is free. When you turn this off, the original transcript is delivered with a warning and charged normally.",
            "default": true
          },
          "outputFormat": {
            "title": "Transcript text format",
            "enum": [
              "json",
              "text",
              "markdown",
              "llm",
              "srt",
              "vtt"
            ],
            "type": "string",
            "description": "Format of the transcriptText field. The timestamped segments are always in the transcript field. json: one clean plain-text string. text: one caption line per row. markdown: a document with title, channel and paragraphs that link to the moment in the video. llm: clean text in blocks of about 1,000 tokens, each with start and end time (also in the chunks field). srt / vtt: subtitle files.",
            "default": "json"
          },
          "includeMetadata": {
            "title": "Include video title and channel",
            "type": "boolean",
            "description": "Adds title, channel, channelId and durationSeconds to each result. It comes from the same request as the transcript, so it costs nothing extra.",
            "default": true
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel or playlist",
            "minimum": 1,
            "type": "integer",
            "description": "How many videos to take from each channel or playlist link (newest first for channels). There is no upper limit: the run never lists more videos than your maximum cost per run can pay for. Single video links are always processed.",
            "default": 20
          },
          "maxVideosPerSearch": {
            "title": "Max videos per search",
            "minimum": 1,
            "type": "integer",
            "description": "How many videos to take from each search.",
            "default": 20
          },
          "publishedAfter": {
            "title": "Only videos published after",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^(\\d+)\\s*(day|week|month|year)s?$",
            "type": "string",
            "description": "Optional. Skip channel, playlist and search videos published before this date: a date (YYYY-MM-DD, UTC) or a relative period such as \"30 days\" or \"2 weeks\". Single video links are always processed."
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "When off, channels give only regular videos and live replays, and searches only regular videos. A /shorts channel tab link always gives Shorts. Playlists are taken as they are.",
            "default": true
          },
          "aiFallback": {
            "title": "Transcribe videos without subtitles with AI",
            "type": "boolean",
            "description": "For videos that have no subtitles at all, download the audio and transcribe it with Whisper (whisper-large-v3-turbo on Groq). Charged per started minute of audio, only after the transcription succeeded and within your maximum cost per run (the budget is set aside before the download); nothing is charged if the download or the transcription fails. Available on paid Apify plans.",
            "default": true
          },
          "maxAiMinutesPerVideo": {
            "title": "Max AI minutes per video",
            "minimum": 1,
            "type": "integer",
            "description": "Transcribe at most the first N minutes of each video with AI (you pay only for the minutes transcribed).",
            "default": 60
          },
          "skipAiOverMinutes": {
            "title": "Skip AI for videos longer than",
            "minimum": 1,
            "type": "integer",
            "description": "Videos without subtitles longer than this are not transcribed by AI at all (they fail with TranscriptNotFound and cost nothing).",
            "default": 120
          },
          "maxConcurrency": {
            "title": "Videos processed in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many videos are fetched at the same time. Higher is faster; lower is gentler on YouTube.",
            "default": 3
          },
          "url": {
            "title": "Single YouTube URL (API and AI agents)",
            "type": "string",
            "description": "One YouTube link: video, Shorts, youtu.be, channel or playlist. It is enough on its own to start a run, e.g. {\"url\": \"https://www.youtube.com/watch?v=UF8uR6Z6KLc\"}: every other setting keeps its default (English transcript, outputFormat json, title and channel included; on paid plans, videos without any subtitles are transcribed by AI, charged per minute: turn off aiFallback to avoid it). When YouTube URLs are filled in too, this link is processed first, together with them."
          },
          "compact": {
            "title": "Compact output",
            "type": "boolean",
            "description": "Each result has only url, videoId, title, language, transcriptText, status, errorCode, errorMessage and warning (plus the timestamped segments when Include segments is on). Fewer tokens for AI agents and fewer fields to map in workflows. Off: the full result with all 24 fields.",
            "default": false
          },
          "includeSegments": {
            "title": "Include segments in compact output",
            "type": "boolean",
            "description": "Compact output only: also return the timestamped segments in the transcript field (text, start and duration in seconds). The full output always includes them.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}