Skip to main content
This guide will get you searching for flights in minutes using either the CLI or Python API.
Make sure you’ve installed Fli before continuing.

CLI usage

The Fli CLI provides an intuitive command-line interface for flight searches. Search for one-way flights between two airports on a specific date:
This searches for flights from New York (JFK) to Los Angeles (LAX) on October 25, 2025.

Advanced search with filters

Add filters to narrow your search:
Use fli flights --help to see all available options and filters.

Find cheapest dates

Search for the cheapest dates to fly within a date range:

CLI options reference

Python API

Use Fli programmatically in your Python applications. Here’s a complete example searching for one-way flights:
Search for round-trip flights with outbound and return segments:
Find the cheapest dates to travel within a date range:

Advanced search with filters

Use advanced filters for complex searches:

Understanding the data models

Airport codes use the standard IATA 3-letter codes:

Running examples

Fli includes 11 comprehensive examples in the source repository:
Available examples:
  • basic_one_way_search.py - Simple one-way flight search
  • round_trip_search.py - Round-trip flight booking
  • date_range_search.py - Find cheapest dates
  • complex_flight_search.py - Advanced filtering and multi-passenger
  • time_restrictions_search.py - Time-based filtering
  • date_search_with_preferences.py - Weekend filtering
  • price_tracking.py - Price monitoring over time
  • error_handling_with_retries.py - Robust error handling
  • result_processing.py - Data analysis with pandas
  • complex_round_trip_validation.py - Advanced round-trip with validation
  • advanced_date_search_validation.py - Complex date search with filtering
All examples include automatic dependency checking and will show helpful installation instructions if dependencies are missing.

Next steps

MCP Server

Set up the MCP server for Claude Desktop integration

API Reference

Explore the complete API documentation

CLI Reference

Learn about all CLI commands and options

Examples

Browse more code examples and use cases