返回顶部
g

google-flights谷歌航班搜索

Search Google Flights for prices, availability, and deals. Use when user asks about flight prices, searching for flights, comparing airfares, finding the cheapest travel dates, or monitoring prices on regular routes. Supports flexible date search, filters (nonstop, price cap, departure/arrival times), connection quality scoring, and price tracking with alerts.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 2.0.0
安全检测
已通过
1,271
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

google-flights

Google Flights

支持灵活日期、智能筛选、转机评分和价格追踪的航班搜索。

快速开始

bash
cd ~/clawd/skills/google-flights
source .venv/bin/activate

基础搜索

./scripts/search.py LAX JFK tomorrow

灵活日期 — 查找最便宜日期

./scripts/search.py LAX JFK apr 15 --flex 3

直飞且低于500美元

./scripts/search.py SFO ORD next friday --nonstop --max-price 500

监控航线价格变动

./scripts/watch-route.py add LAX JFK --alert-below 350 ./scripts/watch-route.py watch

搜索

基本用法

bash
./scripts/search.py <出发地> <目的地> <日期> [选项]

日期格式

支持自然语言:

  • - tomorrow、today
  • next friday、next week
  • mar 15、March 15、3/15
  • 2026-04-15(ISO格式)

筛选条件

标志简写说明
--flex N-f在日期前后±N天搜索
--nonstop
-n | 仅直飞航班 | | --max-price | -m | 最高价格 | | --depart-after | | 出发时间之后(8am、14:00) | | --arrive-before | | 到达时间之前(6pm、18:00) | | --seat | -s | 经济舱、高级经济舱、商务舱、头等舱 | | --adults | -a | 成人数量(默认:1) | | --children | -c | 儿童数量 | | --return | -r | 往返返程日期 |

输出

标志说明
--top N显示前N个结果(默认:5)
--sort
排序方式:价格(默认)、评分、时长 | | --show-scores | 显示转机质量详情 | | --json | JSON格式输出 |

示例

bash

在一周范围内查找最便宜日期


./scripts/search.py LAX JFK apr 10 --flex 7 --nonstop

上午出发,商务舱

./scripts/search.py SFO LHR may 1 --seat business --depart-after 8am

家庭出行,按转机质量排序

./scripts/search.py DEN MCO jun 15 -a 2 -c 2 --sort score --show-scores

往返低于800美元

./scripts/search.py SEA LAX apr 1 --return apr 8 --max-price 800

价格追踪

追踪特定航班并在价格变动时获取提醒。

bash

追踪特定航班


./scripts/track.py add LAX JFK 2026-05-15 --alert-below 400

追踪往返航班

./scripts/track.py add LAX JFK may 1 --return may 8 -a 350

检查所有追踪的航班

./scripts/track.py check

查看价格历史

./scripts/track.py history LAX-JFK-2026-05-15

列出/移除

./scripts/track.py list ./scripts/track.py remove LAX-JFK-2026-05-15

航线监控

监控常规航线(例如,两个城市间的通勤)。

bash

添加监控航线


./scripts/watch-route.py add LAX JFK --alert-below 400

检查所有监控航线

./scripts/watch-route.py watch

列出监控航线

./scripts/watch-route.py list

移除航线

./scripts/watch-route.py remove LAX-JFK

Cron集成

设置每日价格检查:

bash
openclaw cron add \
--name 航班价格监控 \
--cron 0 9 * \
--tz America/New_York \
--session isolated \
--message cd ~/clawd/skills/google-flights && source .venv/bin/activate && ./scripts/watch-route.py watch。仅当价格低于阈值时提醒用户。

转机质量评分

航班评分0-100分,基于以下因素:

因素影响
直飞航班+15
优选航空公司
+10 |
| 转机时间过紧(<45分钟) | -30 |
| 长时间停留(>4小时) | -5至-25 |
| 问题转机机场 | -10至-20 |
| 冬季天气风险(ORD、EWR等) | -15 |
| 红眼航班(晚上10点后出发) | -15 |
| 过早出发(早上6点前) | -10 |
| 避免乘坐的航空公司 | -25 |

使用--show-scores查看详情,或使用--sort score优先考虑质量排序。

配置

复制config.example.json为config.json并进行自定义:

json
{
preferred_airlines: [United, Delta],
avoid_airlines: [Spirit],
prefer_nonstop: true,
maxlayoverhours: 4,
minlayoverminutes: 45,
home_airports: [LAX, JFK],
loyalty_programs: {
united_mileageplus: gold
}
}

设置

bash
cd ~/clawd/skills/google-flights
uv venv && source .venv/bin/activate && uv pip install fast-flights
chmod +x scripts/*.py
cp config.example.json config.json # 然后编辑

数据文件

  • - ~/clawd/memory/flight-tracking.json — 追踪的航班
  • ~/clawd/memory/flight-prices.jsonl — 价格历史
  • ~/clawd/memory/route-watch-state.json — 监控的航线

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-flights-1776420049 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-flights-1776420049 技能

通过命令行安装

skillhub install google-flights-1776420049

下载

⬇ 下载 google-flights v2.0.0(免费)

文件大小: 15.02 KB | 发布时间: 2026-4-17 18:44

v2.0.0 最新 2026-4-17 18:44
Major update: flexible date search (--flex), filters (nonstop, max-price, depart-after, arrive-before), connection quality scoring, price tracking with alerts, route watching for regular commutes. Breaking: renamed commute.py to watch-route.py for general use.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部