flights
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFlight Search
航班搜索
Search real-time flight schedules and prices via Google Flights data.
通过Google Flights数据搜索实时航班时刻表和价格。
Prerequisites
前置条件
bash
pip install fast-flightsThe CLI is bundled at in this skill directory.
flights-searchscripts/flights-searchbash
pip install fast-flightsflights-searchscripts/flights-searchCLI Usage
CLI使用方法
bash
flights-search <origin> <destination> <date> [options]Origin and destination accept IATA codes (JFK, LAX) or city names (NYC, London, Tokyo). City names automatically search all airports in that metro area.
bash
flights-search <origin> <destination> <date> [options]出发地和目的地支持IATA代码(如JFK、LAX)或城市名称(如NYC、伦敦、东京)。使用城市名称时,会自动搜索该都会区的所有机场。
Examples
示例
bash
undefinedbash
undefinedSearch all NYC airports to LAX
搜索纽约所有机场飞往洛杉矶的航班
flights-search NYC LAX 2026-03-15
flights-search NYC LAX 2026-03-15
Nonstop flights from NYC to Berlin
纽约直飞柏林的航班
flights-search NYC Berlin 2026-03-15 --nonstop
flights-search NYC Berlin 2026-03-15 --nonstop
Evening departures only
仅显示晚间出发的航班
flights-search JFK LHR 2026-03-15 --after 17 --before 22
flights-search JFK LHR 2026-03-15 --after 17 --before 22
Business class
商务舱航班
flights-search NYC London 2026-03-15 --class business
flights-search NYC London 2026-03-15 --class business
Multiple passengers with booking link
多人出行并获取预订链接
flights-search SF Tokyo 2026-04-01 --passengers 2 --link
undefinedflights-search SF Tokyo 2026-04-01 --passengers 2 --link
undefinedOptions
选项
| Option | Description |
|---|---|
| Nonstop flights only |
| Show all flights regardless of stops |
| Depart after hour (24h format) |
| Depart before hour (24h format) |
| Cabin: economy, premium, business, first |
| Number of travelers (default: 1) |
| Print Google Flights URL |
| 选项 | 说明 |
|---|---|
| 仅显示直飞航班 |
| 显示所有航班,无论中转次数 |
| 仅显示指定小时后出发的航班(24小时制) |
| 仅显示指定小时前出发的航班(24小时制) |
| 客舱等级:economy(经济舱)、premium(超级经济舱)、business(商务舱)、first(头等舱) |
| 出行人数(默认:1人) |
| 打印Google Flights的URL链接 |
Supported City Names
支持的城市名称
When you use a city name, the CLI searches all airports in that metro area:
| City | Airports |
|---|---|
| NYC / New York | JFK, EWR, LGA |
| LA / Los Angeles | LAX, BUR, LGB, ONT, SNA |
| SF / San Francisco | SFO, OAK, SJC |
| Chicago | ORD, MDW |
| DC / Washington | DCA, IAD, BWI |
| London | LHR, LGW, STN, LTN, LCY |
| Paris | CDG, ORY |
| Tokyo | NRT, HND |
| Toronto | YYZ, YTZ |
60+ metro areas supported. Use any IATA code directly for airports not in the list.
使用城市名称时,CLI会搜索该都会区的所有机场:
| 城市 | 机场 |
|---|---|
| NYC / 纽约 | JFK, EWR, LGA |
| LA / 洛杉矶 | LAX, BUR, LGB, ONT, SNA |
| SF / 旧金山 | SFO, OAK, SJC |
| 芝加哥 | ORD, MDW |
| DC / 华盛顿 | DCA, IAD, BWI |
| 伦敦 | LHR, LGW, STN, LTN, LCY |
| 巴黎 | CDG, ORY |
| 东京 | NRT, HND |
| 多伦多 | YYZ, YTZ |
支持60+个都会区。对于列表外的机场,可直接使用对应的IATA代码。
Default Behavior
默认行为
By default, the CLI shows only flights with the minimum stops available:
- If nonstops exist → shows only nonstops
- If no nonstops → shows only 1-stop flights
- Use to see everything
--all-stops
默认情况下,CLI仅显示中转次数最少的航班:
- 若存在直飞航班 → 仅显示直飞航班
- 若无直飞航班 → 仅显示1次中转的航班
- 使用可查看所有航班
--all-stops
Output
输出结果
Searching from NYC: JFK, EWR, LGA
Route Depart Arrive Airline Price Duration
------------------------------------------------------------------------------------------------------------
EWR→LAX 6:00 AM on Sat, Mar 7 9:07 AM on Sat, Mar 7 United $289 6 hr 7 min
EWR→LAX 12:00 PM on Sat, Mar 7 3:14 PM on Sat, Mar 7 United $289 6 hr 14 min
JFK→LAX 8:00 AM on Sat, Mar 7 11:30 AM on Sat, Mar 7 Delta $304 5 hr 30 min
3 flight(s) found.Searching from NYC: JFK, EWR, LGA
Route Depart Arrive Airline Price Duration
------------------------------------------------------------------------------------------------------------
EWR→LAX 6:00 AM on Sat, Mar 7 9:07 AM on Sat, Mar 7 United $289 6 hr 7 min
EWR→LAX 12:00 PM on Sat, Mar 7 3:14 PM on Sat, Mar 7 United $289 6 hr 14 min
JFK→LAX 8:00 AM on Sat, Mar 7 11:30 AM on Sat, Mar 7 Delta $304 5 hr 30 min
3 flight(s) found.Notes
注意事项
- Date format:
YYYY-MM-DD - Airport codes: Standard IATA codes (JFK, LAX, LHR, etc.)
- Prices are in USD
- Times shown in local airport timezone
- No API key required — uses Google Flights data via reverse-engineered protobuf API
- Some routes may return price-only results (missing departure/arrival times) due to upstream parsing limitations
- 日期格式:
YYYY-MM-DD - 机场代码:标准IATA代码(如JFK、LAX、LHR等)
- 价格以美元为单位
- 时间显示为当地机场时区
- 无需API密钥 — 通过逆向工程的protobuf API获取Google Flights数据
- 由于上游解析限制,部分航线可能仅返回价格结果(缺少出发/到达时间)
Data Source
数据来源
Uses Google Flights data via the Python package.
fast-flights通过Python包获取Google Flights数据。
fast-flights