youtube-playlist

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

YouTube Playlist

YouTube Playlist

Browse playlists and fetch transcripts via TranscriptAPI.com.
通过TranscriptAPI.com浏览播放列表并获取转录文本。

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
→ 验证码(OTP)已发送至邮箱。询问用户:“请查看您的邮箱,获取6位验证码。”
步骤2 — 验证: 用户提供OTP后:
bash
node ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODE
API密钥已保存到您的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
playlist
— a YouTube playlist URL or playlist ID.
bash
undefined
分页列出播放列表中的视频(每页100条)。接受
playlist
参数——YouTube播放列表URL或播放列表ID。
bash
undefined

First page

第一页

curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_PLAYLIST_ID"
-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"

Next pages

后续页面

curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN"
-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:
  1. First request:
    ?playlist=PLxxx
    — returns first 100 videos +
    continuation_token
  2. Next request:
    ?continuation=TOKEN
    — returns next 100 + new token
  3. Repeat until
    has_more: false
    or
    continuation_token: null
curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN"
-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
}
分页流程:
  1. 首次请求:
    ?playlist=PLxxx
    — 返回前100条视频 +
    continuation_token
  2. 后续请求:
    ?continuation=TOKEN
    — 返回下100条视频 + 新的token
  3. 重复上述步骤,直到
    has_more: false
    continuation_token: null

Workflow: Playlist → Transcripts

工作流程:播放列表 → 转录文本

bash
undefined
bash
undefined

1. List playlist videos

1. 列出播放列表中的视频

curl -s "https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_PLAYLIST_ID"
-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"

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"
undefined
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"
undefined

Extract playlist ID from URL

从URL中提取播放列表ID

From
https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf
, the playlist ID is
PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf
. You can also pass the full URL directly to the
playlist
parameter.
从链接
https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf
中,播放列表ID为
PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf
。您也可以直接将完整URL传递给
playlist
参数。

Errors

错误说明

CodeMeaningAction
400Both or neither paramsProvide exactly one of playlist or continuation
402No creditstranscriptapi.com/billing
404Playlist not foundCheck if playlist is public
408TimeoutRetry once
422Invalid playlist formatMust 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次请求。