FlightSearchFilters
Complete set of filters for flight search on specific dates.TripType
default:"TripType.ONE_WAY"
Type of flight journey (round trip or one-way)
PassengerInfo
required
Passenger configuration for the search
list[FlightSegment]
required
List of flight segments (typically 1 for one-way, 2 for round trip)
MaxStops
default:"MaxStops.ANY"
Maximum number of stops allowed in the flight
SeatType
default:"SeatType.ECONOMY"
Cabin class preference
PriceLimit | None
default:"None"
Maximum price constraint for the search
list[Airline] | None
default:"None"
Filter by specific airlines
int | None
default:"None"
Maximum flight duration in minutes
LayoverRestrictions | None
default:"None"
Constraints for layovers in multi-leg flights
SortBy
default:"SortBy.NONE"
Sorting option for flight results
Methods
list
Formats filters into Google Flights API structure
str
URL encodes the formatted filters for API request
DateSearchFilters
Filters for searching flights across a date range to find cheapest travel dates.TripType
default:"TripType.ONE_WAY"
Type of flight journey (round trip or one-way)
PassengerInfo
required
Passenger configuration for the search
list[FlightSegment]
required
List of flight segments for the search
MaxStops
default:"MaxStops.ANY"
Maximum number of stops allowed in the flight
SeatType
default:"SeatType.ECONOMY"
Cabin class preference
PriceLimit | None
default:"None"
Maximum price constraint for the search
list[Airline] | None
default:"None"
Filter by specific airlines
int | None
default:"None"
Maximum flight duration in minutes
LayoverRestrictions | None
default:"None"
Constraints for layovers in multi-leg flights
str
required
Start date for the search range in YYYY-MM-DD format
str
required
End date for the search range in YYYY-MM-DD format
int | None
default:"None"
Trip duration in days (required for round trips)
Properties
datetime
Parses the from_date string into a datetime object
datetime
Parses the to_date string into a datetime object
Methods
list
Formats filters into Google Flights API structure
str
URL encodes the formatted filters for API request
FlightSegment
A segment represents a single portion of a flight journey between two airports.list[list[Airport | int]]
required
Nested list structure for departure airports (matches Google Flights API format)
list[list[Airport | int]]
required
Nested list structure for arrival airports (matches Google Flights API format)
str
required
Travel date in YYYY-MM-DD format (must not be in the past)
TimeRestrictions | None
default:"None"
Time constraints for departure and arrival
FlightResult | None
default:"None"
Previously selected flight for fetching return flights
Properties
datetime
Parses the travel_date string into a datetime object
PassengerInfo
Passenger configuration for flight search.int
default:"1"
Number of adult passengers (non-negative)
int
default:"0"
Number of child passengers (non-negative)
int
default:"0"
Number of infants occupying a seat (non-negative)
int
default:"0"
Number of infants sitting on an adult’s lap (non-negative)
TimeRestrictions
Time constraints for flight departure and arrival in local time. All times are in hours from midnight (e.g., 20 = 8:00 PM).int | None
default:"None"
Earliest departure time in hours (0-23)
int | None
default:"None"
Latest departure time in hours (1-24)
int | None
default:"None"
Earliest arrival time in hours (0-23)
int | None
default:"None"
Latest arrival time in hours (1-24)
PriceLimit
Maximum price constraint for flight search.int
required
Maximum price (positive integer)
Currency | None
default:"Currency.USD"
Currency for the price limit (currently only USD is supported)
LayoverRestrictions
Constraints for layovers in multi-leg flights.list[Airport] | None
default:"None"
Specific airports to allow for layovers
int | None
default:"None"
Maximum layover duration in minutes (positive integer)