# Google Flights Scraper (Prices, Airlines, Stops) (`hawtsauce/google-flights-scraper`) Actor

Scrape Google Flights results for any route and date: airline, flight numbers, departure and arrival times, duration, stops, layovers and price. One-way or round trip, cabin class, multiple routes per run. Track flight prices into CSV, Excel or JSON. Pay per result.

- **URL**: https://apify.com/hawtsauce/google-flights-scraper.md
- **Developed by:** [Liam Oliver](https://apify.com/hawtsauce) (community)
- **Categories:** Travel
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 flight options

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Flights Scraper (Prices, Times, Airlines, Stops)

Get the flight options Google Flights shows for any route and date: **price, airlines, flight numbers, departure and arrival times, total duration, number of stops, stop airports and layover times**. One way or round trip, any cabin, 1 to 9 adults, and many routes in one run.

**Cost:** $1.50 per 1,000 flight options, plus $0.00005 per run. One route with 30 options costs about $0.05.

**Ready-made examples:** JFK to LAX prices 30 days out; London to New York round trip, 45 days out.

### Why use it

- **Fare tracking:** run the same routes every day and watch prices move.
- **Travel research and content:** compare airlines, nonstop options and durations on popular routes.
- **Spreadsheets and dashboards:** get clean rows you can sort by price, duration or stops.

### How it works

For each route the Actor opens the public Google Flights page for a plain-English search such as `Flights to LAX from JFK on 2027-01-15 one way` and reads the results Google shows. Google's own reading of the search (route, dates, trip type, cabin, adults) is checked against what you asked for; if Google read it differently, that route is skipped instead of saving mislabelled flights.

### Input

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2027-01-15",
  "returnDate": "2027-01-20",
  "adults": 1,
  "cabin": "economy",
  "currency": "USD",
  "maxResults": 50,
  "searches": [
    { "origin": "EWR", "destination": "MIA", "departureDate": "2027-02-01" },
    { "origin": "LHR", "destination": "JFK", "departureDate": "2027-03-10", "cabin": "business" }
  ]
}
```

| Field | Meaning |
|---|---|
| `origin`, `destination` | 3-letter airport codes, e.g. `JFK`, `LAX`. |
| `departureDate` | `YYYY-MM-DD`, today or later. |
| `returnDate` | Optional. Makes it a round trip. |
| `searches` | Optional list of more routes. Each can set its own `returnDate`, `adults` and `cabin`. |
| `adults` | 1 to 9. Default 1. |
| `cabin` | `economy`, `premium economy`, `business` or `first`. Default economy. |
| `currency` | e.g. `USD`, `EUR`, `GBP`. Default USD. |
| `language`, `country` | e.g. `en`, `us`. Defaults `en` and `us`. |
| `maxResults` | Max flight options per route. Default 100. |

Use either the single route fields, the `searches` list, or both.

### Output

One row per flight option. Real example from a test run (JFK to LAX, one way, 15 January 2027):

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "2027-01-15",
  "returnDate": null,
  "tripType": "one way",
  "cabin": "economy",
  "adults": 1,
  "position": 1,
  "airlines": ["JetBlue"],
  "flightNumbers": ["B6 2223"],
  "departureAirport": "JFK",
  "arrivalAirport": "LAX",
  "departureTime": "2027-01-15T08:01",
  "arrivalTime": "2027-01-15T11:29",
  "durationMinutes": 388,
  "stops": 0,
  "stopAirports": [],
  "layovers": [],
  "price": 179,
  "currency": "USD",
  "priceType": "one way",
  "isBest": true,
  "isCheapest": true,
  "co2EmissionsKg": 437,
  "typicalCo2EmissionsKg": 326,
  "legs": [
    {
      "flightNumber": "B6 2223",
      "airline": "JetBlue",
      "from": "JFK",
      "to": "LAX",
      "departureTime": "2027-01-15T08:01",
      "arrivalTime": "2027-01-15T11:29",
      "durationMinutes": 388,
      "aircraft": "Airbus A320",
      "legroom": "33 in"
    }
  ],
  "searchQuery": "Flights to LAX from JFK on 2027-01-15 one way",
  "url": "https://www.google.com/travel/flights?q=Flights+to+LAX+from+JFK+on+2027-01-15+one+way&curr=USD&hl=en&gl=us",
  "scrapedAt": "2026-11-29T07:05:54.407Z"
}
```

Notes on the fields:

- **Times** are local to each airport, as Google shows them (`YYYY-MM-DDTHH:MM`, no time zone).
- **`isBest`** means Google listed the flight in its top ("best") section. **`isCheapest`** means it has the lowest price among the flights returned for that search.
- **`layovers`** give the connecting airport and the wait in minutes, worked out from the leg times.
- **Round trips:** Google lists the outbound flights with the **total round trip price** (`priceType: "round trip total"`). Return flight details are not included.
- Anything Google did not show is `null` or an empty list. Nothing is guessed.

Download as JSON, CSV, Excel or use the API.

### Pricing

Pay per result: you pay once for each flight option saved. Routes with no flights cost nothing. See the Pricing tab. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### Limits

- **Prices are what Google showed at run time and may differ at booking.** Fares change often, and taxes, bags and seat fees may not be included.
- One page per route, so you get the options Google shows on its first results page (often 10 to 30), not every possible itinerary.
- Use 3-letter airport codes. City codes such as NYC may work but are not tested; place names are not supported.
- Return flight details for round trips are not available.
- The Actor runs at a polite pace (2 seconds between routes by default). If Google shows a captcha, a cookie consent page or refuses the request, the run stops and tells you rather than trying to get around it.

### Data and privacy

Public data only. No login, no booking, no personal data.

# Actor input Schema

## `origin` (type: `string`):

3-letter IATA airport code, e.g. JFK. Leave empty if you only use the routes list below.

## `destination` (type: `string`):

3-letter IATA airport code, e.g. LAX.

## `departureDate` (type: `string`):

YYYY-MM-DD, or days from today such as "+30" (handy for scheduled runs). Today or later.

## `returnDate` (type: `string`):

YYYY-MM-DD or "+37" style days from today. Set it for a round trip. Leave empty for one way.

## `searches` (type: `array`):

Several routes in one run. Each item: {"origin": "JFK", "destination": "LAX", "departureDate": "2027-01-15", "returnDate": "2027-01-20"}. Items may also set adults and cabin.

## `adults` (type: `integer`):

Number of adult passengers, 1 to 9.

## `cabin` (type: `string`):

Cabin class.

## `currency` (type: `string`):

3-letter currency code, e.g. USD, EUR, GBP.

## `language` (type: `string`):

Language code, e.g. en, de, es.

## `country` (type: `string`):

Two-letter country code Google uses for the search, e.g. us, gb, de.

## `maxResults` (type: `integer`):

Stop after this many flight options for each route. You are charged per flight option returned.

## `requestDelayMs` (type: `integer`):

Pause between routes. Minimum 1000.

## `maxRetries` (type: `integer`):

Retries with backoff on HTTP 429 or 5xx. A captcha, consent page or 403 always stops the run.

## `proxyConfiguration` (type: `object`):

Optional.

## Actor input object example

```json
{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "+30",
  "searches": [],
  "adults": 1,
  "cabin": "economy",
  "currency": "USD",
  "language": "en",
  "country": "us",
  "maxResults": 20,
  "requestDelayMs": 2000,
  "maxRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All flight options found, one row per flight.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "origin": "JFK",
    "destination": "LAX",
    "departureDate": "+30",
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("hawtsauce/google-flights-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "origin": "JFK",
    "destination": "LAX",
    "departureDate": "+30",
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("hawtsauce/google-flights-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "origin": "JFK",
  "destination": "LAX",
  "departureDate": "+30",
  "maxResults": 20
}' |
apify call hawtsauce/google-flights-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hawtsauce/google-flights-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FLvQocYQ00OWJ9asR/builds/8hAKrd4j2cGPhq3Vc/openapi.json
