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.
| Field | Type | Description |
|---|---|---|
originrequired | string | Where the flight leaves from: an airport's code (JFK), or a city (New York).Limit: at least 2 characters, at most 80 characters. |
destinationrequired | string | Where it goes: an airport's code (LHR), or a city (London).Limit: at least 2 characters, at most 80 characters. |
daterequired | string | The day of the flight, YYYY-MM-DD.Limit: matches ^\d{4}-\d{2}-\d{2}$. |
adults | integer | How 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". |
currency | string | 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. |
airport (in layovers[]) | string or null | The airport of the stop, by its code, e.g. RDU, where the card prints it. |
airport_name (in layovers[]) | string | The airport of the stop, by its name, as the card words it. |
city (in layovers[]) | string or null | The city of that airport, as the card words it. |
duration_minutes (in layovers[]) | integer or null | How long the stop lasts, in minutes. |
overnight (in layovers[]) | 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. |
origin (in legs[]) | string | The airport the leg leaves from, by its code, e.g. JFK. |
destination (in legs[]) | string | The airport it lands at, by its code, e.g. RDU. |
carrier (in legs[]) | string | The airline's two-letter code for the flight number, e.g. AA. |
flight_number (in legs[]) | string | The flight number with the airline's code, e.g. AA 4501. |
date (in legs[]) | 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
# 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-05Install 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:
{
"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.
{
"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.
{
"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.