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