{
"results": {
"airports": [
{
"arrival": [
{
"airport": {
"id": "JFK",
"name": "John F. Kennedy International Airport"
},
"city": "New York",
"country": "United States",
"country_code": "US",
"image": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQEaUa9NsdPWGpAUGkTApkZDT_4M6_6V8wTcC0v1b1wJAJX-BuMSiipXbsoznGgcI1xLOc5QiTcR_xovexgjdOz0gqQe0tRQ9h0bUkZ07Q",
"latitude": 40.6397222,
"longitude": -73.778889,
"thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRa1dwH1NZQk4dsbPiyA9Vrq2RX75jXSZ-OkHn7NkLHl-11HercqDXoZ4p2cDxJkH6vca2degawrCzHEQ"
}
],
"departure": [
{
"airport": {
"id": "FCO",
"name": "Leonardo da Vinci International Airport"
},
"city": "Rome",
"country": "Italy",
"country_code": "IT",
"image": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRM_5snkSVZsnpG8dhW0NGx_Pdwk592nbBjmyqu-UxZDclvuBr6HXfXd0Fm7TYGVQpVCCr4RC6TGTmOgyP6KwpvZr0tGGnpZ7ukzP8RPLA",
"latitude": 41.8002778,
"longitude": 12.2388889,
"thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcT2IU9ZUmvhvThfVJdnmh0sazh2RYI04-GSv0_GLCW7m3TnPpi1XYRNkIuXyL-bdJRgPn7Akcbg6zmDzw"
}
]
}
],
"best_flights": [
{
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"booking_token": "CjRIM0tmOEpYczF1S0lBTlRCSWdCRy0tLS0tLS0tLWNlenYxOEFBQUFBR3NFRkcwSkYyNUVBEgtUUDgzM3xUUDIwORoLCIiiAxACGgNFVVI4HHDhygM=",
"carbon_emissions": {
"difference_percent": 30,
"this_flight": 578000,
"typical_for_this_route": 445000
},
"departure_token": "imRI9b",
"flights": [
{
"airline": "Tap Air Portugal",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"airplane": "Airbus A321neo",
"arrival_airport": {
"id": "LIS",
"name": "Lisbon Airport",
"time": "2026-12-05 14:30"
},
"departure_airport": {
"id": "FCO",
"name": "Leonardo da Vinci International Airport",
"time": "2026-12-05 12:15"
},
"duration": 195,
"extensions": [
"Below average legroom (28 in)",
"Carbon emissions estimate: 133 kg"
],
"flight_number": "TP 833",
"legroom": "28 in",
"travel_class": "Economy"
},
{
"airline": "Tap Air Portugal",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"airplane": "Airbus A321neo",
"arrival_airport": {
"id": "JFK",
"name": "John F. Kennedy International Airport",
"time": "2026-12-05 20:05"
},
"departure_airport": {
"id": "LIS",
"name": "Lisbon Airport",
"time": "2026-12-05 16:35"
},
"duration": 510,
"extensions": [
"Average legroom (31 in)",
"Wi-Fi for a fee",
"In-seat power & USB outlets",
"On-demand video",
"Carbon emissions estimate: 445 kg"
],
"flight_number": "TP 209",
"legroom": "31 in",
"travel_class": "Economy"
}
],
"layovers": [
{
"duration": 125,
"id": "LIS",
"name": "Lisbon Airport"
}
],
"price": 536,
"total_duration": 830,
"type": "One way"
},
{
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AZ.png",
"booking_token": "CjRIM0tmOEpYczF1S0lBTlRCSWdCRy0tLS0tLS0tLWNlenYxOEFBQUFBR3NFRkcwSkYyNUVBEgVBWjYwOBoLCO6dBBACGgNFVVI4HHDO0gQ=",
"carbon_emissions": {
"difference_percent": -15,
"this_flight": 379000,
"typical_for_this_route": 445000
},
"departure_token": "NwYz6d",
"flights": [
{
"airline": "ITA",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AZ.png",
"airplane": "Airbus A330-900neo",
"arrival_airport": {
"id": "JFK",
"name": "John F. Kennedy International Airport",
"time": "2026-12-05 14:15"
},
"departure_airport": {
"id": "FCO",
"name": "Leonardo da Vinci International Airport",
"time": "2026-12-05 10:15"
},
"duration": 600,
"extensions": [
"Average legroom (31 in)",
"Wi-Fi for a fee",
"In-seat USB outlet",
"On-demand video",
"Carbon emissions estimate: 378 kg"
],
"flight_number": "AZ 608",
"legroom": "31 in",
"travel_class": "Economy"
}
],
"price": 694,
"total_duration": 600,
"type": "One way"
},
{
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AZ.png",
"booking_token": "CjRIM0tmOEpYczF1S0lBTlRCSWdCRy0tLS0tLS0tLWNlenYxOEFBQUFBR3NFRkcwSkYyNUVBEgVBWjYxMBoLCO6dBBACGgNFVVI4HHDO0gQ=",
"carbon_emissions": {
"difference_percent": -15,
"this_flight": 379000,
"typical_for_this_route": 445000
},
"departure_token": "NunNce",
"flights": [
{
"airline": "ITA",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AZ.png",
"airplane": "Airbus A330-900neo",
"arrival_airport": {
"id": "JFK",
"name": "John F. Kennedy International Airport",
"time": "2026-12-05 18:55"
},
"departure_airport": {
"id": "FCO",
"name": "Leonardo da Vinci International Airport",
"time": "2026-12-05 14:55"
},
"duration": 600,
"extensions": [
"Average legroom (31 in)",
"Wi-Fi for a fee",
"In-seat USB outlet",
"On-demand video",
"Carbon emissions estimate: 378 kg"
],
"flight_number": "AZ 610",
"legroom": "31 in",
"travel_class": "Economy"
}
],
"price": 694,
"total_duration": 600,
"type": "One way"
},
{
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/DL.png",
"booking_token": "CjRIM0tmOEpYczF1S0lBTlRCSWdCRy0tLS0tLS0tLWNlenYxOEFBQUFBR3NFRkcwSkYyNUVBEgVETDIzMRoLCLyBBRACGgNFVVI4HHD1vwU=",
"carbon_emissions": {
"difference_percent": -8
}
}
]
},
"_note": "Response truncated for documentation purposes"
}
curl --location --request POST 'https://zylalabs.com/api/15322/google+flights+search+api/40927/search+google+flights' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{
"departure_id": "FCO",
"arrival_id": "JFK",
"outbound_date": "2026-12-05",
"type": 2,
"adults": 1,
"currency": "EUR"
}'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 Google 航班搜索 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
`POST /flights` 以 JSON 格式返回实时航班行程,包括出发和到达时间、航空公司、航班号、可用时的飞机详情、航段时长、中途停留、客舱等级、排放量、预订令牌、机场元数据和价格参考字段。
成功的响应包含 `success`、`search_parameters` 和 `results`。`results` 对象包含 `best_flights`、`other_flights`、`price_insights` 和 `airports`。使用 `best_flights` 获取排名靠前的选项,使用 `other_flights` 获取其他行程方案
提供 `departure_id`、`arrival_id` 和 `outbound_date`。还可以设置行程类型和返程日期、乘客人数、舱位等级、经停次数限制、排序方式、航空公司包含或排除、隐藏行程、货币、语言(`hl`)和国家/地区(`gl`)
在 `departure_id` 中传入以逗号分隔的 IATA 代码,例如 `JFK,LGA,EWR`。响应会标明每条行程使用的机场,并在 `results.airports` 中包含匹配的机场元数据。
每个航段可以包含出发和到达机场 ID 及时间戳、航空公司、航班号、时长、舱位、机型以及可用时的腿部空间。多航段行程还会提供中转信息和整体的 `total_duration`。 .
行程可能包含 `carbon_emissions`,其中包括 `this_flight`、`typical_for_this_route` 和 `difference_percent`。排放值为数值,而百分比表示该行程与该路线的典型排放量相比的情况
`results.airports` 可提供 IATA 代码、机场名称、城市、国家、国家代码、纬度、经度、图片和缩略图。单独的出发和到达数组有助于应用显示本地化的机场信息
处理结果前先检查 `success`,然后将 `best_flights` 和 `other_flights` 视为彼此独立的可选数组。空数组表示该类别没有返回任何行程。还要处理可能缺失的可选字段,例如排放量、飞机、图片或价格历史记录。