YouTube Transcripts (via Apify)

io.github.retracnv1.0.0更新於 Oct 5, 2026

YouTube transcripts for AI agents: text and timestamps for any video, channel or playlist.

已驗證Streamable HTTP可網頁執行Media & DesignWeb Search & Scraping

概覽

AI 產生的概覽

取得公開的 YouTube 字幕,回傳文字與帶時間戳記的片段,支援影片、Shorts、頻道與播放清單。

功能
封裝了一個 Apify Actor,可依影片、Shorts、頻道或播放清單網址回傳 YouTube 逐字稿。每筆結果包含逐字稿文字、帶時間戳記的片段、字幕語言、是否為自動產生、可用字幕語言,以及標題、頻道、觀看次數、長度、說明與標籤。優先使用人工字幕,其次為自動產生的字幕,並提供盡力而為的翻譯。沒有字幕的影片會回傳 no_transcript。
適用情境
當助理需要 YouTube 影片的口述內容來做摘要、研究、筆記或內容分析時很實用。適合以現有字幕而非音訊轉錄為基礎的工作流程,並可在一次請求中處理頻道或播放清單。
執行需求
使用位於 mcp.apify.com 的遠端 MCP 端點,需要網路連線。需要免費的 Apify 帳號與 Apify API 權杖,透過 Authorization 標頭以 'Bearer ' 形式傳送。託管端點不需要本機執行環境或安裝套件。
安裝前請注意
Authorization 標頭帶有 Apify API 權杖,應視為機密,避免在共用設定中曝光。使用會產生費用:每 1,000 份逐字稿收費 1.50 美元,沒有字幕的影片免費,因此成本會隨用量增加。請求會把目標 YouTube 網址傳送到 Apify 平台,該 Actor 會擷取公開字幕。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 YouTube Transcripts (via Apify),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "youtube-transcripts": {
      "type": "http",
      "url": "https://mcp.apify.com/?tools=automationnation/youtube-transcript-scraper"
    }
  }
}

README

YouTube Transcript Scraper & API: captions and subtitles

[Run on Apify]

YouTube Transcript Scraper is an Apify Actor that returns the transcript of any YouTube video as plain text and timestamped segments, in any caption language, with the title, channel, views and duration. It accepts video, Shorts, channel and playlist URLs, costs $1.50 per 1,000 transcripts and charges nothing for videos without captions.

Price: $1.50 per 1,000 transcripts ($1.20 on Gold and above) · Run it: https://apify.com/automationnation/youtube-transcript-scraper · Guide: https://retracn.github.io/automationnation-actors/youtube-transcript-scraper/

Quick facts

  • One row per video: transcript text, timestamped segments, language, auto-generated flag, all caption languages, title, channel, views, duration, description and tags.
  • Videos, Shorts, channels and playlists (latest 15 videos).
  • Manual captions first, then auto-generated; best-effort translation.
  • Price: $1.50 per 1,000 transcripts; videos without captions are free.

Example input

json
{  "videos": [    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"  ],  "language": "en"}

Run it from code

REST API

bash
curl -X POST "https://api.apify.com/v2/acts/automationnation~youtube-transcript-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \  -H "Content-Type: application/json" \  -d '{"videos": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"], "language": "en"}'

Python — see examples/python_example.py

python
# pip install apify-clientfrom apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("automationnation/youtube-transcript-scraper").call(run_input={  "videos": [    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"  ],  "language": "en"})for item in client.dataset(run["defaultDatasetId"]).iterate_items():    print(item.get("title"), item.get("channel"), item.get("wordCount"), item.get("transcriptLanguage"))

JavaScript — see examples/node_example.mjs

js
// npm install apify-clientimport { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const run = await client.actor('automationnation/youtube-transcript-scraper').call({  "videos": [    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"  ],  "language": "en"});const { items } = await client.dataset(run.defaultDatasetId).listItems();for (const item of items) console.log(item.title, item.channel, item.wordCount, item.transcriptLanguage);

Use it with AI agents (MCP)

Hosted MCP server URL (Claude, ChatGPT, Cursor and other clients with remote MCP support):

https://mcp.apify.com?tools=automationnation/youtube-transcript-scraper

Local config for Claude Desktop / Cursor — mcp/claude_desktop_config.json:

json
{  "mcpServers": {    "youtube-transcript-scraper": {      "command": "npx",      "args": [        "-y",        "@apify/actors-mcp-server",        "--tools",        "automationnation/youtube-transcript-scraper"      ],      "env": {        "APIFY_TOKEN": "YOUR_APIFY_TOKEN"      }    }  }}

FAQ

Is there an official YouTube transcript API? The YouTube Data API only downloads captions for videos you own. YouTube Transcript Scraper returns public captions of any video.

Does it transcribe audio? No, it returns captions YouTube already has (manual or auto-generated); videos without captions come back as no_transcript and aren't charged.

More from AutomationNation


This repository holds usage examples. The scraper itself runs on the Apify platform; you need a free Apify account and API token. Examples are MIT licensed.

來源:README.md,提交 49d719e

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.0.0最新Oct 5, 2026