YouTube Full
Complete YouTube toolkit via TranscriptAPI.com. Everything in one skill.
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.
CODEBLOCK0
→ OTP sent to email. Ask user: "Check your email for a 6-digit verification code."
Step 2 — Verify: Once user provides the OTP:
CODEBLOCK1
API key saved to ~/.openclaw/openclaw.json. See File Writes below for details. Existing file is backed up before modification.
Manual option: transcriptapi.com/signup → Dashboard → API Keys.
File Writes
The verify and save-key commands save the API key to ~/.openclaw/openclaw.json (sets skills.entries.transcriptapi.apiKey and enabled: true). Existing file is backed up to ~/.openclaw/openclaw.json.bak before modification.
To use the API key in terminal/CLI outside the agent, add to your shell profile manually:
INLINECODE6
API Reference
Full OpenAPI spec: transcriptapi.com/openapi.json — consult this for the latest parameters and schemas.
Transcript — 1 credit
CODEBLOCK2
| Param | Required | Default | Values |
|---|
| INLINECODE7 | yes | — | YouTube URL or 11-char video ID |
| INLINECODE8 |
no |
json |
json,
text |
|
include_timestamp | no |
true |
true,
false |
|
send_metadata | no |
false |
true,
false |
Response (format=json):
CODEBLOCK3
Search — 1 credit
CODEBLOCK4
| Param | Required | Default | Validation |
|---|
| INLINECODE21 | yes | — | 1-200 chars |
| INLINECODE22 |
no |
video |
video,
channel |
|
limit | no |
20 | 1-50 |
Channels
All channel endpoints accept channel — an @handle, channel URL, or UC... channel ID. No need to resolve first.
Resolve handle — FREE
CODEBLOCK5
Response: INLINECODE31
Latest 15 videos — FREE
CODEBLOCK6
Returns exact viewCount and ISO published timestamps.
All channel videos — 1 credit/page
CODEBLOCK7
Provide exactly one of channel or continuation. Response includes continuation_token and has_more.
Search within channel — 1 credit
CODEBLOCK8
Playlists — 1 credit/page
Accepts playlist — a YouTube playlist URL or playlist ID.
CODEBLOCK9
Valid ID prefixes: PL, UU, LL, FL, OL. Response includes 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 |
Validation Rules
| Field | Rule |
|---|
| INLINECODE48 | INLINECODE49 , channel URL, or UC... ID |
| INLINECODE51 |
Playlist URL or ID (
PL/
UU/
LL/
FL/
OL prefix) |
|
q | 1-200 chars |
|
limit | 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 |
Typical Workflows
Research workflow: search → pick videos → fetch transcripts
CODEBLOCK10
Channel monitoring: latest (free) → transcript
CODEBLOCK11
Free tier: 100 credits, 300 req/min. Starter ($5/mo): 1,000 credits.
YouTube Full
通过 TranscriptAPI.com 提供的完整 YouTube 工具包。所有功能集成于一个技能中。
设置
如果未设置 $TRANSCRIPTAPIKEY,请帮助用户创建账户(100 个免费积分,无需银行卡):
步骤 1 — 注册: 询问用户的邮箱。
bash
node ./scripts/tapi-auth.js register --email USER_EMAIL
→ 验证码已发送至邮箱。询问用户:请检查您的邮箱,获取 6 位验证码。
步骤 2 — 验证: 用户提供验证码后:
bash
node ./scripts/tapi-auth.js verify --token TOKENFROMSTEP_1 --otp CODE
API 密钥已保存至 ~/.openclaw/openclaw.json。详情请参见下方的文件写入部分。修改前会对现有文件进行备份。
手动操作:transcriptapi.com/signup → 控制台 → API 密钥。
文件写入
验证和保存密钥命令会将 API 密钥保存至 ~/.openclaw/openclaw.json(设置 skills.entries.transcriptapi.apiKey 和 enabled: true)。修改前会将现有文件备份至 ~/.openclaw/openclaw.json.bak。
如需在代理之外的终端/命令行中使用 API 密钥,请手动将其添加到您的 shell 配置文件中:
export TRANSCRIPTAPIKEY=
API 参考
完整 OpenAPI 规范:transcriptapi.com/openapi.json — 请查阅此文档获取最新参数和模式。
字幕 — 1 积分
bash
curl -s https://transcriptapi.com/api/v2/youtube/transcript\
?videourl=VIDEOURL&format=text&includetimestamp=true&sendmetadata=true \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
| 参数 | 必填 | 默认值 | 值 |
|---|
| video_url | 是 | — | YouTube URL 或 11 位视频 ID |
| format |
否 | json | json、text |
| include_timestamp | 否 | true | true、false |
| send_metadata | 否 | false | true、false |
响应 (format=json):
json
{
video_id: dQw4w9WgXcQ,
language: en,
transcript: [{ text: ..., start: 18.0, duration: 3.5 }],
metadata: { title: ..., authorname: ..., authorurl: ... }
}
搜索 — 1 积分
bash
视频
curl -s https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20 \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
频道
curl -s https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=channel&limit=10 \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
| 参数 | 必填 | 默认值 | 验证 |
|---|
| q | 是 | — | 1-200 个字符 |
| type |
否 | video | video、channel |
| limit | 否 | 20 | 1-50 |
频道
所有频道端点接受 channel — 可以是 @handle、频道 URL 或 UC... 频道 ID。无需预先解析。
解析句柄 — 免费
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
响应:{channelid: UC..., resolvedfrom: @TED}
最新 15 个视频 — 免费
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
返回精确的 viewCount 和 ISO 格式的 published 时间戳。
频道所有视频 — 1 积分/页
bash
第一页(100 个视频)
curl -s https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
后续页面
curl -s https://transcriptapi.com/api/v2/youtube/channel/videos?continuation=TOKEN \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
请提供 channel 或 continuation 中的其中一个。响应包含 continuationtoken 和 hasmore。
频道内搜索 — 1 积分
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=QUERY&limit=30 \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
播放列表 — 1 积分/页
接受 playlist — YouTube 播放列表 URL 或播放列表 ID。
bash
第一页
curl -s https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_ID \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
后续页面
curl -s https://transcriptapi.com/api/v2/youtube/playlist/videos?continuation=TOKEN \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
有效的 ID 前缀:PL、UU、LL、FL、OL。响应包含 playlistinfo、results、continuationtoken、has_more。
积分消耗
1 |
| channel/resolve |
免费 |
| channel/latest |
免费 |
| channel/videos | 1/页 |
| channel/search | 1 |
| playlist/videos | 1/页 |
验证规则
| 字段 | 规则 |
|---|
| channel | @handle、频道 URL 或 UC... ID |
| playlist |
播放列表 URL 或 ID(PL/UU/LL/FL/OL 前缀) |
| q | 1-200 个字符 |
| limit | 1-50 |
错误
积分不足 | transcriptapi.com/billing |
| 404 | 未找到 | 资源不存在或无字幕 |
| 408 | 超时 | 等待 2 秒后重试一次 |
| 422 | 验证错误 | 检查参数格式 |
| 429 | 请求频率限制 | 等待,遵循 Retry-After |
典型工作流程
研究工作流程: 搜索 → 选择视频 → 获取字幕
bash
1. 搜索
curl -s https://transcriptapi.com/api/v2/youtube/search\
?q=machine+learning+explained&limit=5 \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
2. 字幕
curl -s https://transcriptapi.com/api/v2/youtube/transcript\
?video
url=VIDEOID&format=text&include
timestamp=true&sendmetadata=true \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
频道监控: 最新(免费)→ 字幕
bash
1. 最新上传(免费 — 直接传入 @handle)
curl -s https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED \
-H Authorization: Bearer $TRANSCRIPT
APIKEY
2. 最新视频