{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper · Chinese-first, AI fallback",
    "description": "Get transcripts from YouTube videos - Chinese first. Only ~25-37% of Chinese videos have captions; this Actor transcribes the rest with AI.",
    "version": "0.1",
    "x-build-id": "NpwgfeRmNGbCKC8zx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blue59~youtube-chinese-transcript/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blue59-youtube-chinese-transcript",
        "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/blue59~youtube-chinese-transcript/runs": {
      "post": {
        "operationId": "runs-sync-blue59-youtube-chinese-transcript",
        "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/blue59~youtube-chinese-transcript/run-sync": {
      "post": {
        "operationId": "run-sync-blue59-youtube-chinese-transcript",
        "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",
        "required": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "影片網址 / Video URLs",
            "type": "array",
            "description": "YouTube 影片、頻道或播放清單網址。也接受 11 碼影片 ID。Accepts video, channel, or playlist URLs.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "最多處理幾支 / Max videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "從頻道或播放清單展開時的上限。Cap when expanding a channel or playlist.",
            "default": 50
          },
          "preferredLanguages": {
            "title": "語言優先序 / Language preference",
            "type": "array",
            "description": "人工字幕依序尋找，先找到先用，預設繁中優先。只有自動字幕的影片，預設給影片原本講的語言（見下方「自動字幕給原文」選項，關閉後才照此順序挑，可能是 YouTube 機器翻譯軌）。Human-made caption tracks are tried in order (Traditional Chinese first by default). For videos with only auto-captions, the spoken language is returned by default — see the option below.",
            "default": [
              "zh-Hant",
              "zh-TW",
              "zh-HK",
              "zh-Hans",
              "zh-CN",
              "zh",
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "autoCaptionOriginalLanguage": {
            "title": "自動字幕給原文 / Auto-captions in original language",
            "type": "boolean",
            "description": "只影響「只有自動字幕」的影片。開(預設)=給影片原本講的語言(英文影片給英文、日文影片給日文),不給 YouTube 的機器翻譯軌。關=照上方語言優先序挑,英文影片可能拿到 YouTube 機器翻譯的中文。人工字幕不受影響。Only affects videos that have auto-captions only. On (default): return the language actually spoken, skipping YouTube's machine-translated tracks. Off: pick by Language preference, which may return a machine-translated track (e.g. Chinese for an English video). Human-made captions are unaffected.",
            "default": true
          },
          "subtitleFormats": {
            "title": "字幕檔輸出 / Subtitle files (SRT / VTT)",
            "type": "array",
            "description": "另外產出帶時間軸的字幕檔:可選 SRT、WebVTT。每筆結果會多 `segments`(起訖秒數+文字)與 `srt`/`vtt` 欄位,免費附加不另收費。留空=只要純文字逐字稿。來源沒有時間軸時會附 `subtitleNote` 說明。Free add-on: timestamped subtitle files plus `segments`. Leave empty for plain transcripts only.",
            "items": {
              "type": "string",
              "enum": [
                "srt",
                "vtt"
              ],
              "enumTitles": [
                "SRT (.srt)",
                "WebVTT (.vtt)"
              ]
            },
            "default": []
          },
          "aiFallback": {
            "title": "沒字幕時用 AI 轉錄 / AI fallback when no captions",
            "type": "boolean",
            "description": "實測:中文影片只有約 25-37% 有字幕。開啟後，沒有字幕的影片會下載音訊並用 Groq Whisper 轉錄。需填下方金鑰。Measured: only ~25-37% of Chinese videos have captions. Requires your Groq key below."
          },
          "groqApiKey": {
            "title": "Groq API 金鑰 / Groq API key",
            "type": "string",
            "description": "只在開啟 AI 補位時需要。免費申請:https://console.groq.com (免費層每日 2,000 次)。你的金鑰不會被儲存。Only needed for AI fallback; free tier available. Never stored."
          },
          "minChars": {
            "title": "最少字數 / Minimum characters",
            "minimum": 0,
            "type": "integer",
            "description": "低於此字數視為抓取失敗，不列入結果(防止交出垃圾資料)。Results below this are treated as failures.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "代理設定 / Proxy",
            "type": "object",
            "description": "建議開啟。YouTube 會擋機房 IP。Recommended - YouTube blocks datacenter IPs.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}