在规划系列视频、课程或内容营销活动之前,你想知道大家是否在看这个选题,爆款视频有多长,哪些频道已经占据了它。YouTube 自带的搜索一次只显示十条结果,也不会把数字并排列出来。Lovely Router 替你执行搜索:传入关键词,每个视频返回一个 JSON 对象,按视频数量从预付费余额中计费。用一个 API 密钥,就能从脚本或 AI 智能体中运行。
交给你的 AI 智能体
把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。
做视频之前,先研究一个选题在 YouTube 上的价值. Use the Lovely Router data tools: each returns JSON and is billed per result.
- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.
My task: <the inputs (links, keywords or accounts) and how many results you need>工作原理
列出选题
写下你在考虑的关键词,每个一条:选题本身、大家会问的问题、产品名加上“测评”。
设置上限后运行工具
发送到
POST /v1/tools/youtube-search/run,用maxItems指定视频数量,并用max_results作为运行上限。运行会从你的余额中预留它的最高费用,并以 JSON 返回视频。比较各个选题
对每个关键词,看播放量的中位数、来自小频道的视频占比以及典型时长。播放量高且来自小频道的选题还有机会;被少数大频道主导的则没有。
一次请求搜索一个选题
搜索 YouTube 视频在 keywords 中接受搜索词,每条各执行一次搜索。除了关键词,你也可以在 startUrls 中传入 YouTube 链接:搜索结果页、频道、播放列表或视频 URL。筛选项 sort、uploadDate 和 duration 只作用于关键词搜索:
curl https://lovelyrouter.com/v1/tools/youtube-search/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"keywords": ["espresso tutorial"],
"maxItems": 5
},
"max_results": 5
}'运行超过 60 秒仍未结束时会返回 202;轮询方法见运行工具。一次运行最多可返回 200 个视频。
每个视频包含什么
| Field group | What you get |
|---|---|
| 标识 | 视频标题 |
| 触达 | 播放量 |
| 互动 | 点赞数和评论数 |
| 形式 | 时长 |
| 来源 | 发布它的频道 |
| 时间 | 发布日期 |
使用方案
对一个关键词的五种变体各搜索 50 个视频,比较每种变体的播放量中位数,选出需求最大的一个。
保留播放量高、但来自你没听说过的频道的视频;这说明小频道也有机会在这里胜出。
按时长对热门视频分组。如果赢家都在 8 到 12 分钟,就按这个来规划,而不是 30 分钟。
用 uploadDate 筛选只看近期上传的视频,看哪些关键词仍能产出播放量很高的视频。
统计哪些频道在你的各个关键词中出现得最多,然后用 youtube-channel 跟进它们。
更想用自然语言?连接 MCP 服务器,然后告诉 Claude Code 或 Cursor:"在 YouTube 上搜索 'espresso tutorial'、'home espresso setup' 和 'best espresso grinder',每个 30 个视频,告诉我哪个关键词的单视频播放量最高,以及哪些频道出现得最多。把 max_results 设为 90。"
与其他数据源搭配
搜索展示现状,下面这些告诉你该怎么用:
按关键词搜索 YouTube 视频,或从 YouTube 链接(搜索结果、频道、播放列表或视频 URL)获取:标题、播放、点赞、评论数、时长、频道、日期。
YouTube 频道的视频(频道名如 @MrBeast 或频道 URL):标题、播放、点赞、评论数、时长、日期。
YouTube 视频或 Shorts 的评论:内容、点赞、回复数、作者、日期。按热门或最新排序。
YouTube 视频的完整字幕文本,带时间戳:每个视频链接一份,视频有该语言时按你指定的语言返回。
某关键词随时间及按地区的 Google 趋势热度。
youtube-channel列出你在搜索中发现的频道的所有近期视频。youtube-comments显示观众在热门视频下提出的问题,那就是你的下一批标题。youtube-transcript提供爆款视频的口述文本,用来研究它的结构。google-trends显示这个选题在 YouTube 之外的关注度是否在增长。
更完整的工作,请参阅社交聆听。
费用说明
按视频计费:开始运行时会预留最高费用,即单次调用费加上单视频费乘以 max_results,运行结束后按实际返回的数量结算,其余预留金额退回你的余额。失败或超时的运行只为已交付的视频付费,开始时就被拒绝的运行不收费。
研究 10 个关键词、每个 30 个视频,按 300 个视频计费。没有订阅,也没有每月最低消费:从 $5 起充值,一份余额同时支付工具和模型。上方卡片显示今日价格;价格页列出了每个工具。
常见问题
一次运行可以搜索多个关键词吗?+
可以。keywords 是一个列表,每一项都作为独立的搜索运行。
可以按上传日期或视频时长筛选吗?+
可以。uploadDate 和 duration 用于筛选关键词搜索,sort 用于改变排序。传入 startUrls 时它们不起作用。
可以从播放列表或频道开始,而不是关键词吗?+
可以。把链接放进 startUrls:搜索结果页、频道、播放列表或视频 URL 都可以。
一次运行最多返回多少个视频?+
最多 200 个。用 maxItems 可以要求更少。
会提供搜索量吗?+
不会。它返回视频及其播放量、点赞、评论数、时长、频道和日期。需求要靠你根据这些数字来判断。
需要订阅吗?+
不需要。你向预付费余额充值,每次运行从中扣费。失败的运行只为已交付的结果付费,也不会自动续费。