Loading...
Loading...
Compare original and translation side by side
$TRANSCRIPT_API_KEYnode ./scripts/tapi-auth.js register --email USER_EMAILnode ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODEAPI key saved to your shell profile and agent config. Ready to use.
$TRANSCRIPT_API_KEYnode ./scripts/tapi-auth.js register --email USER_EMAILnode ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODEAPI密钥将保存至你的Shell配置文件及Agent配置中,即可开始使用。
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 | | |
format=json{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [{ "text": "...", "start": 18.0, "duration": 3.5 }],
"metadata": { "title": "...", "author_name": "...", "author_url": "..." }
}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=json{
"video_id": "dQw4w9WgXcQ",
"language": "en",
"transcript": [{ "text": "...", "start": 18.0, "duration": 3.5 }],
"metadata": { "title": "...", "author_name": "...", "author_url": "..." }
}undefinedundefined
| Param | Required | Default | Validation |
| ------- | -------- | ------- | ------------------ |
| `q` | yes | — | 1-200 chars |
| `type` | no | `video` | `video`, `channel` |
| `limit` | no | `20` | 1-50 |
| 参数 | 是否必填 | 默认值 | 验证规则 |
| ------- | -------- | ------- | ------------------ |
| `q` | 是 | — | 1-200字符 |
| `type` | 否 | `video` | `video`, `channel` |
| `limit` | 否 | `20` | 1-50 |channel@handleUC...channel@用户名UC...curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"{"channel_id": "UC...", "resolved_from": "@TED"}curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"{"channel_id": "UC...", "resolved_from": "@TED"}curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"viewCountpublishedcurl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"viewCountpublishedundefinedundefined
Provide exactly one of `channel` or `continuation`. Response includes `continuation_token` and `has_more`.
需提供`channel`或`continuation`二者之一。响应包含`continuation_token`(续传令牌)及`has_more`(是否还有更多内容)字段。curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=QUERY&limit=30" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=QUERY&limit=30" \
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"playlistundefinedplaylistundefined
Valid ID prefixes: `PL`, `UU`, `LL`, `FL`, `OL`. Response includes `playlist_info`, `results`, `continuation_token`, `has_more`.
有效ID前缀:`PL`, `UU`, `LL`, `FL`, `OL`。响应包含`playlist_info`(播放列表信息)、`results`(结果列表)、`continuation_token`(续传令牌)及`has_more`(是否还有更多内容)字段。| 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/页 |
| Field | Rule |
|---|---|
| |
| Playlist URL or ID ( |
| 1-200 chars |
| 1-50 |
| 字段 | 规则 |
|---|---|
| |
| 播放列表链接或ID(前缀为 |
| 1-200字符 |
| 1-50 |
| 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字段 |
undefinedundefined
**Channel monitoring:** latest (free) → transcript
```bash
**频道监控流程:** 获取最新视频(免费)→ 字幕转录
```bash
Free tier: 100 credits, 300 req/min. Starter ($5/mo): 1,000 credits.
免费套餐:100额度,每分钟300次请求。入门套餐(5美元/月):1000额度。