定房价之前,得知道周边酒店在相同日期收什么价,以及这个价格对应的是什么:评分、星级、能否免费取消。在订房网站上手动查,就是一次搜索、一次滚动、一行表格地慢慢来。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>工作原理
选择目的地和日期
填写城市、地区或地标,以及你要定价的入住和退房日期。选择你的收入报表所用的币种。
设置上限后运行工具
把搜索条件发送到
POST /v1/tools/booking-hotels/run。在输入中设置maxItems,并在请求体中把max_results设为你想获取的酒店数量。运行会从你的余额中预留它的最高费用,并以 JSON 返回酒店。与你自己的房价对比
保存每次运行的结果并记下取数日期。把你的房价与同类酒店的中位数比较,并观察随着入住日临近,市场如何变化。
一次请求获取酒店房价
搜索 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 家酒店。
每家酒店包含什么
| 字段组 | 你得到什么 |
|---|---|
| Identity | 酒店名称和地址 |
| Price | 住宿期间的总价,以你选择的币种显示 |
| Quality | 评分和星级 |
| Policy | 是否可免费取消 |
实用做法
对即将到来的周五到周日运行目的地搜索,保留星级和评分与你相近的酒店,以它们的中位数为参照定价。
连续六周每天对同一座城市和同样的日期运行一次,保存每家酒店的价格,看市场从何时开始上涨。
把一次运行的结果分成可免费取消和不可免费取消两组,衡量在你所在的市场里,灵活房价要贵多少。
在进入或收购某座新城市的酒店之前,先拉取 100 家酒店,再看价格、星级和评分的分布,找出空白所在。
旅行社可以针对同样的日期运行三个目的地,向客户展示价格与评分对照的表格。
想直接用自然语言?连接 MCP 服务器,然后对 Claude Code 或 Cursor 说:“搜索 3 月 12 日到 15 日里斯本的 Booking.com 酒店,2 位成人,以 EUR 计价,显示价格、评分和星级,并按价格排序。把 max_results 设为 50。”
与其他旅行数据来源搭配
酒店价格放在住客的评价,以及同一座城市里其他在售选择旁边,才更有意义:
Booking.com 上某目的地(及日期)的酒店:名称、评分、价格、地址。
Booking.com 酒店的住客评论:评分、好评、差评、旅客类型、日期。
某地点在 Tripadvisor 上的酒店、餐厅和景点。
某地点及日期的 Airbnb 房源:价格、评分、房东、设施。
Google Flights 上某航线和日期的航班与票价:航空公司、时间、经停、时长、价格。
booking-reviews读取住客对你所对标酒店的评价。tripadvisor-places提供对酒店及周边其他场所的另一种视角。airbnb-listings展示同样日期下的短租替代选择。google-flights显示前往当地的成本,这会影响需求。
关于旅行数据的更多内容,参见旅行与房地产数据。
费用
按酒店数量计费:启动运行时会预留其最高费用,即每次调用费加上每家酒店费乘以 max_results,运行结束后按实际返回的结果结算,其余预留金额退回你的余额。失败或超时的运行只为已交付的酒店付费,启动时就被拒绝的运行不收费。
没有订阅,也没有月度最低消费:最低 $5 起充值,一份余额同时支付工具和模型。上方的卡片显示今天的价格;定价列出了每个工具。
常见问题
如何为特定的住宿定价?+
以 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。
需要订阅吗?+
不需要。你向预付费余额充值,每次运行从中扣减。失败的运行只为已交付的结果付费,也不会自动续费。