google_flights_search
Search Google Flights (SerpAPI)
Search Google Flights live via SerpAPI. Returns best_flights and other_flights (each with legs, airlines, times, duration, layovers, price and carbon emissions), plus price_insights and airport info. Supports round trip (type=1, needs return_date), one way (type=2) and multi-city (type=3 via multi_city_json). Two-step flows: pass a departure_token from a prior result to get the returning flights / next leg, or a booking_token to get booking options — re-send the original search params alongside either token. Prices are in `currency` (default USD). IDs are AIRPORT codes, never city/metro codes: TYO, NYC, LON, PAR, MIL, ROM, OSA, CHI, WAS return NO results (live-verified) — send the airports instead (TYO → 'HND,NRT'; NYC → 'JFK,EWR,LGA'; LON → 'LHR,LGW,STN,LTN'; PAR → 'CDG,ORY'; MIL → 'MXP,LIN,BGY'; ROM → 'FCO,CIA') or the city's Google kgmid (e.g. '/m/07dfk' for Tokyo). Result shape: { note?, source, fetchedAt, query, search_metadata: { google_flights_url }, search_parameters, best_flights: [...], other_flights: [...], price_insights, airports } — the two itinerary lists are `best_flights` and `other_flights` (there is no `flights` or `deals` key at the top level, and an itinerary is never a bare flight). Each itinerary: { flights: [{ departure_airport: { name, id, time }, arrival_airport: { name, id, time }, duration, airplane, airline, airline_logo, travel_class, flight_number, legroom, extensions }], layovers: [{ duration, name, id, overnight }], total_duration, carbon_emissions, price, type, airline_logo, departure_token, booking_token } — `price` is the whole-itinerary price in `currency`, `duration`/`total_duration` are minutes, and the per-leg times are local 'YYYY-MM-DD HH:MM' strings. Feed `departure_token` back for the return leg and `booking_token` for booking options. A top-level `note` appears only when stops=1 found no nonstop flight and the server retried without the stop filter: the itineraries are then connecting flights, and their tokens need the sa
glhlbagstypestopsadultssort_bychildrencurrencyno_cacheemissionsmax_price另有 21 個