Search YouTube for videos and channels, search within specific channels, then fetch transcripts. Use when the user asks to "find videos about X", "search YouTube for", "look up a channel", "who makes videos about", "find on youtube", or wants to discover YouTube content on a topic.
通过 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=
完整 OpenAPI 规范:transcriptapi.com/openapi.json — 请查阅此文档获取最新参数和架构。
全局搜索 YouTube 视频或频道。
bash
curl -s https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20 \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
| 参数 | 必填 | 默认值 | 验证条件 |
|---|---|---|---|
| q | 是 | — | 1-200 字符(自动修剪) |
| type |
视频搜索响应:
json
{
results: [
{
type: video,
videoId: dQw4w9WgXcQ,
title: Rick Astley - Never Gonna Give You Up,
channelId: UCuAXFkgsw1L7xaCfnd5JJOw,
channelTitle: Rick Astley,
channelHandle: @RickAstley,
channelVerified: true,
lengthText: 3:33,
viewCountText: 1.5B 次观看,
publishedTimeText: 14 年前,
hasCaptions: true,
thumbnails: [{ url: ..., width: 120, height: 90 }]
}
],
result_count: 20
}
频道搜索响应(type=channel):
json
{
results: [{
type: channel,
channelId: UCuAXFkgsw1L7xaCfnd5JJOw,
title: Rick Astley,
handle: @RickAstley,
url: https://www.youtube.com/@RickAstley,
description: 官方频道...,
subscriberCount: 420 万订阅者,
verified: true,
rssUrl: https://www.youtube.com/feeds/videos.xml?channel_id=UC...,
thumbnails: [...]
}],
result_count: 5
}
在特定频道内搜索视频。接受 channel 参数 — 可以是 @handle、频道 URL 或 UC... ID。
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=climate+change&limit=30 \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
| 参数 | 必填 | 验证条件 |
|---|---|---|
| channel | 是 | @handle、频道 URL 或 UC... ID |
| q |
最多返回约 30 条结果(YouTube 限制)。视频响应格式与全局搜索相同。
将 @handle 转换为频道 ID:
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
bash
| 状态码 | 操作 |
|---|---|
| 402 | 积分不足 — transcriptapi.com/billing |
| 404 |
免费套餐:100 积分,每分钟 300 次请求。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 youtube-search-1776374542 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 youtube-search-1776374542 技能
skillhub install youtube-search-1776374542
文件大小: 6.5 KB | 发布时间: 2026-4-17 16:26