yt
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseyt
yt
Quick YouTube lookup via TranscriptAPI.com.
通过TranscriptAPI.com快速查询YouTube内容。
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→ 验证码(OTP)将发送至邮箱。询问用户:"请查看您的邮箱,获取6位验证码。"
步骤2 — 验证: 用户提供OTP后:
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"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"Search — 1 credit
搜索视频 — 1个额度
bash
curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=10" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"| Param | Default | Values |
|---|---|---|
| — | 1-200 chars (required) |
| | |
| | 1-50 |
bash
curl -s "https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=10" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"| 参数 | 默认值 | 可选值 |
|---|---|---|
| — | 1-200字符(必填) |
| | |
| | 1-50 |
Channel latest — FREE
获取频道最新内容 — 免费
bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"Returns last 15 videos with exact view counts and publish dates. Accepts , channel URL, or ID.
@handleUC...bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"返回最近15个视频,包含精确的观看次数和发布日期。支持、频道URL或格式的频道ID。
@用户名UC...Resolve handle — FREE
解析用户名 — 免费
bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"Use to convert @handle to UC... channel ID.
bash
curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"用于将@用户名转换为UC...格式的频道ID。
Errors
错误处理
| Code | Action |
|---|---|
| 402 | No credits — transcriptapi.com/billing |
| 404 | Not found / no captions |
| 408 | Timeout — retry once |
Free tier: 100 credits. Search and transcript cost 1 credit. Channel latest and resolve are free.
| 错误码 | 处理方式 |
|---|---|
| 402 | 额度不足 — 前往transcriptapi.com/billing充值 |
| 404 | 未找到内容/无字幕 |
| 408 | 请求超时 — 重试一次 |
免费套餐:100个额度。搜索和获取字幕各消耗1个额度。获取频道最新内容和解析用户名功能免费。