网淘吧来吧,欢迎您!

Youtube Channels技能使用说明

2026-03-29 新闻来源:网淘吧 围观:19
电脑广告
手机广告

YouTube频道

通过TranscriptAPI.com提供的YouTube频道工具

设置如果$TRANSCRIPT_API_KEY

Youtube Channels

未设置,帮助用户创建账户(100免费额度,无需绑卡):步骤1 — 注册:

node ./scripts/tapi-auth.js register --email USER_EMAIL

向用户索取其电子邮箱。→ 向邮箱发送一次性验证码。询问用户:

"请查收您的邮件,获取6位验证码。"步骤2 — 验证:

node ./scripts/tapi-auth.js verify --token TOKEN_FROM_STEP_1 --otp CODE

一旦用户提供验证码:API密钥将保存至~/.openclaw/openclaw.json文件。详情请见下文文件写入

部分。修改前现有文件会被备份。手动操作选项:访问 transcriptapi.com/signup

→ 进入仪表盘 → API密钥。

verify 和 save-key 命令将 API 密钥保存至~/.openclaw/openclaw.json(设置skills.entries.transcriptapi.apiKeyenabled: true)。修改前,现有文件将备份至~/.openclaw/openclaw.json.bak

若要在代理之外的终端/CLI 中使用 API 密钥,请手动添加至您的 shell 配置文件:export TRANSCRIPT_API_KEY=<您的密钥>

API 参考

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

所有频道端点均接受灵活的输入 —@句柄、频道 URL,或UC...频道 ID。无需预先解析。

GET /api/v2/youtube/channel/resolve — 免费

将@用户名、URL或UC... ID转换为规范的频道ID。

curl -s "https://transcriptapi.com/api/v2/youtube/channel/resolve?input=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
参数必需验证
输入1-200个字符 — @用户名、URL或UC... ID

响应:

{ "channel_id": "UCsT0YIqwnpJCM-mx7-gSA4Q", "resolved_from": "@TED" }

如果输入已经是UC[a-zA-Z0-9_-]{22}格式,则立即返回。

GET /api/v2/youtube/channel/latest — 免费

通过RSS获取最新的15个视频及其精确统计数据。

curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
参数必需验证
频道@用户名、频道URL或UC...ID

响应:

{
  "channel": {
    "channelId": "UCsT0YIqwnpJCM-mx7-gSA4Q",
    "title": "TED",
    "author": "TED",
    "url": "https://www.youtube.com/channel/UCsT0YIqwnpJCM-mx7-gSA4Q",
    "published": "2006-04-17T00:00:00Z"
  },
  "results": [
    {
      "videoId": "abc123xyz00",
      "title": "Latest Video Title",
      "channelId": "UCsT0YIqwnpJCM-mx7-gSA4Q",
      "author": "TED",
      "published": "2026-01-30T16:00:00Z",
      "updated": "2026-01-31T02:00:00Z",
      "link": "https://www.youtube.com/watch?v=abc123xyz00",
      "description": "Full video description...",
      "thumbnail": { "url": "https://i1.ytimg.com/vi/.../hqdefault.jpg" },
      "viewCount": "2287630",
      "starRating": {
        "average": "4.92",
        "count": "15000",
        "min": "1",
        "max": "5"
      }
    }
  ],
  "result_count": 15
}

非常适合监控频道 — 免费且提供精确的观看次数和ISO时间戳。

GET /api/v2/youtube/channel/videos — 1 积分/页

所有频道上传视频的分页列表(每页 100 个)。

# First page
curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?channel=@NASA" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"

# Next pages
curl -s "https://transcriptapi.com/api/v2/youtube/channel/videos?continuation=TOKEN" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
参数必需验证
channel条件性@handle、频道 URL,或UC...ID
continuation条件性非空(用于后续页面)

必须提供且仅提供channelcontinuation中的一个,不能同时提供两者。

响应:

{
  "results": [{
    "videoId": "abc123xyz00",
    "title": "Video Title",
    "channelId": "UCsT0YIqwnpJCM-mx7-gSA4Q",
    "channelTitle": "TED",
    "channelHandle": "@TED",
    "lengthText": "15:22",
    "viewCountText": "3.2M views",
    "thumbnails": [...],
    "index": "0"
  }],
  "playlist_info": {"title": "Uploads from TED", "numVideos": "5000", "ownerName": "TED"},
  "continuation_token": "4qmFsgKlARIYVVV1...",
  "has_more": true
}

持续调用并传递continuation,直到has_more: false

GET /api/v2/youtube/channel/search — 1次调用额度

在特定频道内搜索。

curl -s "https://transcriptapi.com/api/v2/youtube/channel/search\
?channel=@TED&q=climate+change&limit=30" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"
参数必需验证规则
频道标识符@句柄、频道URL,或UC...ID
查询词1-200个字符
结果数量限制1-50(默认30)

典型工作流程

# 1. Check latest uploads (free — pass @handle directly)
curl -s "https://transcriptapi.com/api/v2/youtube/channel/latest?channel=@TED" \
  -H "Authorization: Bearer $TRANSCRIPT_API_KEY"

# 2. Get transcript of recent video
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"

错误代码

代码说明
400参数组合无效(同时提供了频道标识符和continuation参数,或两者都未提供)
402调用额度不足 — 请访问 transcriptapi.com/billing
404频道未找到
408超时 — 请重试一次
422无效的频道标识符

免费套餐:100 积分,每分钟 300 次请求。免费端点(解析、最新)需要认证但不消耗积分。

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第326264名访客 今日有221篇新文章/评论