Skip to main content
Fli provides comprehensive filtering options to help you find exactly the flights you need. All filters can be combined to create highly targeted searches.

Cabin class

Filter flights by cabin class using the SeatType enum:

Available cabin classes

  • SeatType.ECONOMY - Economy class (default)
  • SeatType.PREMIUM_ECONOMY - Premium economy
  • SeatType.BUSINESS - Business class
  • SeatType.FIRST - First class

Stops

Control the maximum number of stops using the MaxStops enum:

Available stop options

  • MaxStops.ANY - Any number of stops (default)
  • MaxStops.NON_STOP - Direct flights only
  • MaxStops.ONE_STOP_OR_FEWER - Maximum one stop
  • MaxStops.TWO_OR_FEWER_STOPS - Maximum two stops
The MaxStops enum uses internal values (0-3) but provides descriptive names for clarity.

Airlines

Restrict results to specific airlines by passing a list of Airline enums:

Common airline codes

  • Airline.AA - American Airlines
  • Airline.BA - British Airways
  • Airline.DL - Delta Air Lines
  • Airline.UA - United Airlines
  • Airline.AF - Air France
  • Airline.LH - Lufthansa
  • Airline.VS - Virgin Atlantic
  • Airline.AC - Air Canada
  • Airline.JL - Japan Airlines
  • Airline.QF - Qantas
See the Airline enum for the complete list of supported airlines.
The airlines filter only includes flights operated by the specified carriers. Codeshare flights may not appear in results.

Time windows

Restrict departure and arrival times using TimeRestrictions. All times are in hours from midnight (0-23) in local time:

Time restriction parameters

  • earliest_departure - Earliest departure time (0-23)
  • latest_departure - Latest departure time (0-23)
  • earliest_arrival - Earliest arrival time (0-23)
  • latest_arrival - Latest arrival time (0-23)
All parameters are optional. You can specify only departure times, only arrival times, or any combination.

Sorting

Sort flight results using the SortBy enum:

Available sorting options

  • SortBy.NONE - Default Google Flights sorting (default)
  • SortBy.TOP_FLIGHTS - Google’s recommended flights
  • SortBy.CHEAPEST - Lowest price first
  • SortBy.DEPARTURE_TIME - Earliest departure first
  • SortBy.ARRIVAL_TIME - Earliest arrival first
  • SortBy.DURATION - Shortest duration first
The TOP_FLIGHTS option uses Google’s algorithm to balance price, duration, and convenience.

Advanced filtering

Duration limits

Set a maximum total flight duration in minutes:

Layover restrictions

Control layover airports and maximum layover duration:

Price limits

Set a maximum price for flights:
Currently only USD is supported for price limits.

Combining filters

All filters can be combined for highly specific searches:

Filter validation

Fli uses Pydantic models to validate all filter parameters. Invalid values will raise a ValidationError:
Common validation errors include:
  • Same departure and arrival airports
  • Travel dates in the past
  • Invalid time ranges (earliest > latest)
  • Missing required fields