omp packages

find-flight0.3.1

Google Flights search for AI agents — a pi extension (search_flights tool) + portable skill, powered by the fast-flights scraper.

fcan-dev Published 3 days ago MIT ~369 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

find-flight

Real Google Flights prices and availability for AI agents — a pi extension (search_flights tool) plus a portable skill for pi, Claude Code and Codex. Read-only: it searches, it never books.

Powered by the fast-flights scraper. Requires Python 3.10+, pip install fast-flights, and network access.

Install

pip install fast-flights
pi install npm:find-flight

Reload pi (/reload) and the agent gains the search_flights tool.

From source, or for one run only:

pi install git:github.com/fcan-dev/find-flight
pi -e npm:find-flight          # current run, no install

Other harnesses — link the skill where it is read:

ln -s "$(pwd)/skills/find-flight" ~/.pi/agent/skills/find-flight      # pi
ln -s "$(pwd)/skills/find-flight" ~/.agents/skills/find-flight        # Codex
ln -s "$(pwd)/skills/find-flight" ~/.claude/skills/find-flight        # Claude Code
ln -s "$(pwd)/extensions/flight-search.ts" ~/.pi/agent/extensions/flight-search.ts

Use it

Ask in natural language:

"Cheapest one-way from Istanbul to Ercan on 12 December, economy, in euros"

"Round-trip Istanbul to Paris, out 23 Oct, return 25 Oct"

The agent calls search_flights and gets compact JSON back — at most 10 itineraries per section, cheapest first, with total_* counts. Every airport code is resolved to its name, city and ISO-3166 country before searching, so an unknown code fails loudly instead of querying the wrong city.

{
  "trip": "one-way",
  "currency": "EUR",
  "route": { "from": { "code": "IST", "city": "Istanbul", "country_name": "Türkiye" },
             "to":   { "code": "ECN", "city": "Nicosia", "country_name": "Cyprus" },
             "summary": "IST Istanbul, Türkiye -> ECN Nicosia, Cyprus" },
  "flights": [
    { "price": 71, "currency": "EUR", "price_type": "one-way",
      "airlines": ["Turkish Airlines"], "stops": 0,
      "legs": [{ "from": "IST", "to": "ECN", "date": "2026-12-12",
                 "departure": "01:50", "arrival": "02:30",
                 "duration_minutes": 100, "plane": "Airbus A320" }] }
  ],
  "total_flights": 5
}

Trimmed for readability; one real search, IST → ECN, 2026-12-12.

Without pi

flight_runner.py reads a JSON query on stdin and writes structured JSON on stdout:

echo '{"from_airport":"IST","to_airport":"ECN","outbound_date":"2026-12-12","trip":"one-way","currency":"EUR"}' \
  | python3 flight_runner.py

A small CLI prints the same results as text:

python examples/search_flights.py --from IST --to ECN --date 2026-12-12 --currency EUR --sort price --limit 3
EUR 71  Turkish Airlines  (TK)
  IST Istanbul, TR 2026-12-12 01:50 -> ECN Nicosia, CY 2026-12-12 02:30 (100 min, Airbus A320)
EUR 82  Turkish Airlines  (TK)
  IST Istanbul, TR 2026-12-12 07:40 -> ECN Nicosia, CY 2026-12-12 08:20 (100 min, Boeing 737)

Reference

Parameter Description
from_airport, to_airport 3-letter IATA codes (required)
outbound_date YYYY-MM-DD (required; must be a real date)
trip one-way (default) or round-trip
return_date YYYY-MM-DD; required for round-trip, not before outbound_date
seat economy (default), premium-economy, business, first
currency ISO code, e.g. EUR; defaults to USD
language IETF tag, e.g. en-US
adults, children passenger counts (default 1, 0)
airlines restrict to 2-letter IATA carriers, e.g. ["TK"]
max_stops 0 = nonstop only (filtered client-side on Google's top results)
max_price, exclude_basic_economy price ceiling; hide basic economy

The runner also accepts infants_in_seat, infants_on_lap, carry_on_bags, checked_bags and hide_separate_and_self_transfer.

One-way returns {trip, currency, route, flights[], total_flights}. Round-trip returns {trip, currency, outbound_route, return_route, round_trip[], return_options[], total_round_trip, total_return_options, note}.

city is the place the airport serves, not the airport's own ward or village: the bundled table is generated by scripts/build_airports.py from Wikidata P931 (place served) with OurAirports municipalities as a fallback.

Each itinerary carries price, currency, price_type, airlines, stops and legs[]; each leg carries from, to, from_city, to_city, from_country, to_country, date, departure, arrival, duration_minutes, plane.

Round-trip pricing: round_trip[].price is the true two-way total from a native round-trip query, and its legs cover the outbound direction only. return_options[] are one-way reference fares for the return direction, returned so return-leg schedules are visible — never add them to a round-trip price.

Limitations

  • Scraping Google is subject to rate limits and IP blocks; heavy use needs a proxy wired into fast-flights.
  • multi-city trips are not supported upstream.
  • Prices are labelled with the requested currency; with no currency, FLIGHT_CURRENCY (default USD) applies, and FLIGHT_CURRENCY="" follows Google's own default, labelled google-default.
  • Point the extension at another runner with FLIGHT_RUNNER=/path/to/flight_runner.py, or another interpreter with FLIGHT_PYTHON=....

Security and license

Installing this package means running Python (flight_runner.py) that makes live requests to Google — read the source before you install it. MIT licensed.