# Apify Google Flights API

> Use Google Flights as an API with the Apify Google Flights Actor (johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search). There is no official google flights api, so this skill fills the gap. Give departure and arrival airport codes plus dates, and get structured flight results as JSON, one row per flight with price, currency, airlines, departure and arrival times, stops, layover airports, duration, travel class, and flight numbers, plus price insights for the route. Supports one-way, round-trip, and multi-city itineraries, 29 languages, 39 countries, and filters for price, stops, and airlines. Use when the user wants a google flights api, to scrape google flights, a google flights scraper, flight results as JSON or CSV, or airfare data for a route by API or Python. Pay-per-page billing, MCP-ready for Claude and other AI agents.

- Skill: `johnisanerd/apify-google-flights-api` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add johnisanerd/apify-google-flights-api`
- Raw SKILL.md: https://api.skillmd.com/api/skills/johnisanerd/apify-google-flights-api/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- License: MIT
- Author: johnisanerd (https://skillmd.com/u/johnisanerd)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/johnisanerd/apify-google-flights-api

---


# Google Flights API: Structured Flight Search Results

Use Google Flights as an API. There is no official Google Flights API, so developers scrape it; this Actor does that as a hosted service. Route and dates in, structured JSON out: one row per flight with price, airlines, times, stops, and duration, plus route-level price insights.

## When to use this skill

- The user wants a "Google Flights API" (none exists officially; the predecessor QPX Express shut down in 2018).
- They want to scrape Google Flights results for a route into JSON or CSV.
- They want airfare data by API or from Python for a travel app, dataset, or analysis.
- They ask for a "Google Flights scraper" or "how to scrape Google Flights".

Not for: live aircraft tracking or flight status (this is a fare and search scraper, not a radar), creating reservations (it returns booking links, not tickets), or hotel searches (use the Google Hotels Actor).

## What you get (one dataset item per page, flights nested in `all_flights`)

Each dataset item is one page of results holding an `all_flights` array (about 30 flights per page). Per flight: `price`, `currency`, `route`, `airlines`, `airline_logo`, `departure_airport`, `departure_time`, `arrival_airport`, `arrival_time`, `stops`, `stops_label`, `layover_airports`, `duration`, `duration_minutes`, `travel_class`, `flight_numbers`, `overnight`, `often_delayed`, `carbon_emissions_g`, `booking_token`, `category`. The item also carries `best_flights` and `other_flights` groupings, `airports` info, `search_metadata`, and `price_insights` (`lowest_price`, `price_level`, `typical_price_range`, plus a `price_history` series when Google shows one). With `fetch_booking_options` true (one-way only, billed per option), `booking_options` adds direct booking links and baggage prices.

## Prerequisites

- Apify account (sign up at https://apify.com?fpr=9n7kx3&fp_sid=skillrepo).
- Authentication via `apify login`, or an `APIFY_TOKEN` environment variable (Apify Console, Settings, Integrations).

## The Actor

- Store page: https://apify.com/johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search?fpr=9n7kx3&fp_sid=skillrepo
- Actor ID: `johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search`
- Pricing: a small per-run setup fee plus a per-page fee (see `references/gotchas.md`).

## Run it with the Apify CLI

One-way search:

```bash
apify actors call "johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search" -i '{"departure_id":"LAX","arrival_id":"JFK","outbound_date":"2026-08-14","max_pages":1}' \
  --json \
  --user-agent apify-awesome-skills/apify-google-flights-api \
  2>/dev/null
```

Round trip, nonstop only, under a price cap:

```bash
apify actors call "johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search" -i '{"departure_id":"SFO","arrival_id":"CDG","outbound_date":"2026-09-10","return_date":"2026-09-20","max_stops":0,"max_price":900,"currency":"USD"}' \
  --json \
  --user-agent apify-awesome-skills/apify-google-flights-api \
  2>/dev/null
```

Every call carries the three flags this repo expects: `--json`, `--user-agent apify-awesome-skills/apify-google-flights-api`, and `2>/dev/null`.

## Run it from Claude or another AI agent (MCP)

The Actor is MCP-ready. Add the hosted server URL:

`https://mcp.apify.com/?tools=actors,docs,johnvc/Google-Flights-Data-Scraper-Flight-and-Price-Search`

Then ask, for example: "Find nonstop flights from LAX to JFK on August 14 under $400 and list them by price." MCP setup docs: https://docs.apify.com/platform/integrations/mcp

## Workflow

1. Build the route. `departure_id` and `arrival_id` take IATA codes, comma-separated for multi-airport searches (for example "CDG,ORY"). Add `outbound_date` (YYYY-MM-DD); add `return_date` for a round trip, or pass `multi_city_json` instead for complex itineraries.
2. Set passengers and market. `adults`, `children`, `infants`; `currency`, `hl` (29 languages), `gl` (39 countries) for localized fares.
3. Filter. `max_price`, `max_stops` (0 = nonstop), `airlines` (comma-separated codes), `exclude_basic`.
4. Bound the volume. `max_pages` (default 1) is the cost driver; leave `fetch_booking_options` off unless the user needs direct booking links (it bills per option, one-way only).
5. Estimate cost, then confirm with the user if the run is large. See `references/gotchas.md`.
6. Run the Actor and read the dataset. Read each page item's `all_flights` array, then sort or filter by `price`, `stops`, or `duration_minutes`; flatten to rows for CSV.

## Inputs

- `departure_id` / `arrival_id` (IATA codes, comma-separated allowed) and `outbound_date`; `return_date` optional
- `multi_city_json` (array of route legs) for multi-city trips
- `adults` (default 1), `children`, `infants`
- `currency` (default USD), `hl` (enum, 29), `gl` (enum, 39)
- `max_price`, `max_stops`, `airlines`, `exclude_basic` (filters)
- `fetch_booking_options` (boolean, extra billing, one-way only), `max_pages` (default 1)

## Cost

Billing is a small setup fee per run plus a per-page fee; a default one-page search costs a few cents. Booking options bill separately per option returned. Live prices and thresholds are in `references/gotchas.md`.

## Honest limits

- Fares are search results at crawl time; airlines reprice constantly, so treat prices as current quotes, not guarantees.
- `price_insights` gives the current price level, a typical range, and, when Google shows one, a recent `price_history` series for the route. It is not a fare forecast.
- No reservations: `booking_options` returns direct links to airlines and travel sites; ticketing happens there.
- Not a flight tracker: no live aircraft position, delay feed, or gate information.

## Troubleshooting

- Empty results: check the IATA codes and date format (YYYY-MM-DD); very thin routes can legitimately return few flights.
- Prices look off for the market: set `currency`, `gl`, and `hl` together.
- Booking options missing: `fetch_booking_options` must be true, and it applies to one-way searches only.

See `references/gotchas.md` for cost guardrails and error recovery, and `references/actor-index.md` for the Actor routing table.

## Related travel Actors

- Google Hotels Search Scraper: https://apify.com/johnvc/google-hotels-search-scraper?fpr=9n7kx3&fp_sid=skillrepo
- Google Travel Explore API: https://apify.com/johnvc/google-travel-explore-api?fpr=9n7kx3&fp_sid=skillrepo
- Google Maps Directions API: https://apify.com/johnvc/google-maps-directions-api?fpr=9n7kx3&fp_sid=skillrepo

