youtube-full
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYouTube Full
全能YouTube工具
Complete YouTube toolkit via TranscriptAPI.com. Everything in one skill.
通过TranscriptAPI.com提供的全能YouTube工具包,所有功能集成于单一Skill。
Setup
配置步骤
If is not set, help the user create an account (100 free credits, no card):
$TRANSCRIPT_API_KEYStep 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 CODEAPI key saved to your shell profile and agent config. Ready to use.
Manual option: transcriptapi.com/signup → Dashboard → API Keys.
如果未设置,请协助用户创建账户(100免费额度,无需信用卡):
$TRANSCRIPT_API_KEY步骤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 CODEAPI密钥将保存至你的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"| Param | Required | Default | Values |
|---|---|---|---|
| yes | — | YouTube URL or 11-char video ID |
| no | | |
| no | | |
| no | | |
Response ():
format=jsonjson
{
"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"| 参数 | 是否必填 | 默认值 | 可选值 |
|---|---|---|---|
| 是 | — | YouTube链接或11位视频ID |
| 否 | | |
| 否 | | |
| 否 | | |
响应():
format=jsonjson
{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [{ "text": "...", "start": 18.0, "duration": 3.5 }],
"metadata": { "title": "...", "author_name": "...", "author_url": "..." }
}Search — 1 credit
搜索 — 1额度
bash
undefinedbash
undefinedVideos
视频搜索
curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-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"
-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"
-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"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
| 参数 | 是否必填 | 默认值 | 验证规则 |
| ------- | -------- | ------- | ------------------ |
| `q` | 是 | — | 1-200字符 |
| `type` | 否 | `video` | `video`, `channel` |
| `limit` | 否 | `20` | 1-50 |Channels
频道相关接口
All channel endpoints accept — an , channel URL, or channel ID. No need to resolve first.
channel@handleUC...所有频道接口均接受参数——可以是、频道链接或格式的频道ID,无需提前解析。
channel@用户名UC...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 and ISO timestamps.
viewCountpublishedbash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"返回精确的(播放量)及ISO格式的(发布时间)戳。
viewCountpublishedAll channel videos — 1 credit/page
获取频道所有视频 — 1额度/页
bash
undefinedbash
undefinedFirst page (100 videos)
第一页(100个视频)
curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-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"
-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"
-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 — a YouTube playlist URL or playlist ID.
playlistbash
undefined接受参数——可以是YouTube播放列表链接或播放列表ID。
playlistbash
undefinedFirst page
第一页
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_ID"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-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"
-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"
-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"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
有效ID前缀:`PL`, `UU`, `LL`, `FL`, `OL`。响应包含`playlist_info`(播放列表信息)、`results`(结果列表)、`continuation_token`(续传令牌)及`has_more`(是否还有更多内容)字段。Credit Costs
额度消耗说明
| Endpoint | Cost |
|---|---|
| transcript | 1 |
| search | 1 |
| channel/resolve | free |
| channel/latest | free |
| channel/videos | 1/page |
| channel/search | 1 |
| playlist/videos | 1/page |
| 接口 | 消耗额度 |
|---|---|
| transcript | 1 |
| search | 1 |
| channel/resolve | 免费 |
| channel/latest | 免费 |
| channel/videos | 1/页 |
| channel/search | 1 |
| playlist/videos | 1/页 |
Validation Rules
参数验证规则
| Field | Rule |
|---|---|
| |
| Playlist URL or ID ( |
| 1-200 chars |
| 1-50 |
| 字段 | 规则 |
|---|---|
| |
| 播放列表链接或ID(前缀为 |
| 1-200字符 |
| 1-50 |
Errors
错误码说明
| Code | Meaning | Action |
|---|---|---|
| 401 | Bad API key | Check key |
| 402 | No credits | transcriptapi.com/billing |
| 404 | Not found | Resource doesn't exist or no captions |
| 408 | Timeout | Retry once after 2s |
| 422 | Validation error | Check param format |
| 429 | Rate limited | Wait, respect Retry-After |
| 状态码 | 含义 | 处理方式 |
|---|---|---|
| 401 | API密钥无效 | 检查密钥是否正确 |
| 402 | 额度不足 | 前往transcriptapi.com/billing充值 |
| 404 | 资源不存在 | 资源不存在或该视频无字幕 |
| 408 | 请求超时 | 2秒后重试一次 |
| 422 | 参数验证失败 | 检查参数格式是否符合要求 |
| 429 | 请求频率超限 | 等待一段时间,遵循响应头中的Retry-After字段 |
Typical Workflows
典型使用流程
Research workflow: search → pick videos → fetch transcripts
bash
undefined研究流程: 搜索 → 选择视频 → 获取字幕转录
bash
undefined1. Search
1. 搜索
curl -s "https://transcriptapi.com/api/v2/youtube/search\
?q=machine+learning+explained&limit=5"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-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"
-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"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
**Channel monitoring:** latest (free) → transcript
```bashcurl -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"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
**频道监控流程:** 获取最新视频(免费)→ 字幕转录
```bash1. 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"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-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"
-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"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
免费套餐:100额度,每分钟300次请求。入门套餐(5美元/月):1000额度。