你想知道自己的页面在重要关键词、重要国家的排名,以及谁排在你前面。手动检查得到的结果会受你自己所在位置和搜索历史的影响。Lovely Router 替你执行搜索。发送一个关键词和一个国家,就能拿到每个结果页一个 JSON 对象,按页数从预付费余额中计费。用一个 API 密钥,就能从脚本、每日任务或 AI 智能体中调用。
交给你的 AI 智能体
把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。
按国家追踪 Google 关键词排名. 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>工作原理
列出关键词和国家
每次运行一行一个关键词,并附上你关心的 ISO 国家代码。
hl设置语言。设置上限后运行工具
连同
limit和max_results一起发送。每个结果页约包含 10 条链接,计为一条计费结果。存储排名
按关键词、按天保存你的 URL 和各竞品的排名,并绘制变化图。
一次请求获取 Google 搜索结果
搜索 Google 接受 keyword、country 和 limit,limit 是每次搜索的结果数(10、20,最多到 all):
curl https://lovelyrouter.com/v1/tools/google-search/run \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "content-type: application/json" \
-d '{
"input": {
"keyword": "best espresso grinder",
"limit": "10",
"country": "US"
},
"max_results": 1
}'tbs 用于添加时间筛选,例如过去一天或一周,hl 设置 Google 界面语言。运行超过 60 秒仍未结束时会返回 202;轮询方法见运行工具。
每个结果页包含什么
| 字段组 | 你会得到什么 |
|---|---|
| 自然搜索结果 | 排名、标题、URL、摘要和日期 |
| 附加内容 | 站点链接 |
| 相关搜索 | 相关搜索词 |
一条结果就是约 10 条链接的一个结果页,所以读取前 50 名是 5 条结果。用 max_results 限制一次运行,最大为 10。
实用配方
每天早上用 limit 为 10 运行你的 30 个关键词,并存储你的域名的排名。
用 US、GB 和 DE 运行同一个关键词,看看你的页面排在哪里。
收集你目标关键词的前 20 名,统计哪些域名出现得最多。
把种子关键词的相关搜索词,作为接下来要追踪的一批关键词。
使用过去一周的 tbs 筛选,看看某个主题最近发布了哪些内容。
更想直接用自然语言提问?连接 MCP 服务器,然后对 Claude Code 或 Cursor 说:"在美国的 Google 上搜索 keywords.txt 中的每个关键词,找出 example.com 的排名,并为每个关键词列出排名前三的竞争域名。把 max_results 设为 10。"
搭配其他搜索来源
自然搜索排名只是一个视角。再加上:
Google 搜索结果页:自然结果、广告、“相关问题”和相关搜索。一条结果 = 一个结果页(约 10 条自然链接)。
Google 新闻中某个搜索的新闻文章(支持运算符:"精确短语"、OR、-排除词、site:、intitle:),可限定时间范围:标题、来源、日期及发布网站上的文章链接。
某关键词随时间及按地区的 Google 趋势热度。
google-news显示同一主题的新闻结果。google-trends显示某个关键词的热度随时间如何变化。
费用说明
按页付费:启动运行时会预留它的最高费用,即每次调用费加上每页费用乘以 max_results,结束后按实际返回的结果结算,预留的剩余部分退回你的余额。失败或超时的运行只为已交付的页付费,在开始时就被拒绝的运行不收费。
每天追踪 30 个关键词、每个读取 10 条结果,就按每天 30 页计费。没有订阅,也没有每月最低消费:最低充值 $5,工具和模型共用一个余额。上方卡片显示的是当前价格;价格页面列出了所有工具。