# 中文影片逐字稿 · Chinese Video Transcript (AI fallback) (`blue59/youtube-chinese-transcript`) Actor

Get transcripts from YouTube videos - Chinese first. Only ~25-37% of Chinese videos have captions; this Actor transcribes the rest with AI.

- **URL**: https://apify.com/blue59/youtube-chinese-transcript.md
- **Developed by:** [Blue59](https://apify.com/blue59) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 caption transcript (字幕逐字稿)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 中文影片逐字稿 — 沒字幕也能抓逐字稿

**Get the transcript even when the video has no captions.** 以中文為核心,也支援其他語言 / Chinese-first, works for any language.

Other transcript scrapers fail on most Chinese videos, because most Chinese videos simply have no captions to scrape. We measured it: **only ~25–37% of Chinese YouTube videos have any caption track, and auto-captions are almost never generated for Chinese.** This Actor scrapes the captions when they exist — and transcribes the audio with AI when they don't.

### 你會拿到什麼 / What you get

- 📝 **完整逐字稿** — 有字幕就抓字幕（1–3 秒／支），沒有就 AI 轉錄。**Full transcript** either way.
- 🇹🇼 **中文優先** — 繁中 → 簡中 → 通用中文 → 英文，依序挑選最合適的字幕軌。**Traditional Chinese first**, configurable.
- ✅ **品質過濾** — 每筆結果都經過內容檢查：太短、錯誤頁、抓錯語言軌，一律標為失敗而非混入有效資料。**Quality-gated: bad results are reported as failures, never silently returned.**

### 範例輸出 / Example output

```json
{
  "videoId": "pDxi9MljStw",
  "url": "https://www.youtube.com/watch?v=pDxi9MljStw",
  "title": "EP103 很怕別人過得比我爽",
  "channel": "蔡康永",
  "duration": 3821,
  "uploadDate": "20260714",
  "viewCount": 284119,
  "language": "zh-Hans",
  "source": "caption:manual",
  "charCount": 26985,
  "transcript": "簡單的來講就是不放心 不放心 我不放心別人是不是在過比我爽的很多的生活…"
}
```

`source` 告訴你這筆是怎麼來的：`caption:manual`（人工字幕）／`caption:auto`（自動字幕）／`ai:groq-whisper-turbo`（AI 轉錄）。

### 輸入 / Input

| 欄位 | 說明 |
|---|---|
| `videoUrls` | 影片、頻道或播放清單網址（也接受 11 碼 ID）|
| `preferredLanguages` | 語言優先序，預設繁中優先 |
| `aiFallback` | 沒字幕時用 AI 轉錄（需 Groq 金鑰）|
| `maxItems` | 從頻道展開時的上限 |

### AI 補位怎麼開 / Enabling AI fallback

1. 到 [console.groq.com](https://console.groq.com) 申請免費金鑰（免費層每日 2,000 次）
2. 勾選 `aiFallback`，把金鑰貼進 `groqApiKey`

金鑰只在該次執行中使用，不會被儲存。Your key is used for that run only and never stored.

### 誰在用 / Who this is for

- **內容研究／競品分析** — 一次抓整個頻道的逐字稿做主題分析
- **AI 工作流餵料** — 給 RAG、摘要、問答系統的乾淨文字輸入
- **字幕與翻譯** — 拿到原文再自行翻譯或校對
- **無障礙** — 為沒有字幕的中文內容補上文字

### 技術細節 / Technical notes

字幕優先取 `json3` 結構化格式（最穩），退回 vtt/srt 並自動清掉時間軸標記。失敗依狀態碼分流重試（404 立即放棄、429 拉長等待、403/5xx 退避重試），錯誤分為 proxy／rate-limit／blocked／network／other 五類統計於執行報告。建議開啟代理：YouTube 會擋機房 IP。

# Actor input Schema

## `videoUrls` (type: `array`):

YouTube 影片、頻道或播放清單網址。也接受 11 碼影片 ID。Accepts video, channel, or playlist URLs.

## `maxItems` (type: `integer`):

從頻道或播放清單展開時的上限。Cap when expanding a channel or playlist.

## `preferredLanguages` (type: `array`):

依序尋找字幕軌，先找到先用。預設繁中優先。Tracks are tried in order; Traditional Chinese first by default.

## `aiFallback` (type: `boolean`):

實測:中文影片只有約 25-37% 有字幕。開啟後，沒有字幕的影片會下載音訊並用 Groq Whisper 轉錄。需填下方金鑰。Measured: only ~25-37% of Chinese videos have captions.

## `groqApiKey` (type: `string`):

只在開啟 AI 補位時需要。免費申請:https://console.groq.com (免費層每日 2,000 次)。你的金鑰不會被儲存。Only needed for AI fallback; free tier available.

## `minChars` (type: `integer`):

低於此字數視為抓取失敗，不列入結果(防止交出垃圾資料)。Results below this are treated as failures.

## `proxyConfiguration` (type: `object`):

建議開啟。YouTube 會擋機房 IP。Recommended - YouTube blocks datacenter IPs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "maxItems": 50,
  "preferredLanguages": [
    "zh-Hant",
    "zh-TW",
    "zh-HK",
    "zh-Hans",
    "zh-CN",
    "zh",
    "en"
  ],
  "aiFallback": false,
  "minChars": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `transcripts` (type: `string`):

所有結果(JSON)/ All results as JSON

## `transcriptsCsv` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("blue59/youtube-chinese-transcript").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"] }

# Run the Actor and wait for it to finish
run = client.actor("blue59/youtube-chinese-transcript").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ]
}' |
apify call blue59/youtube-chinese-transcript --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,blue59/youtube-chinese-transcript"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VABF3kunn6kopcdFr/builds/UkSTb3f8eBO6fUxQA/openapi.json
