youtube-full

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

YouTube Full

全能YouTube工具

Complete YouTube toolkit via TranscriptAPI.com. Everything in one skill.
通过TranscriptAPI.com提供的全能YouTube工具包,所有功能集成于单一Skill。

Setup

配置步骤

If
$TRANSCRIPT_API_KEY
is not set, help the user create an account (100 free credits, no card):
Step 1 — Register: Ask user for their email.
bash
node ./scripts/tapi-auth.js register --email USER_EMAIL
→ OTP sent to email. Ask user: "Check your email for a 6-digit verification code."
Step 2 — Verify: Once user provides the OTP:
bash
node ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODE
API key saved to your shell profile and agent config. Ready to use.
Manual option: transcriptapi.com/signup → Dashboard → API Keys.
如果未设置
$TRANSCRIPT_API_KEY
,请协助用户创建账户(100免费额度,无需信用卡):
步骤1 — 注册: 向用户索要邮箱。
bash
node ./scripts/tapi-auth.js register --email USER_EMAIL
→ 验证码将发送至该邮箱。询问用户:"请查收邮箱中的6位验证码。"
步骤2 — 验证: 用户提供验证码后:
bash
node ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODE
API密钥将保存至你的Shell配置文件及Agent配置中,即可开始使用。
手动注册选项:transcriptapi.com/signup → 控制台 → API密钥。

API Reference

API参考文档

Full OpenAPI spec: transcriptapi.com/openapi.json — consult this for the latest parameters and schemas.
完整OpenAPI规范:transcriptapi.com/openapi.json — 请查阅该文档获取最新参数及数据结构。

Transcript — 1 credit

字幕转录 — 1额度

bash
curl -s "https://transcriptapi.com/api/v2/youtube/transcript\
?video_url=VIDEO_URL&format=text&include_timestamp=true&send_metadata=true" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
ParamRequiredDefaultValues
video_url
yesYouTube URL or 11-char video ID
format
no
json
json
,
text
include_timestamp
no
true
true
,
false
send_metadata
no
false
true
,
false
Response (
format=json
):
json
{
  "video_id": "dQw4w9WgXcQ",
  "language": "en",
  "transcript": [{ "text": "...", "start": 18.0, "duration": 3.5 }],
  "metadata": { "title": "...", "author_name": "...", "author_url": "..." }
}
bash
curl -s "https://transcriptapi.com/api/v2/youtube/transcript\
?video_url=VIDEO_URL&format=text&include_timestamp=true&send_metadata=true" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
参数是否必填默认值可选值
video_url
YouTube链接或11位视频ID
format
json
json
,
text
include_timestamp
true
true
,
false
send_metadata
false
true
,
false
响应
format=json
):
json
{
  "video_id": "dQw4w9WgXcQ",
  "language": "en",
  "transcript": [{ "text": "...", "start": 18.0, "duration": 3.5 }],
  "metadata": { "title": "...", "author_name": "...", "author_url": "..." }
}

Search — 1 credit

搜索 — 1额度

bash
undefined
bash
undefined

Videos

视频搜索

curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Channels

频道搜索

curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=channel&limit=10"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

| Param   | Required | Default | Validation         |
| ------- | -------- | ------- | ------------------ |
| `q`     | yes      | —       | 1-200 chars        |
| `type`  | no       | `video` | `video`, `channel` |
| `limit` | no       | `20`    | 1-50               |
curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=channel&limit=10"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

| 参数   | 是否必填 | 默认值 | 验证规则         |
| ------- | -------- | ------- | ------------------ |
| `q`     | 是      | —       | 1-200字符        |
| `type`  | 否       | `video` | `video`, `channel` |
| `limit` | 否       | `20`    | 1-50               |

Channels

频道相关接口

All channel endpoints accept
channel
— an
@handle
, channel URL, or
UC...
channel ID. No need to resolve first.
所有频道接口均接受
channel
参数——可以是
@用户名
、频道链接或
UC...
格式的频道ID,无需提前解析。

Resolve handle — FREE

解析用户名 — 免费

bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
Response:
{"channel_id": "UC...", "resolved_from": "@TED"}
bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
响应:
{"channel_id": "UC...", "resolved_from": "@TED"}

Latest 15 videos — FREE

获取最新15个视频 — 免费

bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
Returns exact
viewCount
and ISO
published
timestamps.
bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
返回精确的
viewCount
(播放量)及ISO格式的
published
(发布时间)戳。

All channel videos — 1 credit/page

获取频道所有视频 — 1额度/页

bash
undefined
bash
undefined

First page (100 videos)

第一页(100个视频)

curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Next pages

后续分页

curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?continuation=TOKEN"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Provide exactly one of `channel` or `continuation`. Response includes `continuation_token` and `has_more`.
curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?continuation=TOKEN"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

需提供`channel`或`continuation`二者之一。响应包含`continuation_token`(续传令牌)及`has_more`(是否还有更多内容)字段。

Search within channel — 1 credit

频道内搜索 — 1额度

bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=QUERY&limit=30" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=QUERY&limit=30" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Playlists — 1 credit/page

播放列表 — 1额度/页

Accepts
playlist
— a YouTube playlist URL or playlist ID.
bash
undefined
接受
playlist
参数——可以是YouTube播放列表链接或播放列表ID。
bash
undefined

First page

第一页

curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_ID"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_ID"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Next pages

后续分页

curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Valid ID prefixes: `PL`, `UU`, `LL`, `FL`, `OL`. Response includes `playlist_info`, `results`, `continuation_token`, `has_more`.
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

有效ID前缀:`PL`, `UU`, `LL`, `FL`, `OL`。响应包含`playlist_info`(播放列表信息)、`results`(结果列表)、`continuation_token`(续传令牌)及`has_more`(是否还有更多内容)字段。

Credit Costs

额度消耗说明

EndpointCost
transcript1
search1
channel/resolvefree
channel/latestfree
channel/videos1/page
channel/search1
playlist/videos1/page
接口消耗额度
transcript1
search1
channel/resolve免费
channel/latest免费
channel/videos1/页
channel/search1
playlist/videos1/页

Validation Rules

参数验证规则

FieldRule
channel
@handle
, channel URL, or
UC...
ID
playlist
Playlist URL or ID (
PL
/
UU
/
LL
/
FL
/
OL
prefix)
q
1-200 chars
limit
1-50
字段规则
channel
@用户名
、频道链接或
UC...
格式ID
playlist
播放列表链接或ID(前缀为
PL
/
UU
/
LL
/
FL
/
OL
q
1-200字符
limit
1-50

Errors

错误码说明

CodeMeaningAction
401Bad API keyCheck key
402No creditstranscriptapi.com/billing
404Not foundResource doesn't exist or no captions
408TimeoutRetry once after 2s
422Validation errorCheck param format
429Rate limitedWait, respect Retry-After
状态码含义处理方式
401API密钥无效检查密钥是否正确
402额度不足前往transcriptapi.com/billing充值
404资源不存在资源不存在或该视频无字幕
408请求超时2秒后重试一次
422参数验证失败检查参数格式是否符合要求
429请求频率超限等待一段时间,遵循响应头中的Retry-After字段

Typical Workflows

典型使用流程

Research workflow: search → pick videos → fetch transcripts
bash
undefined
研究流程: 搜索 → 选择视频 → 获取字幕转录
bash
undefined

1. Search

1. 搜索

curl -s "https://transcriptapi.com/api/v2/youtube/search\ ?q=machine+learning+explained&limit=5"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/search\ ?q=machine+learning+explained&limit=5"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

2. Transcript

2. 获取字幕转录

curl -s "https://transcriptapi.com/api/v2/youtube/transcript\ ?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=true"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

**Channel monitoring:** latest (free) → transcript

```bash
curl -s "https://transcriptapi.com/api/v2/youtube/transcript\ ?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=true"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

**频道监控流程:** 获取最新视频(免费)→ 字幕转录

```bash

1. Latest uploads (free — pass @handle directly)

1. 获取最新上传视频(免费 — 直接传入@用户名)

curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

2. Transcript of latest

2. 获取最新视频的字幕转录

curl -s "https://transcriptapi.com/api/v2/youtube/transcript\ ?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=true"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

Free tier: 100 credits, 300 req/min. Starter ($5/mo): 1,000 credits.
curl -s "https://transcriptapi.com/api/v2/youtube/transcript\ ?video_url=VIDEO_ID&format=text&include_timestamp=true&send_metadata=true"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"

免费套餐:100额度,每分钟300次请求。入门套餐(5美元/月):1000额度。