使用场景

做视频之前,先研究一个选题在 YouTube 上的价值

按关键词搜索 YouTube,以 JSON 获取视频的播放量、点赞、评论数、时长、频道和日期,用来评估需求,看清谁占据了这个选题。

预付费,无订阅REST 或 MCP一个密钥搞定模型、数据和智能体
YouTubelovelyjsonitems[0]"title": "Espresso tutorial for…"views": 1250000"likes": 38400"comments": 2100"duration": "9:32""channel": "Daily Grind""date": "2025-03-04"

在规划系列视频、课程或内容营销活动之前,你想知道大家是否在看这个选题,爆款视频有多长,哪些频道已经占据了它。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>
01

工作原理

010203
  1. 列出选题

    写下你在考虑的关键词,每个一条:选题本身、大家会问的问题、产品名加上“测评”。

  2. 设置上限后运行工具

    发送到 POST /v1/tools/youtube-search/run,用 maxItems 指定视频数量,并用 max_results 作为运行上限。运行会从你的余额中预留它的最高费用,并以 JSON 返回视频。

  3. 比较各个选题

    对每个关键词,看播放量的中位数、来自小频道的视频占比以及典型时长。播放量高且来自小频道的选题还有机会;被少数大频道主导的则没有。

02

一次请求搜索一个选题

搜索 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 个视频。

03

每个视频包含什么

Field groupWhat you get
标识视频标题
触达播放量
互动点赞数和评论数
形式时长
来源发布它的频道
时间发布日期
04

使用方案

评估选题规模。

对一个关键词的五种变体各搜索 50 个视频,比较每种变体的播放量中位数,选出需求最大的一个。

发现还有机会的选题。

保留播放量高、但来自你没听说过的频道的视频;这说明小频道也有机会在这里胜出。

确定时长。

按时长对热门视频分组。如果赢家都在 8 到 12 分钟,就按这个来规划,而不是 30 分钟。

发现上升中的选题。

用 uploadDate 筛选只看近期上传的视频,看哪些关键词仍能产出播放量很高的视频。

建立竞品清单。

统计哪些频道在你的各个关键词中出现得最多,然后用 youtube-channel 跟进它们。

更想用自然语言?连接 MCP 服务器,然后告诉 Claude Code 或 Cursor:"在 YouTube 上搜索 'espresso tutorial'、'home espresso setup' 和 'best espresso grinder',每个 30 个视频,告诉我哪个关键词的单视频播放量最高,以及哪些频道出现得最多。把 max_results 设为 90。"

06

费用说明

按视频计费:开始运行时会预留最高费用,即单次调用费加上单视频费乘以 max_results,运行结束后按实际返回的数量结算,其余预留金额退回你的余额。失败或超时的运行只为已交付的视频付费,开始时就被拒绝的运行不收费。

研究 10 个关键词、每个 30 个视频,按 300 个视频计费。没有订阅,也没有每月最低消费:从 $5 起充值,一份余额同时支付工具和模型。上方卡片显示今日价格;价格页列出了每个工具。

07

常见问题

?
一次运行可以搜索多个关键词吗?+

可以。keywords 是一个列表,每一项都作为独立的搜索运行。

可以按上传日期或视频时长筛选吗?+

可以。uploadDate 和 duration 用于筛选关键词搜索,sort 用于改变排序。传入 startUrls 时它们不起作用。

可以从播放列表或频道开始,而不是关键词吗?+

可以。把链接放进 startUrls:搜索结果页、频道、播放列表或视频 URL 都可以。

一次运行最多返回多少个视频?+

最多 200 个。用 maxItems 可以要求更少。

会提供搜索量吗?+

不会。它返回视频及其播放量、点赞、评论数、时长、频道和日期。需求要靠你根据这些数字来判断。

需要订阅吗?+

不需要。你向预付费余额充值,每次运行从中扣费。失败的运行只为已交付的结果付费,也不会自动续费。

围绕一个市场规划内容?请参阅社交聆听、达人调研和工具目录。

一个预付费密钥,搞定模型、数据和智能体

无需订阅。充值后按需使用,每笔费用都能在日志中查看。