Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APIGoogle Flights

    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.

    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; what a run costs is in Usage and units.

    Inputs

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

    Inputs of google.flights
    FieldTypeDescription
    originrequiredstringWhere the flight leaves from: an airport's code (JFK), or a city (New York).Limit: at least 2 characters, at most 80 characters.
    destinationrequiredstringWhere it goes: an airport's code (LHR), or a city (London).Limit: at least 2 characters, at most 80 characters.
    daterequiredstringThe day of the flight, YYYY-MM-DD.Limit: matches ^\d{4}-\d{2}-\d{2}$.
    adultsintegerHow many adults travel; the prices are for all of them.Limit: 1 to 9. Default: 1.
    cabin"economy" | "business" | "first"The cabin: economy, business or first.Default: "economy".
    currencystringThe 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.

    Record fields of google.flights
    FieldTypeNotes
    positionintegerThe 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".
    pricenumber or nullThe lowest price the card shows, for all the passengers asked for, in currency. Null when the card shows none.
    currencystringThe currency of the price, as asked, e.g. USD.
    price_textstring or nullThe price as the card prints it, e.g. $349.
    airlinesarray of stringThe airlines the card names for the flight, in its order, e.g. American.
    operated_bystring or nullWho flies it when another airline does, as the card words it, e.g. Republic Airways as American Eagle.
    stopsintegerThe number of stops: 0 for a nonstop flight.Limit: at least 0.
    originstring or nullThe airport it leaves from, by its code, e.g. JFK.
    origin_namestringThe airport it leaves from, by its name, e.g. John F. Kennedy International Airport.
    destinationstring or nullThe airport it lands at, by its code, e.g. LHR.
    destination_namestringThe airport it lands at, by its name, e.g. Heathrow Airport.
    departure_datestringThe day it leaves, YYYY-MM-DD, in the airport's own time.
    departure_timestringThe time it leaves, as the card prints it in the airport's own time, e.g. 5:29 PM.
    arrival_datestringThe day it lands, YYYY-MM-DD, in the airport's own time.
    arrival_timestringThe time it lands, as the card prints it in the airport's own time, e.g. 9:20 AM.
    duration_minutesinteger or nullThe whole journey's length, in minutes, stops included.
    layoversarray of objectEach stop, in order: where, and for how long.
    airport (in layovers[])string or nullThe airport of the stop, by its code, e.g. RDU, where the card prints it.
    airport_name (in layovers[])stringThe airport of the stop, by its name, as the card words it.
    city (in layovers[])string or nullThe city of that airport, as the card words it.
    duration_minutes (in layovers[])integer or nullHow long the stop lasts, in minutes.
    overnight (in layovers[])booleanTrue when Google Flights calls the stop an overnight one.Default: false.
    legsarray of objectEach flight of the journey with its number, where the card's emissions link names them.
    origin (in legs[])stringThe airport the leg leaves from, by its code, e.g. JFK.
    destination (in legs[])stringThe airport it lands at, by its code, e.g. RDU.
    carrier (in legs[])stringThe airline's two-letter code for the flight number, e.g. AA.
    flight_number (in legs[])stringThe flight number with the airline's code, e.g. AA 4501.
    date (in legs[])stringThe day the leg leaves, YYYY-MM-DD.
    co2_gramsinteger or nullThe flight's estimated emissions for the passengers asked for, in grams of CO2e, as the card states them.
    co2_typical_gramsinteger or nullThe typical emissions of a flight between the same two airports, in grams of CO2e, to compare with co2_grams.
    notesarray of stringWhat 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_atstring (date-time)When the list was read, in UTC.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    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"}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("google.flights", {
        "origin": "BOM",
        "destination": "DXB",
        "date": "2026-12-05",
    })
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("google.flights", {
      origin: "BOM",
      destination: "DXB",
      date: "2026-12-05",
    });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "google.flights", map[string]any{"origin": "BOM", "destination": "DXB", "date": "2026-12-05"})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("google.flights", Map.of("origin", "BOM", "destination", "DXB", "date", "2026-12-05"));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run google.flights --input origin=BOM --input destination=DXB --input date=2026-12-05

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "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 lists every status and the reasons every scraper shares; the reasons of the Google Flights scrapers are in their own section there.