youtube-playlist
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYouTube Playlist
YouTube Playlist
Browse playlists and fetch transcripts via TranscriptAPI.com.
通过TranscriptAPI.com浏览播放列表并获取转录文本。
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配置文件和代理配置中,可随时使用。
手动注册选项: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 — 请查阅此文档获取最新参数和模式。
GET /api/v2/youtube/playlist/videos — 1 credit/page
GET /api/v2/youtube/playlist/videos — 1额度/页
Paginated playlist video listing (100 per page). Accepts — a YouTube playlist URL or playlist ID.
playlistbash
undefined分页列出播放列表中的视频(每页100条)。接受参数——YouTube播放列表URL或播放列表ID。
playlistbash
undefinedFirst page
第一页
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_PLAYLIST_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_PLAYLIST_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"
| Param | Required | Validation |
| -------------- | ----------- | ---------------------------------------------------- |
| `playlist` | conditional | Playlist URL or ID (`PL`/`UU`/`LL`/`FL`/`OL` prefix) |
| `continuation` | conditional | non-empty string |
Provide exactly one of `playlist` or `continuation`, not both.
**Accepted playlist ID prefixes:**
- `PL` — user-created playlists
- `UU` — channel uploads playlist
- `LL` — liked videos
- `FL` — favorites
- `OL` — other system playlists
**Response:**
```json
{
"results": [
{
"videoId": "abc123xyz00",
"title": "Playlist Video Title",
"channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
"channelTitle": "Channel Name",
"channelHandle": "@handle",
"lengthText": "10:05",
"viewCountText": "1.5M views",
"thumbnails": [{ "url": "...", "width": 120, "height": 90 }],
"index": "0"
}
],
"playlist_info": {
"title": "Best Science Talks",
"numVideos": "47",
"description": "Top science presentations",
"ownerName": "TED",
"viewCount": "5000000"
},
"continuation_token": "4qmFsgKlARIYVVV1...",
"has_more": true
}Pagination flow:
- First request: — returns first 100 videos +
?playlist=PLxxxcontinuation_token - Next request: — returns next 100 + new token
?continuation=TOKEN - Repeat until or
has_more: falsecontinuation_token: null
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
| 参数 | 是否必填 | 验证规则 |
| -------------- | -------- | -------------------------------------------------- |
| `playlist` | 可选(二选一) | 播放列表URL或ID(前缀为`PL`/`UU`/`LL`/`FL`/`OL`) |
| `continuation` | 可选(二选一) | 非空字符串 |
必须且只能提供`playlist`或`continuation`其中一个参数,不可同时提供或都不提供。
**支持的播放列表ID前缀:**
- `PL` — 用户创建的播放列表
- `UU` — 频道上传视频播放列表
- `LL` — 点赞视频列表
- `FL` — 收藏视频列表
- `OL` — 其他系统播放列表
**响应示例:**
```json
{
"results": [
{
"videoId": "abc123xyz00",
"title": "Playlist Video Title",
"channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
"channelTitle": "Channel Name",
"channelHandle": "@handle",
"lengthText": "10:05",
"viewCountText": "1.5M views",
"thumbnails": [{ "url": "...", "width": 120, "height": 90 }],
"index": "0"
}
],
"playlist_info": {
"title": "Best Science Talks",
"numVideos": "47",
"description": "Top science presentations",
"ownerName": "TED",
"viewCount": "5000000"
},
"continuation_token": "4qmFsgKlARIYVVV1...",
"has_more": true
}分页流程:
- 首次请求:— 返回前100条视频 +
?playlist=PLxxxcontinuation_token - 后续请求:— 返回下100条视频 + 新的token
?continuation=TOKEN - 重复上述步骤,直到或
has_more: falsecontinuation_token: null
Workflow: Playlist → Transcripts
工作流程:播放列表 → 转录文本
bash
undefinedbash
undefined1. List playlist videos
1. 列出播放列表中的视频
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_PLAYLIST_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_PLAYLIST_ID"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
-H "Authorization: Bearer $TRANSCRIPT_API_KEY"
2. Get transcript from a video in the playlist
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"
undefinedcurl -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"
undefinedExtract playlist ID from URL
从URL中提取播放列表ID
From , the playlist ID is . You can also pass the full URL directly to the parameter.
https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdfPLrAXtmErZgOeiKm4sgNOknGvNjby9efdfplaylist从链接中,播放列表ID为。您也可以直接将完整URL传递给参数。
https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdfPLrAXtmErZgOeiKm4sgNOknGvNjby9efdfplaylistErrors
错误说明
| Code | Meaning | Action |
|---|---|---|
| 400 | Both or neither params | Provide exactly one of playlist or continuation |
| 402 | No credits | transcriptapi.com/billing |
| 404 | Playlist not found | Check if playlist is public |
| 408 | Timeout | Retry once |
| 422 | Invalid playlist format | Must be a valid playlist URL or ID |
1 credit per page. Free tier: 100 credits, 300 req/min.
| 代码 | 含义 | 操作建议 |
|---|---|---|
| 400 | 参数同时提供或都未提供 | 必须且只能提供playlist或continuation其中一个参数 |
| 402 | 无可用额度 | 前往transcriptapi.com/billing充值 |
| 404 | 播放列表未找到 | 检查播放列表是否公开 |
| 408 | 请求超时 | 重试一次 |
| 422 | 播放列表格式无效 | 必须是有效的播放列表URL或ID |
每一页消耗1个额度。免费套餐:100个免费额度,每分钟最多300次请求。