Fli is a powerful Python library and command-line tool that provides direct programmatic access to Google Flights data through reverse-engineered API interactions rather than traditional web scraping. This approach enables faster, more reliable, and more stable access to flight information, avoiding the fragility associated with HTML parsing and UI changes. The library supports a wide range of flight search capabilities, including filtering by airline, departure time, number of stops, cabin class, and sorting by price or duration, making it suitable for both casual queries and advanced travel analysis. In addition to its CLI interface, fli includes a Model Context Protocol (MCP) server that allows AI assistants to interact with flight data using structured tools, enabling natural language queries and automation workflows.
Features
- Direct interaction with Google Flights API without web scraping
- Advanced flight search filters for airlines, stops, and time windows
- Flexible date search to find cheapest travel options
- Command-line interface for fast and scriptable usage
- MCP server for integration with AI assistants
- Built-in reliability features like retries, validation, and rate limiting