> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Flights

> Read a Google Flights search page as JSON with the google-flights parser. $1 per 1,000 calls. Send the page to scrape. Examples in cURL, TypeScript and Python.

Reads a Google Flights search page, from the address bar or with a q of IATA airport codes and a date, like Flights to JFK from LHR on 2026-12-15, and returns its data as JSON.

## Make a request

Send the page's URL to [scrape](https://docs.stophy.dev/api-reference/endpoint/scrape.md) with a `json` format that names the parser. Get an API key in the [Quickstart](https://docs.stophy.dev/quickstart).

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.google.com/travel/flights?q=Flights%20to%20JFK%20from%20LHR%20on%202026-12-15","formats":[{"type":"json","parser":"google-flights"}]}'
```

```typescript TypeScript theme={null}
const response = await fetch("https://api.stophy.dev/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.STOPHY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://www.google.com/travel/flights?q=Flights%20to%20JFK%20from%20LHR%20on%202026-12-15",
    formats: [{ type: "json", parser: "google-flights" }],
  }),
});
console.log(await response.json());
```

```python Python theme={null}
import os

import requests

response = requests.post(
    "https://api.stophy.dev/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['STOPHY_API_KEY']}"},
    json={
        "url": "https://www.google.com/travel/flights?q=Flights%20to%20JFK%20from%20LHR%20on%202026-12-15",
        "formats": [{"type": "json", "parser": "google-flights"}],
    },
)
print(response.json())
```

## Read the response

The parser's data is in `data.json`. Its fields include `isBest`, `price`, `priceCurrency`, `airlines`, `stops` and `durationSeconds`. This sample is cut to the first items.

```json theme={null}
{
  "success": true,
  "data": {
    "json": {
      "cabin": "economy",
      "tripType": "oneWay",
      "adults": 1,
      "url": "https://www.google.com/travel/flights/search?tfs=GhoSCjIwMjYtMTItMTVqBRIDTEhScgUSA0pGS0ABSAGYAQI%3D&tfu=EgQIABABIgA&hl=…",
      "results": [
        {
          "isBest": true,
          "price": 406,
          "priceCurrency": "USD",
          "airlines": [
            "SWISS"
          ],
          "stops": 1,
          "durationSeconds": 44100,
          "departureLocalTime": "2026-12-15T06:00",
          "arrivalLocalTime": "2026-12-15T13:15",
          "legs": [
            {
              "flightNumber": "LX 345",
              "airline": "SWISS",
              "originCode": "LHR",
              "originName": "Heathrow Airport",
              "destinationCode": "ZRH",
              "destinationName": "Zurich Airport",
              "departureLocalTime": "2026-12-15T06:00",
              "arrivalLocalTime": "2026-12-15T08:40",
              "durationSeconds": 6000,
              "aircraft": "Airbus A320neo",
              "legroom": "29 inches"
            }
          ],
          "layovers": [
            {
              "airport": "ZRH",
              "name": "Zurich Airport",
              "city": "Zürich",
              "durationSeconds": 4500
            }
          ],
          "emissionsGrams": 381000,
          "typicalEmissionsGrams": 346000
        }
      ]
    }
  }
}
```

## Options

Send options in the `options` object of the `json` format.

| Option | What it does |
| - | - |
| `currency` | ISO 4217 currency code, e.g. USD. |
| `stops` | Google Flights' Stops filter. |
| `airlines` | Google Flights' Airlines filter, as airline codes like KQ or EK. |
| `carryOnBags` | Google Flights' Bags filter: prices include this many carry-on bags. |
| `checkedBags` | Google Flights' Bags filter: prices include this many checked bags. |
| `maxPrice` | Google Flights' Price filter, in currency for all adults. |
| `departureTime` | Google Flights' Times filter for the outbound departure. |
| `arrivalTime` | Google Flights' Times filter for the outbound arrival. |
| `maxDurationHours` | Google Flights' Duration filter. |

It also takes `returnDate`, `adults` and `cabin`.

## Price

\$1 per 1,000 calls. See [Pricing](https://docs.stophy.dev/account/pricing.md).

## Limits and errors

* The URL must be a Google Flights search page, from the address bar or with a q of IATA airport codes and a date, like Flights to JFK from LHR on 2026-12-15. Any other URL fails with `invalidRequest`.
* The answer comes back in `data.json`. If the page cannot be read, the call fails with an error code from [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Related

* [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers) lists every parser.
* [Scrape](https://docs.stophy.dev/scrape/overview) has the options every scrape takes.
* [Google Patents](https://docs.stophy.dev/scrape/prebuilt-parsers/web/google-patents.md)
* [Google Trends](https://docs.stophy.dev/scrape/prebuilt-parsers/web/google-trends.md)
* [Google Maps](https://docs.stophy.dev/scrape/prebuilt-parsers/places-and-travel/google-maps.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.