{
  "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": "pHgY9whLio0XtKd2K"
  },
  "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": "每次執行最多處理幾支(含頻道/播放清單展開)。能不能全部做完也取決於 Apify 設定的執行逾時;批次大時請拉長逾時或分批。逾時前會自動收尾:已完成的結果保留;AI 轉錄到一半的影片只交已完成的音訊段,標為部分稿(partial)、本 Actor 不收費;另有一列狀態說明與 RUN_STATUS。被平台強制終止時可能來不及寫入。Upper limit on videos selected per run, including expanded channels/playlists. Completion also depends on the run timeout configured in Apify; larger batches may require a longer timeout or smaller batches. Processing stops before the run timeout: finished results are retained; available validated audio-chunk prefixes are marked partial and are not charged by this Actor; an early-stop status row and RUN_STATUS explain incomplete work. Forced termination may prevent final writes.",
            "default": 50
          },
          "preferredLanguages": {
            "title": "語言優先序 / Language preference",
            "type": "array",
            "description": "人工字幕先做整份偏好清單的精確比對，再做同語系比對；預設繁中、簡中、通用中文、英文。自動字幕預設先用 -orig 標記或影片語言找原文軌；若兩者都無法辨識，仍會照偏好表挑選，可能取得 YouTube 機器翻譯。把 autoCaptionOriginalLanguage 關掉會直接照偏好表挑。Manual captions use exact matches across the preference list, then language-family matches. Auto-captions prefer original-language signals by default; without those signals, preference selection may include YouTube machine translation. This Actor does not itself translate.",
            "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": "開(預設)：自動字幕先保留帶 -orig 標記的原文軌，沒有標記時用影片語言欄位；兩者都無法辨識時，退回整張自動字幕表依語言偏好挑，仍可能是機器翻譯。關：直接依語言偏好挑自動字幕。人工字幕選擇不受影響。On (default): prefer -orig tracks, then the video's language. If neither identifies an original track, fall back to the full auto-caption table and language preferences, possibly including machine translation. Off: use language preferences directly. Manual-caption selection is unchanged.",
            "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": "AI 補位須自備 Groq 金鑰填入 groqApiKey，並開啟此選項；一般設定預設不啟用。沒有選到可用字幕軌時才下載音訊，用 Whisper 轉錄；字幕下載或文字驗證失敗不會自動切到 AI。AI fallback requires your own Groq key in groqApiKey and this option enabled in the standard configuration. Audio is transcribed only when no caption track is selected; caption download/validation failure does not trigger AI. Completed AI results use ai-result, without an Actor per-minute event; your Groq account usage is separate."
          },
          "groqApiKey": {
            "title": "Groq API 金鑰 / Groq API key",
            "type": "string",
            "description": "AI 補位需要你自己的 Groq 金鑰，並開啟 aiFallback；字幕擷取不需要。申請與方案限制見 https://console.groq.com 。Groq 帳戶用量另計；不要把金鑰貼進範例或問題回報。Your own Groq key is required for AI fallback in the standard configuration; enable aiFallback too. Caption extraction needs no key. See Groq for account limits and separate usage charges."
          },
          "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
            }
          },
          "languageHint": {
            "title": "AI 語音語言（選填）/ Spoken language (optional)",
            "type": "string",
            "description": "只用於 AI，不影響字幕選軌；留空維持自動辨識。 Chinese cleanup with chineseScript=auto: zh/zh-CN/zh-Hans use Simplified; zh-TW/zh-Hant/zh-HK use Traditional with Taiwan usage. Without a hint, confirmed Chinese uses Simplified. chineseScript can override the script for Chinese only. 中文整理預設：zh/zh-CN/zh-Hans 與自動判中用簡體；zh-TW/zh-Hant/zh-HK 用繁體與台灣用語；可用 chineseScript 覆寫中文字體。"
          },
          "chineseTranscriptCleanup": {
            "title": "中文 AI 轉錄整理 / Chinese AI transcript cleanup",
            "type": "boolean",
            "description": "預設開：中文 AI 加繁簡與標點提示詞，並移除段首／段尾完整符合清單的已知幻覺句，移除數寫入 log。自動模式多一次最多 30 秒的語言辨識請求（Groq 每次至少計 10 秒）；正式英文轉錄欄位不變。關閉保留原始 AI 路徑，不加提示詞、不探測、不過濾。字幕來源與 Actor 計費不變。On by default: Chinese AI style/punctuation prompts and exact edge-only known-phrase removal, with counts in logs. Auto mode adds one language probe of up to 30 seconds (Groq minimum 10 seconds per request). English production fields are unchanged. Off keeps the original AI path with no prompt, probe or filter. Caption sources and Actor billing are unchanged.",
            "default": true
          },
          "chineseScript": {
            "title": "中文 AI 字體 / Chinese AI script",
            "enum": [
              "auto",
              "simplified",
              "traditional"
            ],
            "type": "string",
            "description": "預設 auto：自動判中或 languageHint=zh/zh-CN/zh-Hans 用簡體與標點；只有明確 zh-TW/zh-Hant/zh-HK 用繁體與台灣用語。香港、台灣客人可選 traditional 強制繁體，或維持 auto 並指定上述繁體語言碼；simplified 強制簡體。強制選項優先於中文 languageHint，但不強制語言、不翻譯英文等其他語言。只影響 AI，不改平台字幕；chineseTranscriptCleanup=false 時此欄無效。 Default auto: detected Chinese and zh/zh-CN/zh-Hans use Simplified with punctuation; explicit zh-TW/zh-Hant/zh-HK use Traditional with Taiwan usage. Hong Kong/Taiwan users can select traditional, or keep auto and set a Traditional language hint. simplified forces Simplified. Overrides Chinese hint script only, never language or non-Chinese text. AI only; captions are unchanged. Ignored when chineseTranscriptCleanup=false.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}