Access YouTube video data — transcripts, metadata, channel info, search, and playlists. A lightweight alternative to Google's YouTube Data API with no quota limits. Use when the user needs structured data from YouTube videos, channels, or playlists without dealing with Google API setup, OAuth, or daily quotas.
通过 TranscriptAPI.com 访问 YouTube 数据——谷歌 YouTube 数据 API 的轻量级替代方案。
如果未设置 $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 — 请查阅此文档获取最新参数和模式。
bash
curl -s https://transcriptapi.com/api/v2/youtube/transcript\
?videourl=VIDEOURL&format=json&includetimestamp=true&sendmetadata=true \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
响应:
json
{
video_id: dQw4w9WgXcQ,
language: en,
transcript: [
{ text: Were no strangers to love, start: 18.0, duration: 3.5 }
],
metadata: {
title: Rick Astley - Never Gonna Give You Up,
author_name: Rick Astley,
author_url: https://www.youtube.com/@RickAstley,
thumbnail_url: https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg
}
}
bash
curl -s https://transcriptapi.com/api/v2/youtube/search?q=QUERY&type=video&limit=20 \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
视频结果字段: videoId、title、channelId、channelTitle、channelHandle、channelVerified、lengthText、viewCountText、publishedTimeText、hasCaptions、thumbnails
频道结果字段(type=channel):channelId、title、handle、url、description、subscriberCount、verified、rssUrl、thumbnails
频道端点接受 channel — 可以是 @handle、频道 URL 或 UC... ID。无需先进行解析。
将 handle 解析为 ID(免费):
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
返回:{channelid: UCsT0YIqwnpJCM-mx7-gSA4Q, resolvedfrom: @TED}
最新 15 个视频及精确统计数据(免费):
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
返回:channel 信息,results 数组包含 videoId、title、published(ISO 格式)、viewCount(精确数字)、description、thumbnail
所有频道视频(分页,1 积分/页):
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
每页返回 100 个视频 + 用于分页的 continuation_token。
在频道内搜索(1 积分):
bash
curl -s https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=QUERY&limit=30 \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
接受 playlist — YouTube 播放列表 URL 或播放列表 ID。
bash
curl -s https://transcriptapi.com/api/v2/youtube/playlist/videos?playlist=PL_ID \
-H Authorization: Bearer $TRANSCRIPTAPIKEY
返回:results(视频)、playlistinfo(title、numVideos、ownerName、viewCount)、continuationtoken、has_more
| 端点 | 费用 | 返回数据 |
|---|---|---|
| transcript | 1 | 完整字幕 + 元数据 |
| search |
| 代码 | 操作 |
|---|---|
| 402 | 积分不足 — transcriptapi.com/billing |
| 404 |
免费套餐:100 积分,每分钟 300 次请求。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 youtube-data-1776374450 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 youtube-data-1776374450 技能
skillhub install youtube-data-1776374450
文件大小: 6.61 KB | 发布时间: 2026-4-17 14:11