npx skills add https://github.com/skillhq/flight-search --skill google-flights通过 agent-browser 搜索 Google Flights,查找航班价格、时刻表和可用性。
--session econ 和 --session biz--session flights--session flights使用自然语言 ?q= 参数构建 URL。直接加载结果 — 。
Search Google Flights via agent-browser to find flight prices, schedules, and availability.
--session econ and --session biz--session flights--session flights广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
https://www.google.com/travel/flights?q=Flights+from+{ORIGIN}+to+{DEST}+on+{DATE}[+returning+{DATE}][+one+way][+business+class][+N+passengers]
始终并行运行两个会话 — 经济舱和商务舱 — 以显示价格差异。由于两者同时加载,这不会增加额外时间。
# 并行启动两者(将第一个放入后台)
agent-browser --session econ open "https://www.google.com/travel/flights?q=Flights+from+BKK+to+NRT+on+2026-03-20+returning+2026-03-27" &
agent-browser --session biz open "https://www.google.com/travel/flights?q=Flights+from+BKK+to+NRT+on+2026-03-20+returning+2026-03-27+business+class" &
wait
# 等待两者加载完成
agent-browser --session econ wait --load networkidle &
agent-browser --session biz wait --load networkidle &
wait
# 为两者创建快照
agent-browser --session econ snapshot -i
agent-browser --session biz snapshot -i
# 关闭 biz 会话(仅用于价格差异列);保持 econ 会话存活以获取预订链接
agent-browser --session biz close
然后以紧凑列表格式呈现结果(见下文输出格式部分)。
匹配逻辑:通过航空公司名称和起飞时间匹配航班。并非所有经济舱航班都有对应的商务舱航班(例如 ZIPAIR、Air Japan 等廉价航空公司不提供商务舱)。当没有商务舱匹配项时显示 "—"。
提示:当某家航空公司出现在商务舱结果中但未出现在经济舱结果中时(例如菲律宾航空),可能意味着该航线仅提供商务舱定价。在结果中包含该航班,经济舱价格显示为 "—"。
模式相同 — 只需在两个 URL 中都添加 +one+way:
agent-browser --session econ open "https://www.google.com/travel/flights?q=Flights+from+LAX+to+LHR+on+2026-04-15+one+way" &
agent-browser --session biz open "https://www.google.com/travel/flights?q=Flights+from+LAX+to+LHR+on+2026-04-15+one+way+business+class" &
wait
如果用户明确要求商务舱(而非比较),则仅运行商务舱会话:
agent-browser --session flights open "https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2026-06-01+returning+2026-06-15+business+class"
agent-browser --session flights wait --load networkidle
agent-browser --session flights snapshot -i
# 保持会话存活以获取预订链接
agent-browser --session flights open "https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2026-06-01+returning+2026-06-15+first+class+2+adults+1+child"
agent-browser --session flights wait --load networkidle
agent-browser --session flights snapshot -i
# 保持会话存活以获取预订链接
| 功能 | URL 语法 | 状态 |
|---|---|---|
| 往返 | +returning+YYYY-MM-DD | 有效 |
| 单程 | +one+way | 有效 |
| 商务舱 | +business+class | 有效 |
| 头等舱 | +first+class | 有效 |
| N 名乘客(成人) | +N+passengers | 有效 |
| 成人 + 儿童 | +2+adults+1+child | 有效 |
| IATA 代码 | BKK, NRT, LAX | 有效 |
| 城市名称 | Bangkok, Tokyo | 有效 |
| 日期格式 YYYY-MM-DD | 2026-03-20 | 有效(最佳) |
| 自然语言日期 | March+20 | 有效 |
| 超级经济舱 | +premium+economy | 无效 |
| 多城市 | N/A | 无效 |
每个航班显示为一个带有完整描述的 link 元素:
link "From 20508 Thai baht round trip total. Nonstop flight with Air Japan.
Leaves Suvarnabhumi Airport at 12:10 AM on Friday, March 20 and arrives
at Narita International Airport at 8:15 AM on Friday, March 20.
Total duration 6 hr 5 min. Select flight"
将经济舱和商务舱快照解析为紧凑列表格式:
1. JAL — Nonstop · 5h 55m
8:05 AM → 4:00 PM
Economy: THB 23,255 · Business: THB 65,915 (+183%)
2. THAI — Nonstop · 5h 50m
10:30 PM → 6:20 AM+1
Economy: THB 28,165 · Business: THB 75,000 (+166%)
3. Air Japan — Nonstop · 6h 05m
12:10 AM → 8:15 AM
Economy: THB 20,515 · Business: —
4. ZIPAIR — Nonstop · 5h 45m
11:45 PM → 7:30 AM+1
Economy: THB 21,425 · Business: —
匹配:通过航空公司 + 起飞时间配对经济舱和商务舱结果。没有商务舱的廉价航空公司显示 "—"。如果 Google 显示 "最佳"/"最便宜" 标签,请一并包含。
呈现结果表格后,务必提供预订链接:"需要这些航班的预订链接吗?请告诉我您选择哪一个。"
当用户选择某个航班后,通过点击快照中该航班的 link 元素来提取预订选项。Google Flights 会显示一个包含预订提供商(航空公司、在线旅行社)的面板,每个提供商都有价格和指向预订网站的 "继续" 链接。
# 用户选择航班 #N — 点击结果快照中对应的链接
agent-browser --session econ click @eN
agent-browser --session econ wait 3000
agent-browser --session econ snapshot -i
预订面板快照将显示如下 link 元素:
link "Book with Emirates THB 28,960" → href="https://..."
link "Book with Booking.com THB 29,512" → href="https://..."
link "Book with Teaflight THB 28,171" → href="https://..."
从每个链接中提取提供商名称、价格和 href URL。
📋 Booking Options for JAL BKK→NRT (5h 55m, Nonstop)
| Provider | Price | Book |
|----------|-------|------|
| Emirates | THB 28,960 | [Continue](https://...) |
| Booking.com | THB 29,512 | [Continue](https://...) |
| Teaflight | THB 28,171 | [Continue](https://...) |
--session biz 在获取结果后立即关闭(仅用于价格差异)。在用户获取预订链接或拒绝后,关闭结果会话。用于多城市、超级经济舱或 URL 路径失败的情况。
agent-browser --session flights open "https://www.google.com/travel/flights"
agent-browser --session flights wait 3000
agent-browser --session flights snapshot -i
如果出现同意横幅,请先点击 "全部接受" 或 "全部拒绝"。
agent-browser --session flights click @eN # 行程类型组合框("往返")
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # "单程" 或 "多城市"
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
舱位等级:
agent-browser --session flights click @eN # 舱位等级组合框
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # 选择舱位等级
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
乘客:
agent-browser --session flights click @eN # 乘客按钮
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # 点击 "+" 增加成人/儿童/婴儿数量
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # "完成"
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # 组合框字段
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
agent-browser --session flights fill @eN "BKK"
agent-browser --session flights wait 2000 # 关键:等待自动补全
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # 点击建议项(切勿按 Enter 键)
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # 日期文本框
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
# 日历将日期显示为按钮:"Friday, March 20, 2026"
agent-browser --session flights click @eN # 点击目标日期
agent-browser --session flights wait 500
agent-browser --session flights snapshot -i
# 点击 "完成" 关闭日历
agent-browser --session flights click @eN # "完成" 按钮
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
"完成" 仅关闭日历。您必须单独点击 "搜索"。
agent-browser --session flights click @eN # "搜索" 按钮
agent-browser --session flights wait --load networkidle
agent-browser --session flights snapshot -i
# 保持会话存活以获取预订链接
选择 "多城市" 行程类型后,表单会为每个航段显示一行:
按顺序填写每个航段的目的地和日期,然后点击 "搜索"。
始终使用紧凑列表格式 — 切勿使用 Markdown 表格。输出通常显示在聊天机器人界面(Telegram 等)中,这些界面表格渲染效果不佳。
1. JAL — Nonstop · 5h 55m
8:05 AM → 4:00 PM
Economy: THB 23,255 · Business: THB 65,915 (+183%)
2. THAI — Nonstop · 5h 50m
10:30 PM → 6:20 AM+1
Economy: THB 28,165 · Business: THB 75,000 (+166%)
3. Air Japan — Nonstop · 6h 05m
12:10 AM → 8:15 AM
Economy: THB 20,515 · Business: —
1. JAL — Nonstop · 5h 55m
8:05 AM → 4:00 PM · THB 23,255
2. THAI — Nonstop · 5h 50m
10:30 PM → 6:20 AM+1 · THB 28,165
| 规则 | 原因 |
|---|---|
| 优先使用 URL 快速路径 | 3 条命令 vs 15+ 条交互命令 |
使用 wait --load networkidle | 比固定 wait 5000 更智能 — 在网络稳定后返回 |
机场使用 fill 而非 type | 先清除现有文本 |
| 输入机场代码后等待 2 秒 | 自动补全需要 API 往返 |
| 始终点击建议项,切勿按 Enter | 对于自动补全,Enter 键不可靠 |
| 每次交互后重新创建快照 | DOM 变化会使引用失效 |
| "完成" ≠ 搜索 | 日历的完成仅关闭选择器 |
| 呈现结果后,提供预订链接 | 用户几乎总是想预订 — 主动提示 |
保持结果会话存活;结果后关闭 biz | 结果会话用于预订点击;biz 仅用于价格差异 |
同意弹窗:在快照中点击 "全部接受" 或 "全部拒绝"。
URL 快速路径无效:回退到交互式流程。某些地区/区域设置处理 ?q= 的方式不同。
无结果:检查机场(检查组合框标签)、日期是否为未来日期,或等待更长时间。
机器人检测 / 验证码:通知用户。不要解决验证码。稍等片刻后重试。
每周安装次数
443
代码仓库
首次出现
2026 年 2 月 9 日
安全审计
安装于
gemini-cli421
codex420
github-copilot419
opencode418
kimi-cli417
amp417
Construct a URL with a natural language ?q= parameter. Loads results directly — 3 commands total.
https://www.google.com/travel/flights?q=Flights+from+{ORIGIN}+to+{DEST}+on+{DATE}[+returning+{DATE}][+one+way][+business+class][+N+passengers]
Always run two parallel sessions — economy and business — to show the price delta. This adds no extra time since both load concurrently.
# Launch both in parallel (background the first)
agent-browser --session econ open "https://www.google.com/travel/flights?q=Flights+from+BKK+to+NRT+on+2026-03-20+returning+2026-03-27" &
agent-browser --session biz open "https://www.google.com/travel/flights?q=Flights+from+BKK+to+NRT+on+2026-03-20+returning+2026-03-27+business+class" &
wait
# Wait for both to load
agent-browser --session econ wait --load networkidle &
agent-browser --session biz wait --load networkidle &
wait
# Snapshot both
agent-browser --session econ snapshot -i
agent-browser --session biz snapshot -i
# Close biz (only needed for delta column); keep econ alive for booking links
agent-browser --session biz close
Then present results in compact list format (see Output Format section below).
Matching logic : Match flights by airline name and departure time. Not all economy flights have a business equivalent (budget carriers like ZIPAIR, Air Japan don't offer business). Show "—" when no business match exists.
Tip : When an airline appears in business results but not economy (e.g., Philippine Airlines), it may operate business-only pricing on that route. Include it with "—" for economy.
Same pattern — just add +one+way to both URLs:
agent-browser --session econ open "https://www.google.com/travel/flights?q=Flights+from+LAX+to+LHR+on+2026-04-15+one+way" &
agent-browser --session biz open "https://www.google.com/travel/flights?q=Flights+from+LAX+to+LHR+on+2026-04-15+one+way+business+class" &
wait
If the user specifically asks for business class (not a comparison), run just the business session:
agent-browser --session flights open "https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2026-06-01+returning+2026-06-15+business+class"
agent-browser --session flights wait --load networkidle
agent-browser --session flights snapshot -i
# Keep session alive for booking links
agent-browser --session flights open "https://www.google.com/travel/flights?q=Flights+from+JFK+to+CDG+on+2026-06-01+returning+2026-06-15+first+class+2+adults+1+child"
agent-browser --session flights wait --load networkidle
agent-browser --session flights snapshot -i
# Keep session alive for booking links
| Feature | URL syntax | Status |
|---|---|---|
| Round trip | +returning+YYYY-MM-DD | Works |
| One way | +one+way | Works |
| Business class | +business+class | Works |
| First class | +first+class | Works |
| N passengers (adults) | +N+passengers | Works |
| Adults + children | +2+adults+1+child | Works |
| IATA codes | BKK, NRT, LAX | Works |
| City names | Bangkok, Tokyo | Works |
| Dates as YYYY-MM-DD | 2026-03-20 | Works (best) |
| Natural dates | March+20 | Works |
| Premium economy | +premium+economy | Fails |
| Multi-city | N/A | Fails |
Each flight appears as a link element with a full description:
link "From 20508 Thai baht round trip total. Nonstop flight with Air Japan.
Leaves Suvarnabhumi Airport at 12:10 AM on Friday, March 20 and arrives
at Narita International Airport at 8:15 AM on Friday, March 20.
Total duration 6 hr 5 min. Select flight"
Parse economy + business snapshots into the compact list format :
1. JAL — Nonstop · 5h 55m
8:05 AM → 4:00 PM
Economy: THB 23,255 · Business: THB 65,915 (+183%)
2. THAI — Nonstop · 5h 50m
10:30 PM → 6:20 AM+1
Economy: THB 28,165 · Business: THB 75,000 (+166%)
3. Air Japan — Nonstop · 6h 05m
12:10 AM → 8:15 AM
Economy: THB 20,515 · Business: —
4. ZIPAIR — Nonstop · 5h 45m
11:45 PM → 7:30 AM+1
Economy: THB 21,425 · Business: —
Matching : Pair economy and business results by airline + departure time. Budget carriers without business class show "—". Include "Best"/"Cheapest" labels from Google when present.
After presenting the results table, always offer booking links : "Want booking links for any of these? Just say which one."
When the user picks a flight, extract booking options by clicking the flight's link element in the snapshot. Google Flights shows a panel with booking providers (airlines, OTAs) each with a price and a "Continue" link to the booking site.
# User picks flight #N — click the corresponding link from the results snapshot
agent-browser --session econ click @eN
agent-browser --session econ wait 3000
agent-browser --session econ snapshot -i
The booking panel snapshot will show link elements like:
link "Book with Emirates THB 28,960" → href="https://..."
link "Book with Booking.com THB 29,512" → href="https://..."
link "Book with Teaflight THB 28,171" → href="https://..."
Extract the provider name, price, and href URL from each link.
📋 Booking Options for JAL BKK→NRT (5h 55m, Nonstop)
| Provider | Price | Book |
|----------|-------|------|
| Emirates | THB 28,960 | [Continue](https://...) |
| Booking.com | THB 29,512 | [Continue](https://...) |
| Teaflight | THB 28,171 | [Continue](https://...) |
--session biz immediately (only needed for delta). Close the results session after the user gets booking links or declines.Use for multi-city, premium economy, or when the URL path fails.
agent-browser --session flights open "https://www.google.com/travel/flights"
agent-browser --session flights wait 3000
agent-browser --session flights snapshot -i
If a consent banner appears, click "Accept all" or "Reject all" first.
agent-browser --session flights click @eN # Trip type combobox ("Round trip")
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # "One way" or "Multi-city"
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
Cabin class:
agent-browser --session flights click @eN # Cabin class combobox
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # Select class
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
Passengers:
agent-browser --session flights click @eN # Passengers button
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # "+" for Adults/Children/Infants
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # "Done"
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # Combobox field
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
agent-browser --session flights fill @eN "BKK"
agent-browser --session flights wait 2000 # CRITICAL: wait for autocomplete
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # Click suggestion (NEVER press Enter)
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
agent-browser --session flights click @eN # Date textbox
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
# Calendar shows dates as buttons: "Friday, March 20, 2026"
agent-browser --session flights click @eN # Click target date
agent-browser --session flights wait 500
agent-browser --session flights snapshot -i
# Click "Done" to close calendar
agent-browser --session flights click @eN # "Done" button
agent-browser --session flights wait 1000
agent-browser --session flights snapshot -i
"Done" only closes the calendar. You MUST click "Search" separately.
agent-browser --session flights click @eN # "Search" button
agent-browser --session flights wait --load networkidle
agent-browser --session flights snapshot -i
# Keep session alive for booking links
After selecting "Multi-city" trip type, the form shows one row per leg:
Fill each leg's destination + date in order, then click "Search".
Always use compact list format — never markdown tables. Output is typically displayed in chatbot interfaces (Telegram, etc.) where tables render poorly.
1. JAL — Nonstop · 5h 55m
8:05 AM → 4:00 PM
Economy: THB 23,255 · Business: THB 65,915 (+183%)
2. THAI — Nonstop · 5h 50m
10:30 PM → 6:20 AM+1
Economy: THB 28,165 · Business: THB 75,000 (+166%)
3. Air Japan — Nonstop · 6h 05m
12:10 AM → 8:15 AM
Economy: THB 20,515 · Business: —
1. JAL — Nonstop · 5h 55m
8:05 AM → 4:00 PM · THB 23,255
2. THAI — Nonstop · 5h 50m
10:30 PM → 6:20 AM+1 · THB 28,165
| Rule | Why |
|---|---|
| Prefer URL fast path | 3 commands vs 15+ interactive |
wait --load networkidle | Smarter than fixed wait 5000 — returns when network settles |
Use fill not type for airports | Clears existing text first |
| Wait 2s after typing airport codes | Autocomplete needs API roundtrip |
| Always CLICK suggestions, never Enter | Enter is unreliable for autocomplete |
| Re-snapshot after every interaction | DOM changes invalidate refs |
| "Done" ≠ Search | Calendar Done only closes picker |
| After presenting results, offer booking links | Users almost always want to book — prompt them |
Keep results session alive; close biz after results | Results session needed for booking clicks; biz only for delta |
Consent popups : Click "Accept all" or "Reject all" in the snapshot.
URL fast path didn't work : Fall back to interactive. Some regions/locales handle ?q= differently.
No results : Verify airports (check combobox labels), dates in the future, or wait longer.
Bot detection / CAPTCHA : Inform user. Do NOT solve CAPTCHAs. Retry after a short wait.
See references/interaction-patterns.md for:
Weekly Installs
443
Repository
First Seen
Feb 9, 2026
Security Audits
Installed on
gemini-cli421
codex420
github-copilot419
opencode418
kimi-cli417
amp417
Azure RBAC 权限管理工具:查找最小角色、创建自定义角色与自动化分配
101,200 周安装