# google.flights

The flights Google Flights lists for a one-way trip on a day: price, airlines, times, duration, stops and layovers, flight numbers and estimated emissions.

Google Flights, one of the Google Flights scrapers.

| | |
| --- | --- |
| Id | `google.flights` |
| Version | 1 |
| Billed per | request — 1 unit for a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/google.flights/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `origin` | string | yes | Where the flight leaves from: an airport's code (`JFK`), or a city (`New York`). Limit: at least 2 characters, at most 80 characters. |
| `destination` | string | yes | Where it goes: an airport's code (`LHR`), or a city (`London`). Limit: at least 2 characters, at most 80 characters. |
| `date` | string | yes | The day of the flight, `YYYY-MM-DD`. Limit: matches ^\d{4}-\d{2}-\d{2}$. |
| `adults` | integer | no | How many adults travel; the prices are for all of them. Limit: 1 to 9. Default: `1`. |
| `cabin` | "economy" \| "business" \| "first" | no | The cabin: `economy`, `business` or `first`. Default: `"economy"`. |
| `currency` | string | no | The currency of the prices, as a three-letter code, e.g. `USD`, `EUR`, `INR`. Limit: matches ^[A-Za-z]{3}$. Default: `"USD"`. |

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `position` | integer | The flight's place in the list, from 1: the top flights first, then the others. Limit: at least 1. |
| `section` | "top" \| "other" | `top` for a flight of the list's "Top flights", `other` for one of its "Other flights". |
| `price` | number or null | The lowest price the card shows, for all the passengers asked for, in `currency`. Null when the card shows none. |
| `currency` | string | The currency of the price, as asked, e.g. `USD`. |
| `price_text` | string or null | The price as the card prints it, e.g. `$349`. |
| `airlines` | array of string | The airlines the card names for the flight, in its order, e.g. `American`. |
| `operated_by` | string or null | Who flies it when another airline does, as the card words it, e.g. `Republic Airways as American Eagle`. |
| `stops` | integer | The number of stops: 0 for a nonstop flight. Limit: at least 0. |
| `origin` | string or null | The airport it leaves from, by its code, e.g. `JFK`. |
| `origin_name` | string | The airport it leaves from, by its name, e.g. `John F. Kennedy International Airport`. |
| `destination` | string or null | The airport it lands at, by its code, e.g. `LHR`. |
| `destination_name` | string | The airport it lands at, by its name, e.g. `Heathrow Airport`. |
| `departure_date` | string | The day it leaves, `YYYY-MM-DD`, in the airport's own time. |
| `departure_time` | string | The time it leaves, as the card prints it in the airport's own time, e.g. `5:29 PM`. |
| `arrival_date` | string | The day it lands, `YYYY-MM-DD`, in the airport's own time. |
| `arrival_time` | string | The time it lands, as the card prints it in the airport's own time, e.g. `9:20 AM`. |
| `duration_minutes` | integer or null | The whole journey's length, in minutes, stops included. |
| `layovers` | array of object | Each stop, in order: where, and for how long. |
| `layovers[].airport` | string or null | The airport of the stop, by its code, e.g. `RDU`, where the card prints it. |
| `layovers[].airport_name` | string | The airport of the stop, by its name, as the card words it. |
| `layovers[].city` | string or null | The city of that airport, as the card words it. |
| `layovers[].duration_minutes` | integer or null | How long the stop lasts, in minutes. |
| `layovers[].overnight` | boolean | True when Google Flights calls the stop an overnight one. Default: `false`. |
| `legs` | array of object | Each flight of the journey with its number, where the card's emissions link names them. |
| `legs[].origin` | string | The airport the leg leaves from, by its code, e.g. `JFK`. |
| `legs[].destination` | string | The airport it lands at, by its code, e.g. `RDU`. |
| `legs[].carrier` | string | The airline's two-letter code for the flight number, e.g. `AA`. |
| `legs[].flight_number` | string | The flight number with the airline's code, e.g. `AA 4501`. |
| `legs[].date` | string | The day the leg leaves, `YYYY-MM-DD`. |
| `co2_grams` | integer or null | The flight's estimated emissions for the passengers asked for, in grams of CO2e, as the card states them. |
| `co2_typical_grams` | integer or null | The typical emissions of a flight between the same two airports, in grams of CO2e, to compare with `co2_grams`. |
| `notes` | array of string | What else the card says of the fare, e.g. `1 carry-on bag included`, `This price does not include overhead bin access`, `First Class`. |
| `fetched_at` | string (date-time) | When the list was read, in UTC. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/google.flights/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"origin":"BOM","destination":"DXB","date":"2026-12-05"}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "google.flights",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "origin": "BOM",
    "destination": "DXB",
    "date": "2026-12-05"
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": 1,
  "units_per_record": null,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "position": 1,
      "section": "top",
      "price": 198,
      "currency": "USD",
      "price_text": "$198",
      "airlines": [
        "flydubai"
      ],
      "operated_by": null,
      "stops": 0,
      "origin": "BOM",
      "origin_name": "Chhatrapati Shivaji Maharaj International Airport Mumbai",
      "destination": "DXB",
      "destination_name": "Dubai International Airport",
      "departure_date": "2026-12-05",
      "departure_time": "5:15 AM",
      "arrival_date": "2026-12-05",
      "arrival_time": "7:15 AM",
      "duration_minutes": 210,
      "layovers": [],
      "legs": [
        {
          "origin": "BOM",
          "destination": "DXB",
          "carrier": "FZ",
          "flight_number": "FZ 446",
          "date": "2026-12-05"
        }
      ],
      "co2_grams": 170000,
      "co2_typical_grams": 151000,
      "notes": [],
      "fetched_at": "2026-11-19T17:28:12.192424Z"
    }
  ],
  "next_cursor": null
}
```

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the Google Flights scrapers](https://docs.enrichednow.com/results-and-statuses.md#google-flights) are in their own section there.
