Reverse-engineering Google Flights for scripts and LLMs
Fli reverse-engineers Google Flights' internal API to give scripts, terminals, and LLM agents a stable, scraper-free way to search fares.

What it does
Fli is a Python library and command-line tool that searches Google Flights by hitting its internal API directly. It exposes one-way, round-trip, and multi-city queries with the usual filters—cabin class, alliances, layover windows, and currency—then returns structured results. It also ships as an MCP server, so LLM assistants can call it natively.
The interesting bit
Instead of scraping HTML or driving a headless browser, the project reverse-engineered Google Flights’ own API contracts. That should mean fewer breakages when someone at Google moves a div. The MCP layer is the obvious modern twist: Claude Desktop (or any MCP client) can ask for fares the same way it would read a file.
Key highlights
- Reverse-engineered API access to Google Flights; no browser automation or HTML parsing involved
- Supports one-way, round-trip, multi-city, and flexible-date searches
- Fine-grained filters including airline inclusion/exclusion, alliance restrictions, layover duration, departure windows, and locale overrides
- Built-in rate limiting, automatic retries, and input validation
- MCP server mode over STDIO or HTTP, exposing
search_flightsandsearch_datestools
Caveats
- The
--format jsonoption for both flight and date searches is marked experimental, with the schema still settling
Verdict Worth a look if you want to automate travel search or give an LLM agent real-time fare data. Skip it if you need a vendor-backed, officially supported API with stability guarantees.
Frequently asked
- What is punitarani/fli?
- Fli reverse-engineers Google Flights' internal API to give scripts, terminals, and LLM agents a stable, scraper-free way to search fares.
- Is fli open source?
- Yes — punitarani/fli is open source, released under the MIT license.
- What language is fli written in?
- punitarani/fli is primarily written in Python.
- How popular is fli?
- punitarani/fli has 3k stars on GitHub.
- Where can I find fli?
- punitarani/fli is on GitHub at https://github.com/punitarani/fli.