Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

npm warn exec The following package was not found and will be installed: prettier@3.9.6 npm notice run npx npm notice run 'prettier' --stdin-filepath README.md

Google Flights Search Skill

Search, compare, and inspect Google Flights using a reusable agent skill backed by Python and Playwright, with interactive browser control as a fallback when Google changes its interface or blocks automation.

Install

Install globally and select the target agent when prompted:

npx skills add rodionlim/google-flights-skill \
  --skill google-flights-search \
  --global

For a non-interactive installation:

npx skills add rodionlim/google-flights-skill \
  --skill google-flights-search \
  --global \
  --yes

The skill will be available on the next agent turn. Without --yes, the installer prompts you to select from detected agents. To install into the current project instead, omit --global.

Upgrade

Upgrade a globally installed copy to the latest version:

npx skills update google-flights-search --global

Skip the confirmation prompt when running non-interactively:

npx skills update google-flights-search --global --yes

If the skill was installed only in the current project, use:

npx skills update google-flights-search --project

Start a new agent turn after upgrading so it loads the updated skill instructions. Use npx skills list to inspect installed skills and their scope.

Global updates refresh the tracked skill for every agent currently detected by the CLI, including OpenClaw when it is installed. To install or restore the skill for OpenClaw explicitly, run:

npx skills add rodionlim/google-flights-skill \
  --skill google-flights-search \
  --agent openclaw \
  --global \
  --yes

Runtime dependency

The included search runner uses Python 3 and Playwright in an isolated environment. Run the idempotent bootstrap once after installation or dependency updates:

cd /path/to/google-flights-search
scripts/bootstrap_runtime.sh

By default the environment is stored under $XDG_CACHE_HOME when set, otherwise at ~/.cache/google-flights-search/venv, outside the installed skill directory. Override it with GOOGLE_FLIGHTS_VENV=/durable/path/to/venv when needed. The bootstrap reuses an existing valid environment, installs the Playwright version pinned in requirements.txt, installs Chromium, and verifies that Chromium launches. It does not install into externally managed system Python.

Scheduled jobs must call scripts/run_google_flights.sh and must not run bootstrap, uv venv, package installation, browser installation, or use a /tmp venv. The runner performs a read-only preflight and distinguishes a missing Python package, missing Chromium binary, browser runtime failure, and a later Google Flights error.

For an OpenClaw cron prompt, use this execution contract:

Resolve the installed google-flights-search skill directory dynamically and run its scripts/run_google_flights.sh with the requested arguments. Do not create or modify a virtual environment, install Python packages or browsers, use system Python, or use a /tmp environment during this job. If runtime preflight fails, report its category and stop; do not attempt an ad-hoc recovery installation.

OpenClaw skill instructions may use its {baseDir} placeholder. Do not hardcode a path such as /home/ubuntu/.agents/skills/google-flights-search in a reusable cron prompt.

What it does

The skill turns natural-language travel requests into auditable Google Flights searches. It supports:

  • exact dates and flexible date windows
  • adults, children by age, infants in seats, and lap infants
  • up to seven origin and destination airports
  • economy, premium economy, business, and first class
  • preferred, allowed, and excluded airlines
  • budget-carrier preferences and visible fare-product verification
  • any stops, nonstop, one stop or fewer, or two stops or fewer
  • Google-ranked departing or returning flights
  • mixed-airline round trips and codeshares
  • aircraft, cabin, average legroom, amenities, emissions, and overnight offsets
  • date grids, price graphs, fare history, and Google's price guidance
  • baggage, duration, layover, airport-change, and self-transfer checks
  • price tracking, only after the user explicitly confirms the account-changing action

It starts with the bundled Playwright runner. If that pass is incomplete, it guides the agent through an interactive browser or desktop-control fallback. It never bypasses CAPTCHAs and treats Google Flights as a live comparison source rather than a booking authority.

Troubleshooting

Standalone Playwright can occasionally receive Google's generic “Oops, something went wrong” state while the same search works in an established interactive Chrome session. See Playwright and Google Flights ErrorResponse for the captured network evidence, tests performed, session/cookie hypothesis, current fallback behavior, and trace reproduction steps.

Example prompts

Flexible family trip

Find flights from Singapore to Taipei between 25 November and 2 December 2026. The dates are flexible by two days. Optimize for cost for two adults, a four-year-old, and a one-year-old traveling on an adult's lap. Avoid budget carriers, but compare STARLUX, China Airlines, Singapore Airlines, and ScootPlus.

The skill normalizes the travelers into Google's separate adult, child, and infant-on-lap controls, searches the date combinations, and flags anything it cannot verify—especially baggage or a fare product such as ScootPlus.

Top returning flights

Select Google's top departing flight and return up to five top returning flights. Include the times, stops, aircraft, cabin, average legroom, amenities, and the airline used on each leg.

Returning results are always tied to the selected outbound. The skill preserves Google's displayed ranking and keeps mixed carriers leg-specific instead of flattening them into one airline label.

In a live example search on 29 July 2026 for SIN–TPE, 25 November–2 December 2026, the selected outbound was China Airlines from 2:00 AM to 6:40 AM. The first two returns were both SGD 1,315 total round trip for four passengers:

Rank Return flight Schedule Stops Aircraft Legroom
1 China Airlines CI753 8:20 AM–1:05 PM Nonstop Airbus A350 32 in
2 China Airlines CI755 7:55 PM–12:40 AM +1 Nonstop Airbus A330 32 in

Those fares were observations from that run, not quotes or guarantees. Prices, availability, ranking, aircraft, and flight schedules can change.

Stops filter

Find the five cheapest compliant options, allowing one stop or fewer.

Supported stop values are:

any
nonstop
one-or-fewer
two-or-fewer

The limit is applied to both outbound and return legs unless the user explicitly requests different limits.

Run the Python helper directly

From the skill directory:

scripts/run_google_flights.sh \
  --origin SIN \
  --destination TPE \
  --depart 2026-11-25 \
  --return 2026-12-02 \
  --flex-days 2 \
  --adults 2 \
  --child-age 4 \
  --infants-on-lap 1 \
  --airline STARLUX \
  --airline "China Airlines" \
  --airline "Singapore Airlines" \
  --exclude-budget \
  --currency SGD \
  --stops any \
  --output results.json

To select Google's first departing result and inspect five returning results:

scripts/run_google_flights.sh \
  --origin SIN \
  --destination TPE \
  --depart 2026-11-25 \
  --return 2026-12-02 \
  --adults 2 \
  --child-age 4 \
  --infants-on-lap 1 \
  --currency SGD \
  --result-stage returning \
  --select-departing-index 1 \
  --top-results 5 \
  --sort-by google \
  --include-details

Use scripts/run_google_flights.sh --help for the full option list. Use --dry-run to inspect the normalized request and generated Google Flights URLs without opening a browser.

Output and safeguards

The runner emits JSON containing the normalized search, attempted date combinations, source URLs, extracted flight cards, confidence level, warnings, and any selected departing-flight context.

Google frequently changes its markup, so extraction can be incomplete. Always verify the final passenger mix, fare family, baggage allowance, operating carrier, and total price with the airline or booking provider before payment. This project does not book flights or enter payment details.

About

A skill that fetches flight prices from Google Flights

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages