This project has been archived by its maintainers, and is no longer receiving any updates.
Agentic Flights
Agentic Flights gives AI agents a command-line tool and Python API for searching Google Flights. It can compare exact itineraries or explore combinations of airports, dates, and trip lengths without dumping every raw result into the conversation.
It supports one-way, round-trip, and multi-city searches, plus filters for price, stops, airlines, times, duration, and overhead cabin baggage.
[!IMPORTANT] This is an unofficial project and is not affiliated with Google. Google can change its pages without notice, and fares can change between a search and checkout. Confirm the final price, baggage rules, and availability with the seller.
Install
Agentic Flights requires Python 3.11 or newer.
python -m pip install agentic-google-flights-tool
The browser search uses Google Chrome if it is installed. Otherwise, install Playwright's Chromium build:
python -m playwright install chromium
Check the installation and print the bundled agent instructions:
agentic-flights guide
Give it to an AI agent
Paste the following into an agent that can run terminal commands, then replace the bracketed text with your trip:
Install Agentic Flights with `python -m pip install agentic-google-flights-tool`.
Run `agentic-flights guide` and follow those instructions to search for my trip.
Trip: [origin, destination, dates or flexibility, number of travelers, currency,
and preferences such as stops, baggage, price, or departure times].
For example:
Find flights from Madrid or Barcelona to Tokyo or Osaka for 12 to 15 nights in
October 2027. One adult, economy, at most one stop, and one overhead cabin bag.
Compare price and total travel time. Show me the best three tradeoffs and verify
the final price and baggage allowance before recommending one.
The installed package includes both the short workflow and the full technical reference:
agentic-flights guide
agentic-flights guide reference
agentic-flights guide schema
No repository checkout is needed.
Run a search yourself
The CLI accepts a JSON file or JSON from standard input. This example runs one discovery search and saves the full report in the managed local cache:
agentic-flights - <<'JSON'
{
"provider": "browser",
"max_workers": 1,
"searches": [
{
"request_id": "mad-lis",
"origin": "MAD",
"destination": "LIS",
"departure_date": "2027-01-21",
"return_date": "2027-01-28",
"cabin": "economy",
"max_stops": "non_stop",
"adults": 1,
"currency": "EUR",
"language": "en-US",
"country": "ES",
"search_mode": "discover",
"max_results": 5
}
]
}
JSON
The command prints a compact summary with a run ID such as rgf_.... Use that ID to inspect the saved report without searching Google again:
agentic-flights summary RUN_ID
agentic-flights list RUN_ID --page-size 5
agentic-flights show RUN_ID RESULT_ID
To keep the complete JSON report at a path you choose, add --output flights.json. Use --full only when you explicitly want the entire report on standard output.
Discovery and verification
search_mode: "discover" reads a broad set of candidates with less browser work. Use it to compare routes and dates.
search_mode: "verify" follows selected flight combinations to Google's final itinerary page. Use it for shortlisted round trips or multi-city trips that need a complete ticket price or baggage evidence. Discovery prices for multi-leg trips can be provisional, so do not add one-way prices together and call the result a verified fare.
Use the Python API
The distribution keeps the import name reverse_google_flights for compatibility:
from reverse_google_flights import BatchExecutor, SearchSpec
from reverse_google_flights.cache import FileCache
from reverse_google_flights.provider import BrowserProvider
from reverse_google_flights.store import ManagedStore
store = ManagedStore()
store.initialize()
executor = BatchExecutor(
FileCache(store.provider_cache / "browser", namespace=BrowserProvider.version),
max_workers=1,
)
report = executor.execute(
[
SearchSpec(
request_id="mad-lis",
origin="MAD",
destination="LIS",
departure_date="2027-01-21",
return_date="2027-01-28",
currency="EUR",
language="en-US",
country="ES",
search_mode="discover",
)
]
)
print(report.model_dump_json(indent=2))
For flexible-date exploration, multi-city inputs, filtering, retrieval limits, cache behavior, and complete-ticket verification, read the technical reference.
Connect through MCP
python -m pip install "agentic-google-flights-tool[mcp]"
agentic-flights-mcp
Use stdio, or add --transport streamable-http for local HTTP. The adapter exposes
planning, resumable exploration, comparison, inspection, and verification through
saved run IDs. Agents can load input schemas on demand with schema.
Limits and responsible use
Google Flights does not publish a consumer search API. This project depends on undocumented page behavior and may need updates when Google changes it. Search results are dated observations, not reservations or price guarantees.
Keep browser concurrency low. Do not use this project to bypass access controls, overload services, or automate purchases. You are responsible for following the terms, policies, and laws that apply to your use.
Project links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentic_google_flights_tool-0.2.0.tar.gz.
File metadata
- Download URL: agentic_google_flights_tool-0.2.0.tar.gz
- Upload date:
- Size: 120.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8aa51d08bdc3996c0066232f72f3000b57f9f6f78c41b802d25e82fd8619ff3
|
|
| MD5 |
f2df01bd512b57ff41ff1c57200c4afc
|
|
| BLAKE2b-256 |
1f6fc48f1f1472156eb34ed197a93b0fd0b6975e10fea6a1429e1dc1aeb5d8e7
|
Provenance
The following attestation bundles were made for agentic_google_flights_tool-0.2.0.tar.gz:
Publisher:
publish.yml on alberto-tamez/agentic-google-flights-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_google_flights_tool-0.2.0.tar.gz -
Subject digest:
f8aa51d08bdc3996c0066232f72f3000b57f9f6f78c41b802d25e82fd8619ff3 - Sigstore transparency entry: 2755846512
- Sigstore integration time:
-
Permalink:
alberto-tamez/agentic-google-flights-tool@f09083e9c778eee1c511a63ab32e2435617e0445 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/alberto-tamez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f09083e9c778eee1c511a63ab32e2435617e0445 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agentic_google_flights_tool-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agentic_google_flights_tool-0.2.0-py3-none-any.whl
- Upload date:
- Size: 48.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9273dd0810ea362e362c3f20880dad62b680a1148e54b3d1046593200cbf2c7e
|
|
| MD5 |
9c90c564a8ba0cf5b3fa57703df4e508
|
|
| BLAKE2b-256 |
1945389561954040f93de5da0208bd4eccedfcc31c7b4040f9ef26fda011ac5e
|
Provenance
The following attestation bundles were made for agentic_google_flights_tool-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on alberto-tamez/agentic-google-flights-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_google_flights_tool-0.2.0-py3-none-any.whl -
Subject digest:
9273dd0810ea362e362c3f20880dad62b680a1148e54b3d1046593200cbf2c7e - Sigstore transparency entry: 2755846536
- Sigstore integration time:
-
Permalink:
alberto-tamez/agentic-google-flights-tool@f09083e9c778eee1c511a63ab32e2435617e0445 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/alberto-tamez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f09083e9c778eee1c511a63ab32e2435617e0445 -
Trigger Event:
workflow_dispatch
-
Statement type: