{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Extractor",
    "description": "YouTube transcripts from videos, playlists, channels or a search, in any language: text, SRT, VTT, JSON, RAG-ready chunks and chapters. Auto-translation, free language check, failed videos are free.",
    "version": "0.0",
    "x-build-id": "3k42AKIAhbutUKT4o"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lsso~youtube-transcript-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lsso-youtube-transcript-extractor",
        "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/lsso~youtube-transcript-extractor/runs": {
      "post": {
        "operationId": "runs-sync-lsso-youtube-transcript-extractor",
        "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/lsso~youtube-transcript-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-lsso-youtube-transcript-extractor",
        "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": {
          "videoUrls": {
            "title": "YouTube videos, playlists or channels",
            "type": "array",
            "description": "Video URLs (watch, youtu.be, shorts, live), video IDs, playlist URLs, or channel URLs / @handles. Playlists and channels are expanded automatically (newest first for channels). Optional if you use *Search YouTube*.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search YouTube (optional)",
            "type": "array",
            "description": "Search terms, e.g. `andrej karpathy llm`. The top videos for each search are added to the run (relevance order), so you don't need to collect URLs first.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Videos per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many videos to take from each search.",
            "default": 20
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Language codes in order of preference, e.g. `en`, `es`, `ko`, `ja`, `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional), `pt-BR`. If the video has no captions in these languages and *Translate* is on, the transcript is translated into the first one. Leave empty to get the video's original language.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "translate": {
            "title": "Translate when the language is missing",
            "type": "boolean",
            "description": "When none of the preferred languages exists for a video, translate the captions into the first preferred language (~100 languages). YouTube's own translation is tried first; when YouTube rate-limits it (common), the original captions are translated with Google Translate, keeping every timestamp. The output field `translationEngine` says which one was used.",
            "default": true
          },
          "outputFormats": {
            "title": "Output formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Which fields to include per video: `text` (plain transcript), `segments` (timed cues as JSON), `timestamped` (`[mm:ss] text` lines), `paragraphs` (readable ~1-minute paragraphs), `srt`, `vtt`, `chunks` (RAG-ready ~300-word pieces with start/end time and a deep link), `chapters` (transcript split by the video's chapters, when the description has them).",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "segments",
                "timestamped",
                "paragraphs",
                "srt",
                "vtt",
                "chunks",
                "chapters"
              ],
              "enumTitles": [
                "Plain text",
                "Timed segments (JSON)",
                "Timestamped text",
                "Paragraphs",
                "SRT subtitles",
                "WebVTT subtitles",
                "RAG chunks (for AI / vector DBs)",
                "Text per chapter"
              ]
            },
            "default": [
              "text",
              "segments"
            ]
          },
          "chunkWords": {
            "title": "Words per chunk",
            "minimum": 50,
            "maximum": 5000,
            "type": "integer",
            "description": "Target size of each item in `chunks` (CJK characters count as words). Chunks end at caption boundaries.",
            "default": 300
          },
          "listLanguagesOnly": {
            "title": "Only list available caption languages (free)",
            "type": "boolean",
            "description": "Don't download transcripts; just return each video's caption tracks (language, human/auto, translatable) and metadata. Not charged — use it to check what exists before a big run.",
            "default": false
          },
          "preferManual": {
            "title": "Prefer human-made captions",
            "type": "boolean",
            "description": "When both human-uploaded and auto-generated captions exist, pick the human-made ones.",
            "default": true
          },
          "includeAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Turn off to return only human-made captions (videos with auto-captions only will be reported as having no transcript).",
            "default": true
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper limit of videos processed in this run (applies after expanding playlists and channels).",
            "default": 50
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos to process in parallel.",
            "default": 5
          },
          "maxRetries": {
            "title": "Retries per video",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Each retry uses a fresh proxy session and a different YouTube client.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "YouTube blocks datacenter IPs, so Apify residential proxies are used by default. Proxy traffic is tiny (about 0.3 MB per video).",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}