npx skills add https://github.com/skillhq/hotel-search --skill google-hotels通过 agent-browser 搜索 Google Hotels,以查找酒店价格、评分、设施和可用性。
始终使用 --session hotels 进行隔离。
构建一个包含编码的位置和日期的 URL。直接加载结果——总共只需 3 条命令。
https://www.google.com/travel/search?q={QUERY}&qs=CAE4AA&ts={TS_PARAM}&ap=MAE
其中 {QUERY} 是位置/酒店名称, 是 base64 编码的日期参数。
Search Google Hotels via agent-browser to find hotel prices, ratings, amenities, and availability.
Always use --session hotels for isolation.
Build a URL with location and dates encoded. Loads results directly — 3 commands total.
https://www.google.com/travel/search?q={QUERY}&qs=CAE4AA&ts={TS_PARAM}&ap=MAE
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
{TS_PARAM}Google Hotels 使用 protobuf 编码的 ts 参数表示日期。字节布局针对 2025-2030 年固定。使用此 bash 函数生成:
hotel_ts() {
local ci_y=$1 ci_m=$2 ci_d=$3 co_y=$4 co_m=$5 co_d=$6 nights=$7
local cyl=$(printf '%02x' $(( ($ci_y & 0x7f) | 0x80 )))
local cyh=$(printf '%02x' $(($ci_y >> 7)))
local col=$(printf '%02x' $(( ($co_y & 0x7f) | 0x80 )))
local coh=$(printf '%02x' $(($co_y >> 7)))
echo -n "08011a200a021a00121a12140a0708${cyl}${cyh}10$(printf '%02x' $ci_m)18$(printf '%02x' $ci_d)120708${col}${coh}10$(printf '%02x' $co_m)18$(printf '%02x' $co_d)18$(printf '%02x' $nights)32020801" \
| xxd -r -p | base64 | tr -d '\n='
}
# 用法:hotel_ts 入住年 月 日 退房年 月 日 晚数
# 示例:hotel_ts 2026 3 15 2026 3 20 5
# 输出:CAEaIAoCGgASGhIUCgcI6g8QAxgPEgcI6g8QAxgUGAUyAggB
限制:年份 2025-2030,月份 1-12,日期 1-31,晚数 1-127。这些涵盖了所有现实的酒店搜索。
| 格式 | 示例 |
|---|---|
| 城市 | Hotels+in+Bangkok |
| 城市 + 国家 | Hotels+in+Bangkok+Thailand |
| 街区 | Hotels+in+Shibuya+Tokyo |
| 地标附近 | Hotels+near+Eiffel+Tower |
| 区域 | Hotels+in+Amalfi+Coast |
| 机场 | Hotels+near+BKK+airport |
| 特定酒店 | Haus+im+Tal+Munich |
| 功能 | 通过 URL? |
|---|---|
| 位置 | ✅ 是(通过 q=) |
| 日期 | ✅ 是(通过ts=) |
| 客人/房间 | ❌ 交互式设置(默认:1 间房,2 位客人) |
| 过滤器(星级、价格、设施) | ❌ 交互式设置 |
# 步骤 1:生成 ts 参数
ts=$(hotel_ts 2026 3 15 2026 3 20 5)
# 步骤 2:使用位置 + 日期打开——结果立即加载
agent-browser --session hotels open "https://www.google.com/travel/search?q=Hotels+in+Bangkok&qs=CAE4AA&ts=${ts}&ap=MAE"
agent-browser --session hotels wait --load networkidle
agent-browser --session hotels snapshot -i
# 步骤 3:从快照中提取结果,然后关闭
agent-browser --session hotels close
ts=$(hotel_ts 2026 3 9 2026 3 12 3)
agent-browser --session hotels open "https://www.google.com/travel/search?q=Haus+im+Tal+Munich&qs=CAE4AA&ts=${ts}&ap=MAE"
agent-browser --session hotels wait --load networkidle
agent-browser --session hotels snapshot -i
agent-browser --session hotels close
如果用户未指定日期,请省略 ts、qs 和 ap 参数:
agent-browser --session hotels open "https://www.google.com/travel/search?q=Hotels+in+Bangkok"
agent-browser --session hotels wait --load networkidle
agent-browser --session hotels snapshot -i
结果将显示“起价”。如果用户稍后提供日期,则交互式设置日期(参见深度参考)。
有关详细的交互式工作流程(日历导航、客人/房间选择器、过滤器),请参阅深度参考。
将结果呈现为单个富表格:
| # | Hotel | Stars | Rating | Price/Night | Total | Via | Key Amenities |
|---|-------|-------|--------|-------------|-------|-----|---------------|
| 1 | Sukhothai Bangkok | ★★★★★ | 9.2 | $185 | $925 | Hotels.com | Pool, Spa, WiFi |
| 2 | Centara Grand | ★★★★★ | 8.8 | $165 | $825 | Booking.com | Pool, Gym, WiFi |
| 3 | Ibis Sukhumvit | ★★★ | 7.4 | $45 | $225 | Agoda | WiFi, Restaurant |
仅当用户明确要求比较不同搜索时使用(例如,“比较涩谷和新宿的酒店”)。
agent-browser --session shibuya open "https://www.google.com/travel/search?q=Hotels+in+Shibuya+Tokyo" &
agent-browser --session shinjuku open "https://www.google.com/travel/search?q=Hotels+in+Shinjuku+Tokyo" &
wait
agent-browser --session shibuya wait --load networkidle &
agent-browser --session shinjuku wait --load networkidle &
wait
# 在两个会话中设置日期,然后为两个会话拍摄快照
agent-browser --session shibuya snapshot -i
agent-browser --session shinjuku snapshot -i
agent-browser --session shibuya close &
agent-browser --session shinjuku close &
wait
| 规则 | 原因 |
|---|---|
首选带 ts= 的 URL 快速路径 | 带日期只需 3 条命令,交互式则需 10 条以上 |
wait --load networkidle | 比固定的 wait 5000 更智能 |
| 日期可用时始终在 URL 中编码 | 使用 hotel_ts 生成 ts 参数 |
文本使用 fill 而非 type | 先清除现有文本 |
| 输入位置后等待 2 秒 | 自动补全需要 API 往返 |
| 点击建议,切勿按 Enter | Enter 键对于自动补全不可靠 |
| 每次交互后重新拍摄快照 | DOM 更改会使引用失效 |
| 检查“查看价格” | 意味着日期尚未设置 |
| 搜索期间切勿离开 Google Hotels | 例外:结果后为检查直接预订访问酒店自有网站 |
| 使用“<”和“>”导航日历 | 日历可能打开在错误的月份——使用箭头向前或向后导航 |
| 问题 | 解决方案 |
|---|---|
| 同意弹出窗口 | 点击“全部接受”或“全部拒绝” |
| URL 快速路径失败 | 回退到 google.com/travel/hotels 交互式流程 |
| 无结果 / “查看价格” | 设置入住和退房日期 |
| 日历打开在错误的月份 | 使用“<”箭头向后导航或“>”向前导航。导航后始终重新拍摄快照以确认目标月份可见 |
| 快照被日历覆盖层阻挡 | 按 Escape 键关闭日历,重新拍摄快照,然后重新打开日期选择器并重试 |
| 价格过时 | 价格是实时且指示性的——提及此注意事项 |
| 货币不匹配 | Google 使用浏览器区域设置货币——注意任何差异 |
| 验证码 | 通知用户。不要解决。短暂等待后重试 |
| 地图视图而非列表 | 点击“列表”或“查看列表”切换按钮 |
| 未找到酒店 | 尝试变体:全名、简称、名称+城市、名称+街区 |
呈现结果后,务必询问用户是否希望您检查是否有更好的优惠。可以这样表述:
“需要我检查 [酒店名称] 的官方网站是否有促销代码或会员价吗?直接预订通常比 OTA 更便宜。”
在新会话(--session direct)中打开酒店自有网站并查找:
# Google Hotels 搜索完成后,访问酒店的直接网站
agent-browser --session direct open "https://www.example-hotel.com"
agent-browser --session direct wait --load networkidle
agent-browser --session direct snapshot -i
# 查找:促销横幅、“优惠”或“特惠”链接、预订小部件价格
agent-browser --session direct close
如果酒店属于大型连锁集团,请提及忠诚度计划——会员通常能获得更优价格、房间升级或积分:
| 连锁集团 | 品牌 | 忠诚度计划 | 典型会员福利 |
|---|---|---|---|
| IHG | Holiday Inn, InterContinental, Crowne Plaza, Kimpton, Indigo | IHG One Rewards | 会员价(通常最便宜)、赚取积分、奖励住宿第 4 晚免费 |
| Marriott | Marriott, Sheraton, Westin, W, Ritz-Carlton, Courtyard, Aloft | Marriott Bonvoy | 会员价、移动端入住、积分/里程 |
| Hilton | Hilton, DoubleTree, Hampton, Conrad, Waldorf Astoria | Hilton Honors | 会员折扣、奖励住宿第 5 晚免费、数字钥匙 |
| Accor | Sofitel, Novotel, ibis, Mercure, Moxy, Fairmont | ALL - Accor Live Limitless | 会员价、会籍福利 |
| Hyatt | Hyatt, Andaz, Park Hyatt, Thompson | World of Hyatt | 会员价、免费住宿奖励、套房升级 |
Google Hotels 快照通常包含连锁集团名称:
"Holiday Inn Express Bangkok Sukhumvit 11 by IHG" → IHG"Courtyard by Marriott Bangkok" → Marriott"Hilton Munich City" → Hilton"Novotel Muenchen City" → Accor对于独立/精品酒店(如 Haus im Tal):
检查后,呈现直接预订与 OTA 的比较:
## Haus im Tal — 预订比较
| Source | Room Type | Price/Night | Total (3 nights) | Notes |
|--------|-----------|-------------|-------------------|-------|
| Booking.com | Downtown Cozy | €183 | €549 | Free cancellation |
| Hotel direct | Downtown Cozy | €175 | €525 | Use code HIT24 for 5% off |
| Hotel direct (with code) | Downtown Cozy | €166 | €499 | Best price |
提示:始终提醒用户您无法完成预订——仅提供找到的链接和任何促销代码。
有关以下内容,请参阅 references/interaction-patterns.md:
每周安装次数
103
仓库
首次出现
2026年3月4日
安全审计
安装于
cursor102
gemini-cli102
github-copilot102
codex102
amp102
cline102
Where {QUERY} is the location/hotel name and {TS_PARAM} is a base64-encoded date parameter.
Google Hotels uses a protobuf-encoded ts parameter for dates. The byte layout is fixed for years 2025-2030. Use this bash function to generate it:
hotel_ts() {
local ci_y=$1 ci_m=$2 ci_d=$3 co_y=$4 co_m=$5 co_d=$6 nights=$7
local cyl=$(printf '%02x' $(( ($ci_y & 0x7f) | 0x80 )))
local cyh=$(printf '%02x' $(($ci_y >> 7)))
local col=$(printf '%02x' $(( ($co_y & 0x7f) | 0x80 )))
local coh=$(printf '%02x' $(($co_y >> 7)))
echo -n "08011a200a021a00121a12140a0708${cyl}${cyh}10$(printf '%02x' $ci_m)18$(printf '%02x' $ci_d)120708${col}${coh}10$(printf '%02x' $co_m)18$(printf '%02x' $co_d)18$(printf '%02x' $nights)32020801" \
| xxd -r -p | base64 | tr -d '\n='
}
# Usage: hotel_ts CHECKIN_YEAR MONTH DAY CHECKOUT_YEAR MONTH DAY NIGHTS
# Example: hotel_ts 2026 3 15 2026 3 20 5
# Output: CAEaIAoCGgASGhIUCgcI6g8QAxgPEgcI6g8QAxgUGAUyAggB
Constraints : Years 2025-2030, months 1-12, days 1-31, nights 1-127. These cover all realistic hotel searches.
| Format | Example |
|---|---|
| City | Hotels+in+Bangkok |
| City + country | Hotels+in+Bangkok+Thailand |
| Neighborhood | Hotels+in+Shibuya+Tokyo |
| Near landmark | Hotels+near+Eiffel+Tower |
| Region | Hotels+in+Amalfi+Coast |
| Airport | Hotels+near+BKK+airport |
| Specific hotel | Haus+im+Tal+Munich |
| Feature | Via URL? |
|---|---|
| Location | ✅ Yes (via q=) |
| Dates | ✅ Yes (viats=) |
| Guests / rooms | ❌ Set interactively (default: 1 room, 2 guests) |
| Filters (stars, price, amenities) | ❌ Set interactively |
# Step 1: Generate ts parameter
ts=$(hotel_ts 2026 3 15 2026 3 20 5)
# Step 2: Open with location + dates — results load immediately
agent-browser --session hotels open "https://www.google.com/travel/search?q=Hotels+in+Bangkok&qs=CAE4AA&ts=${ts}&ap=MAE"
agent-browser --session hotels wait --load networkidle
agent-browser --session hotels snapshot -i
# Step 3: Extract results from snapshot, then close
agent-browser --session hotels close
ts=$(hotel_ts 2026 3 9 2026 3 12 3)
agent-browser --session hotels open "https://www.google.com/travel/search?q=Haus+im+Tal+Munich&qs=CAE4AA&ts=${ts}&ap=MAE"
agent-browser --session hotels wait --load networkidle
agent-browser --session hotels snapshot -i
agent-browser --session hotels close
If the user doesn't specify dates, omit the ts, qs, and ap parameters:
agent-browser --session hotels open "https://www.google.com/travel/search?q=Hotels+in+Bangkok"
agent-browser --session hotels wait --load networkidle
agent-browser --session hotels snapshot -i
Results will show "starting from" prices. Set dates interactively if the user provides them later (see deep-dive reference).
For detailed interactive workflows (calendar navigation, guest/room selector, filters), see the deep-dive reference.
Present results as a single rich table:
| # | Hotel | Stars | Rating | Price/Night | Total | Via | Key Amenities |
|---|-------|-------|--------|-------------|-------|-----|---------------|
| 1 | Sukhothai Bangkok | ★★★★★ | 9.2 | $185 | $925 | Hotels.com | Pool, Spa, WiFi |
| 2 | Centara Grand | ★★★★★ | 8.8 | $165 | $825 | Booking.com | Pool, Gym, WiFi |
| 3 | Ibis Sukhumvit | ★★★ | 7.4 | $45 | $225 | Agoda | WiFi, Restaurant |
Only use when the user explicitly asks for a comparison between distinct searches (e.g., "Compare hotels in Shibuya vs Shinjuku").
agent-browser --session shibuya open "https://www.google.com/travel/search?q=Hotels+in+Shibuya+Tokyo" &
agent-browser --session shinjuku open "https://www.google.com/travel/search?q=Hotels+in+Shinjuku+Tokyo" &
wait
agent-browser --session shibuya wait --load networkidle &
agent-browser --session shinjuku wait --load networkidle &
wait
# Set dates in both sessions, then snapshot both
agent-browser --session shibuya snapshot -i
agent-browser --session shinjuku snapshot -i
agent-browser --session shibuya close &
agent-browser --session shinjuku close &
wait
| Rule | Why |
|---|---|
Prefer URL fast path with ts= | 3 commands with dates vs 10+ interactive |
wait --load networkidle | Smarter than fixed wait 5000 |
| Always encode dates in URL when available | Use hotel_ts to generate the ts parameter |
Use fill not type for text | Clears existing text first |
| Wait 2s after typing location | Autocomplete needs API roundtrip |
| Click suggestions, never Enter | Enter is unreliable for autocomplete |
| Re-snapshot after every interaction | DOM changes invalidate refs |
| Check for "View prices" | Means dates aren't set yet |
| Never leave Google Hotels during search | Exception: hotel's own site for direct booking check after results |
| Navigate calendar with "<" and ">" | Calendar may open on wrong month — use arrows to go backward or forward |
| Problem | Solution |
|---|---|
| Consent popup | Click "Accept all" or "Reject all" |
| URL fast path fails | Fall back to google.com/travel/hotels interactive flow |
| No results / "View prices" | Set check-in and check-out dates |
| Calendar opens on wrong month | Use "<" arrow to navigate backward or ">" to go forward. Always re-snapshot after navigating to confirm target month is visible |
| Snapshot blocked by calendar overlay | Press Escape to close the calendar, re-snapshot, then re-open the date picker and try again |
| Stale pricing | Prices are real-time and indicative — mention this caveat |
| Currency mismatch | Google uses browser locale currency — note any discrepancy |
| CAPTCHA | Inform user. Do NOT solve. Retry after a short wait |
| Map view instead of list | Click "List" or "View list" toggle |
| Hotel not found | Try variations: full name, shorter name, name + city, name + neighborhood |
After presenting results, always ask the user if they'd like you to check for better deals. Phrase it like:
"Want me to check [hotel name]'s direct website for promo codes or member rates? Direct booking is often cheaper than OTAs."
Open the hotel's own website in a new session (--session direct) and look for:
# After Google Hotels search is done, visit hotel's direct site
agent-browser --session direct open "https://www.example-hotel.com"
agent-browser --session direct wait --load networkidle
agent-browser --session direct snapshot -i
# Look for: promo banners, "offers" or "deals" links, booking widget prices
agent-browser --session direct close
If the hotel belongs to a major chain, mention the loyalty program — members often get better rates, room upgrades, or points:
| Chain | Brands | Loyalty Program | Typical Member Perks |
|---|---|---|---|
| IHG | Holiday Inn, InterContinental, Crowne Plaza, Kimpton, Indigo | IHG One Rewards | Member rate (often cheapest), points earning, 4th night free on reward stays |
| Marriott | Marriott, Sheraton, Westin, W, Ritz-Carlton, Courtyard, Aloft | Marriott Bonvoy | Member rate, mobile check-in, points/miles |
| Hilton | Hilton, DoubleTree, Hampton, Conrad, Waldorf Astoria | Hilton Honors | Member discount, 5th night free on reward stays, digital key |
| Accor | Sofitel, Novotel, ibis, Mercure, Moxy, Fairmont | ALL - Accor Live Limitless | Member rates, status benefits |
| Hyatt | Hyatt, Andaz, Park Hyatt, Thompson | World of Hyatt | Member rate, free night awards, suite upgrades |
The Google Hotels snapshot often includes the chain name:
"Holiday Inn Express Bangkok Sukhumvit 11 by IHG" → IHG"Courtyard by Marriott Bangkok" → Marriott"Hilton Munich City" → Hilton"Novotel Muenchen City" → AccorFor independent/boutique hotels (like Haus im Tal):
After checking, present a direct vs OTA comparison:
## Haus im Tal — Booking Comparison
| Source | Room Type | Price/Night | Total (3 nights) | Notes |
|--------|-----------|-------------|-------------------|-------|
| Booking.com | Downtown Cozy | €183 | €549 | Free cancellation |
| Hotel direct | Downtown Cozy | €175 | €525 | Use code HIT24 for 5% off |
| Hotel direct (with code) | Downtown Cozy | €166 | €499 | Best price |
Tip : Always remind the user that you cannot complete the booking — just provide the link and any promo codes found.
See references/interaction-patterns.md for:
Weekly Installs
103
Repository
First Seen
Mar 4, 2026
Security Audits
Installed on
cursor102
gemini-cli102
github-copilot102
codex102
amp102
cline102
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
40,000 周安装