返回顶部
y

youtube-dataYouTube数据

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.4.1
安全检测
已通过
3,218
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

youtube-data

YouTube 数据

通过 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=

API 参考

完整 OpenAPI 规范:transcriptapi.com/openapi.json — 请查阅此文档获取最新参数和模式。

视频数据(字幕 + 元数据)— 1 积分

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
}
}

搜索数据 — 1 积分

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

播放列表数据 — 1 积分/页

接受 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

积分费用

端点费用返回数据
transcript1完整字幕 + 元数据
search
1 | 视频/频道详情 | | channel/resolve | 免费 | 频道 ID 映射 | | channel/latest | 免费 | 15 个视频 + 精确统计数据 | | channel/videos | 1/页 | 每页 100 个视频 | | channel/search | 1 | 匹配查询的视频 | | playlist/videos | 1/页 | 每页 100 个视频 |

错误

代码操作
402积分不足 — transcriptapi.com/billing
404
未找到 | | 408 | 超时 — 重试一次 | | 422 | 参数格式无效 |

免费套餐:100 积分,每分钟 300 次请求。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 youtube-data-1776374450 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 youtube-data-1776374450 技能

通过命令行安装

skillhub install youtube-data-1776374450

下载

⬇ 下载 youtube-data v1.4.1(免费)

文件大小: 6.61 KB | 发布时间: 2026-4-17 14:11

v1.4.1 最新 2026-4-17 14:11
ClawHub variant: minimal tapi-auth.js v3.0.0, only writes to ~/.openclaw/openclaw.json

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部