Search Google Flights (SerpAPI)
google_flights_searchSearch 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 same params re-sent without stops — tell the user that no direct flights were found and connecting flights are shown.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "google_flights_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gl | No | Country code for the search, e.g. 'us', 'uk', 'de'. | |
| hl | No | Language code, e.g. 'en', 'es', 'fr'. | |
| bags | No | Number of carry-on bags. Default 0. | |
| type | No | Trip type: 1 = round trip (default), 2 = one way, 3 = multi-city. | |
| stops | No | Max stops: 0 = any (default), 1 = nonstop only, 2 = 1 stop or fewer, 3 = 2 stops or fewer. When stops=1 finds no nonstop flight, the server automatically retries without the filter and returns connecting flights with a `note`; send a departure_token/booking_token from those with the same params but no stops. | |
| adults | No | Number of adults. Default 1. | |
| sort_by | No | Sort order: 1 = top flights (default), 2 = price, 3 = departure time, 4 = arrival time, 5 = duration, 6 = emissions. | |
| children | No | Number of children. Default 0. | |
| currency | No | Currency of returned prices (ISO code, e.g. 'USD', 'EUR'). Default USD. | |
| no_cache | No | Force a fresh SerpAPI fetch and bypass this server's result cache. Default false. | |
| emissions | No | Emissions filter: 1 = less emissions only. Omit for no filter. | |
| max_price | No | Maximum ticket price in the selected currency. | |
| arrival_id | No | Arrival AIRPORT IATA code(s) (e.g. 'HND,NRT') or a Google location kgmid (e.g. '/m/07dfk' for Tokyo). Comma-separate multiple. NOT a city/metro code — TYO, LON, PAR, MIL, ROM, OSA return no results; list the airports instead. | |
| zero_trace | No | Enterprise-only ZeroTrace mode: don't store search params/metadata on SerpAPI. Default false. | |
| deep_search | No | Run a deeper search that matches the Google Flights browser results more closely (slower). Default false. | |
| return_date | No | Return date, YYYY-MM-DD. Required when type=1 (round trip). | |
| show_hidden | No | Include hidden flight results. Default false. | |
| departure_id | No | Departure AIRPORT IATA code(s) (3-letter, uppercase, e.g. 'WAW' or 'WAW,WMI') or a Google location kgmid (/m/… or /g/…). Comma-separate multiple. NOT a city/metro code — TYO, NYC, LON, PAR, MIL, ROM return no results; list the airports instead (NYC → 'JFK,EWR,LGA'). Used for type 1/2; for multi-city (type 3) use multi_city_json instead. | |
| max_duration | No | Maximum total trip duration in minutes (e.g. 1500 for 25h). | |
| return_times | No | Return time window, same format as outbound_times. Only valid when type=1. | |
| travel_class | No | Travel class: 1 = economy (default), 2 = premium economy, 3 = business, 4 = first. | |
| booking_token | No | Token from a prior result, used to fetch booking options for a selected itinerary. Re-send the same search params alongside it. Mutually exclusive with departure_token. | |
| exclude_basic | No | Exclude basic-economy fares. Only for domestic US flights with travel_class=1. Default false. | |
| exclude_conns | No | Connecting airports to exclude: comma-separated 3-letter IATA codes (e.g. 'CDG,LHR'). | |
| outbound_date | No | Outbound date, YYYY-MM-DD. | |
| infants_on_lap | No | Number of infants on lap. Default 0. | |
| outbound_times | No | Outbound time window as comma-separated hours (0-23). 2 values = departure range 'min,max' (e.g. '4,18'); 4 values add an arrival range (e.g. '4,18,3,19'). | |
| departure_token | No | Token from a prior result, used to select an outbound flight and fetch the returning flights (round trip) or the next leg (multi-city). Re-send the same search params alongside it. Mutually exclusive with booking_token. | |
| infants_in_seat | No | Number of infants in seat. Default 0. | |
| multi_city_json | No | Multi-city itinerary (required when type=3): a JSON-string array of legs, e.g. '[{"departure_id":"CDG","arrival_id":"NRT","date":"2026-06-27"},{"departure_id":"NRT","arrival_id":"LAX","date":"2026-07-03"}]'. Each leg may include an optional "times" field (same format as outbound_times). | |
| exclude_airlines | No | Exclude these airlines: comma-separated 2-letter IATA codes, or an alliance (STAR_ALLIANCE, SKYTEAM, ONEWORLD). Mutually exclusive with include_airlines. | |
| include_airlines | No | Only these airlines: comma-separated 2-letter IATA codes, or an alliance: STAR_ALLIANCE, SKYTEAM, ONEWORLD. Mutually exclusive with exclude_airlines. | |
| layover_duration | No | Layover duration range in minutes, 'min,max' (e.g. '90,330' for 1.5-5.5h). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Present only when stops=1 found no nonstop flight and best_flights/other_flights are connecting flights from a search without the stop filter. Tell the user that no direct flights were found, so connecting flights are shown. | |
| query | Yes | ||
| source | Yes | ||
| airports | No | ||
| fetchedAt | Yes | ||
| best_flights | No | ||
| other_flights | No | ||
| price_insights | No | ||
| search_metadata | No | ||
| search_parameters | No |