使用场景

按国家追踪 Google 关键词排名

以 JSON 获取任意查询的 Google 搜索结果,含排名、标题、URL、摘要、日期和相关搜索,按国家追踪你和竞品的排名。

预付费,无订阅REST 或 MCP一个密钥搞定模型、数据和智能体
Googlelovelyjsonitems[0]"keyword": "best espresso grinder""country": "US""position": 3"title": "The 9 Best Espresso G…"url": "https://example.com/b…"related": "burr vs blade grinder"

你想知道自己的页面在重要关键词、重要国家的排名,以及谁排在你前面。手动检查得到的结果会受你自己所在位置和搜索历史的影响。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>
01

工作原理

010203
  1. 列出关键词和国家

    每次运行一行一个关键词,并附上你关心的 ISO 国家代码。hl 设置语言。

  2. 设置上限后运行工具

    连同 limit 和 max_results 一起发送。每个结果页约包含 10 条链接,计为一条计费结果。

  3. 存储排名

    按关键词、按天保存你的 URL 和各竞品的排名,并绘制变化图。

02

一次请求获取 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;轮询方法见运行工具。

03

每个结果页包含什么

字段组你会得到什么
自然搜索结果排名、标题、URL、摘要和日期
附加内容站点链接
相关搜索相关搜索词

一条结果就是约 10 条链接的一个结果页,所以读取前 50 名是 5 条结果。用 max_results 限制一次运行,最大为 10。

04

实用配方

每天追踪你的排名。

每天早上用 limit 为 10 运行你的 30 个关键词,并存储你的域名的排名。

对比不同国家。

用 US、GB 和 DE 运行同一个关键词,看看你的页面排在哪里。

找出真正的竞争对手。

收集你目标关键词的前 20 名,统计哪些域名出现得最多。

挖掘相关搜索。

把种子关键词的相关搜索词,作为接下来要追踪的一批关键词。

检查内容新鲜度。

使用过去一周的 tbs 筛选,看看某个主题最近发布了哪些内容。

更想直接用自然语言提问?连接 MCP 服务器,然后对 Claude Code 或 Cursor 说:"在美国的 Google 上搜索 keywords.txt 中的每个关键词,找出 example.com 的排名,并为每个关键词列出排名前三的竞争域名。把 max_results 设为 10。"

06

费用说明

按页付费:启动运行时会预留它的最高费用,即每次调用费加上每页费用乘以 max_results,结束后按实际返回的结果结算,预留的剩余部分退回你的余额。失败或超时的运行只为已交付的页付费,在开始时就被拒绝的运行不收费。

每天追踪 30 个关键词、每个读取 10 条结果,就按每天 30 页计费。没有订阅,也没有每月最低消费:最低充值 $5,工具和模型共用一个余额。上方卡片显示的是当前价格;价格页面列出了所有工具。

07

常见问题

?
每个关键词能获取多少条结果?+

limit 可以是 10、20、30、40、50、100 或 all。每 10 条结果为一页,计为一条计费结果,max_results 把一次运行限制在 10 页以内。

能查看其他国家的排名吗?+

可以。把 country 设为 US、GB 或 DE 这样的 ISO 3166 A-2 代码。hl 设置界面语言。

会显示站点链接和相关搜索吗?+

会。自然搜索结果包含站点链接,结果页也包含相关搜索。

能只限定最近的页面吗?+

可以,用 tbs,例如过去一天或一周,或自定义日期范围。

需要订阅吗?+

不需要。你向预付费余额充值,每次运行从中扣费。不会自动续费。

更多相关内容:网页数据提取、研究智能体和工具目录。

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

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