使用场景

制定房价前,先对标目的地的酒店价格

按目的地和日期以 JSON 获取 Booking.com 酒店,含住宿总价、评分、星级和免费取消,用来对标每晚房价。

预付费,无订阅REST 或 MCP一个密钥搞定模型、数据和智能体
Booking.comlovelyjsonitems[0]"name": "Hotel Alfama Vista""price": "412""currency": "USD""review_score": 8.7"stars": 4"free_cancellation": true

定房价之前,得知道周边酒店在相同日期收什么价,以及这个价格对应的是什么:评分、星级、能否免费取消。在订房网站上手动查,就是一次搜索、一次滚动、一行表格地慢慢来。Lovely Router 替你执行搜索:发送目的地和日期,每家酒店返回一个 JSON 对象,按酒店数量从预付费余额中计费。

交给你的 AI 智能体

把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。

制定房价前,先对标目的地的酒店价格. 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/booking-hotels/run。在输入中设置 maxItems,并在请求体中把 max_results 设为你想获取的酒店数量。运行会从你的余额中预留它的最高费用,并以 JSON 返回酒店。

  3. 与你自己的房价对比

    保存每次运行的结果并记下取数日期。把你的房价与同类酒店的中位数比较,并观察随着入住日临近,市场如何变化。

02

一次请求获取酒店房价

搜索 Booking.com 酒店在 search 中接受目的地。可选字段有 checkin、checkout、adults 和 currency;maxItems 限制酒店数量:

curl https://lovelyrouter.com/v1/tools/booking-hotels/run \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "input": {
      "search": "Lisbon",
      "maxItems": 10,
      "currency": "USD"
    },
    "max_results": 10
  }'

运行超过 60 秒仍未结束时会返回 202;轮询方法见运行工具。不指定日期时,搜索的是 30 天后的一晚。以 YYYY-MM-DD 格式传入 checkin 和 checkout,即可为特定的住宿定价。单次运行最多可返回 100 家酒店。

03

每家酒店包含什么

字段组你得到什么
Identity酒店名称和地址
Price住宿期间的总价,以你选择的币种显示
Quality评分和星级
Policy是否可免费取消
04

实用做法

制定周末房价。

对即将到来的周五到周日运行目的地搜索,保留星级和评分与你相近的酒店,以它们的中位数为参照定价。

盯紧高需求日期。

连续六周每天对同一座城市和同样的日期运行一次,保存每家酒店的价格,看市场从何时开始上涨。

比较免费取消的溢价。

把一次运行的结果分成可免费取消和不可免费取消两组,衡量在你所在的市场里,灵活房价要贵多少。

评估一个新市场。

在进入或收购某座新城市的酒店之前,先拉取 100 家酒店,再看价格、星级和评分的分布,找出空白所在。

为客户报价行程。

旅行社可以针对同样的日期运行三个目的地,向客户展示价格与评分对照的表格。

想直接用自然语言?连接 MCP 服务器,然后对 Claude Code 或 Cursor 说:“搜索 3 月 12 日到 15 日里斯本的 Booking.com 酒店,2 位成人,以 EUR 计价,显示价格、评分和星级,并按价格排序。把 max_results 设为 50。”

06

费用

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

没有订阅,也没有月度最低消费:最低 $5 起充值,一份余额同时支付工具和模型。上方的卡片显示今天的价格;定价列出了每个工具。

07

常见问题

?
如何为特定的住宿定价?+

以 YYYY-MM-DD 格式传入 checkin 和 checkout。如果留空,搜索的是 30 天后的一晚。

可以使用哪些币种?+

currency 接受 USD、EUR、GBP、AUD、CAD、CHF、CNY、JPY、INR、BRL、MXN、SEK、NOK、DKK、PLN、AED、SGD、ZAR、TRY 和 RUB。默认值为 USD。

单次运行最多能返回多少家酒店?+

每次运行最多 100 家。maxItems 是输入中的上限。

可以设置入住人数吗?+

可以。adults 设置成人入住人数,默认值为 2。

需要订阅吗?+

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

要为一个目的地定价?参见旅行与房地产数据、把同样方法用于商品的电商情报,以及工具目录。

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

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