Skip to main content
Archived

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

agentic_google_flights_tool-0.3.0.tar.gz (125.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentic_google_flights_tool-0.3.0-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file agentic_google_flights_tool-0.3.0.tar.gz.

File metadata

File hashes

Hashes for agentic_google_flights_tool-0.3.0.tar.gz
Algorithm Hash digest
SHA256 96547f7d8561020ddb4355776e32b04ff9478f2355ff2ec37a34d17f362ab5cb
MD5 4f064543424eadbd7404c0423cf90bde
BLAKE2b-256 5f27486c6ff71dce45894eea5885c886c53834a0ffed2ad6690402eddaf6ea04

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentic_google_flights_tool-0.3.0.tar.gz:

Publisher: publish.yml on alberto-tamez/agentic-google-flights-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentic_google_flights_tool-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentic_google_flights_tool-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab8beb26c6f5cfca014c90d8fb3ef5ccd52aa3c3247e2ec733c6ae9b56c18bca
MD5 ab7603a7ea8489555f1f7f7b79748d32
BLAKE2b-256 1a98d5378396071c8c8ba82e5615a427b4ba34db470c9bf7a3dde409a5528ba1

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentic_google_flights_tool-0.3.0-py3-none-any.whl:

Publisher: publish.yml on alberto-tamez/agentic-google-flights-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page