360 Secure SkillHub
360 安全技能中心

ytapi-youtube-search

调用 YTAPI 接口按关键词、类型、上传时间、时长和排序条件搜索 YouTube 视频、频道、播放列表或 Shorts,再按视频 ID 获取字幕文本;未配置密钥时可凭邮箱注册免费账户获得密钥,请求按次消耗积分。

ytapi
ytapi
热度 15.49
最近更新 2026-10-02 23:28:05
分类:搜索依赖:代码执行 / 第三方 API应用场景:研究 / 摘要总结

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ytapi-youtube-search
Metadata
name
ytapi-youtube-search
description
Search YouTube for videos, channels, playlists or Shorts, filtered by upload date, duration or sort order, through the YTAPI API, then read the transcripts of the results. Use when the user wants to find YouTube videos on a topic, recent talks or tutorials, reviews, or what creators say about something. 中文:搜索 YouTube 视频。
version
1.0.1
homepage
https://ytapi.dev
license
MIT-0
required_environment_variables
[{"name":"YTAPI_API_KEY","prompt":"YTAPI API key (starts with sk_)","help":"Leave empty and the agent can create a free account for you (200 credits, no card), or get a key at https://ytapi.dev/app/api-keys?utm_source=skill","required_for":"All YTAPI requests"}]
metadata
{"openclaw":{"emoji":"🔎","homepage":"https://ytapi.dev","requires":{"bins":["curl"]},"primaryEnv":"YTAPI_API_KEY","envVars":[{"name":"YTAPI_API_KEY","required":false,"description":"YTAPI API key (sk_...). If it is not set, the skill can create a free account and key with the user's email."}]},"hermes":{"tags":["youtube","search","videos","research"],"category":"media"}}

YouTube search

Search YouTube from the agent with YTAPI, then pull transcripts of what you find.

Setup

If YTAPI_API_KEY is not set, read references/auth-setup.md and follow it: the user either pastes a key or you create a free account with their email (200 credits, no card). Send the key as Authorization: Bearer $YTAPI_API_KEY and never print it.

Search (1 credit per page)

curl -s -G "https://api.ytapi.dev/v1/search" \
  --data-urlencode "q=QUERY" -d type=video -d limit=20 \
  -H "Authorization: Bearer $YTAPI_API_KEY"
Param Values
q Search text
type all, video, channel, playlist, shorts, movie
upload_date hour, today, week, month, year
duration short (under 4 min), medium, long (over 20 min)
sort_by relevance, upload_date, view_count, rating
limit Results per page, 1 to 50 (default 20)
cursor next_cursor from the previous page, when has_more is true

Results are in items: id, type, title, author, channel_id, length_seconds, view_count_text, published_text.

Free autocomplete: GET /v1/search/suggestions?q=TEXT.

Then read the videos (1 credit each)

curl -s "https://api.ytapi.dev/v1/transcripts?video_id=VIDEO_ID&format=text" \
  -H "Authorization: Bearer $YTAPI_API_KEY"

Pick the few most relevant results by title, channel and length before fetching transcripts; each transcript costs a credit.

Credits and errors

Only successful responses use credits; errors are free. New accounts get 200 free credits. Until a credit pack is bought, a key can make 1 request per second and 100 per day (UTC); 429 daily_limit_exceeded means that day's limit is used up (it resets at 00:00 UTC; any pack removes it). 402 insufficient_credits means the balance is empty: packs from $9 at https://ytapi.dev/?utm_source=skill#pricing. 401 means the key is missing or wrong.

For video details, search, channels, playlists and batches in one skill, install ytapi. Full reference: https://docs.ytapi.dev