search_flights
Search for flights by route and date, compare prices, durations, stops, and airlines. Filter by budget, cabin class, time windows, and more, including one-way, round-trip, and multi-city.
Instructions
Search for flights using Google Flights data via SerpAPI. Returns best_flights and other_flights with full details (price, duration, stops, airline, aircraft, legroom, amenities, carbon emissions) plus price_insights (lowest price, typical range, price history).
Each result includes a booking_token (to get booking links) and for one-way results a departure_token (to get matching return flights for round-trips).
Supports one-way, round-trip, and multi-city. Filters include: nonstop only, max price, cabin class, specific airlines, departure/arrival time windows, layover duration, connecting airport exclusions, and emissions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gl | No | Country code for results (e.g. us, gb, fr) | |
| hl | No | Language code (e.g. en, es, fr) | |
| bags | No | Number of carry-on bags | |
| type | No | 1=Round trip (default), 2=One way, 3=Multi-city | |
| stops | No | 0=Any stops, 1=Nonstop only, 2=1 stop or fewer, 3=2 stops or fewer | |
| adults | No | Number of adults (default 1) | |
| sort_by | No | 1=Top flights, 2=Price, 3=Departure time, 4=Arrival time, 5=Duration, 6=Emissions | |
| children | No | Number of children | |
| currency | No | Currency code (e.g. USD, GBP, EUR) | |
| emissions | No | Set to 1 to only show low-emission flights | |
| max_price | No | Maximum ticket price | |
| arrival_id | Yes | Arrival airport IATA code (e.g. JFK) or Google kgmid. Comma-separate for multiple. | |
| deep_search | No | Enable deeper search matching browser results (slower) | |
| return_date | No | Return date (YYYY-MM-DD). Required for round-trip. | |
| show_hidden | No | Include hidden/unlisted flight results | |
| departure_id | Yes | Departure airport IATA code (e.g. LHR) or Google kgmid (/m/...) | |
| max_duration | No | Maximum total flight duration in minutes | |
| return_times | No | Return flight time range. Same format as outbound_times. | |
| travel_class | No | 1=Economy, 2=Premium economy, 3=Business, 4=First | |
| exclude_basic | No | Exclude basic economy fares (US domestic only, requires gl=us and economy class) | |
| exclude_conns | No | Comma-separated airport codes to exclude as connections | |
| outbound_date | Yes | Outbound date (YYYY-MM-DD) | |
| infants_on_lap | No | Infants on lap | |
| outbound_times | No | Departure time range as 'min,max' hours (e.g. '6,20') or 'depMin,depMax,arrMin,arrMax' | |
| infants_in_seat | No | Infants in seat | |
| multi_city_json | No | JSON array of legs for multi-city (type=3). Each leg: {"departure_id":"CDG","arrival_id":"LHR","date":"YYYY-MM-DD"} | |
| exclude_airlines | No | Comma-separated airline IATA codes to exclude. Cannot combine with include_airlines. | |
| include_airlines | No | Comma-separated airline IATA codes to include (e.g. BA,AA). Cannot combine with exclude_airlines. | |
| layover_duration | No | Layover duration range in minutes as 'min,max' (e.g. '60,240') |