Skip to main content
GET
/
v1
/
google
/
flights
/
search
Google Flights search
curl --request GET \
  --url https://scrapebadger.com/v1/google/flights/search \
  --header 'x-api-key: <api-key>'
import requests

url = "https://scrapebadger.com/v1/google/flights/search"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://scrapebadger.com/v1/google/flights/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/google/flights/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://scrapebadger.com/v1/google/flights/search"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/google/flights/search")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://scrapebadger.com/v1/google/flights/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "departure_id": "<string>",
  "arrival_id": "<string>",
  "outbound_date": "<string>",
  "best_flights": [
    {
      "legs": [
        {
          "departure_airport": "<string>",
          "departure_airport_name": "<string>",
          "departure_time": "<string>",
          "arrival_airport": "<string>",
          "arrival_airport_name": "<string>",
          "arrival_time": "<string>",
          "duration_minutes": 123,
          "airline": "<string>",
          "airline_logo": "<string>",
          "flight_number": "<string>",
          "aircraft": "<string>",
          "travel_class": "<string>",
          "legroom": "<string>",
          "extensions": [
            "<string>"
          ]
        }
      ],
      "layovers": [
        {
          "duration_minutes": 123,
          "airport": "<string>",
          "airport_name": "<string>",
          "overnight": false
        }
      ],
      "total_duration_minutes": 123,
      "price": 123,
      "currency": "<string>",
      "booking_token": "<string>",
      "booking_url": "<string>",
      "selection_token": "<string>",
      "departure_token": "<string>",
      "carbon_emissions_grams": 123,
      "carbon_emissions_diff_typical": 123,
      "airline_logo": "<string>",
      "extensions": [
        "<string>"
      ]
    }
  ],
  "other_flights": [
    {
      "legs": [
        {
          "departure_airport": "<string>",
          "departure_airport_name": "<string>",
          "departure_time": "<string>",
          "arrival_airport": "<string>",
          "arrival_airport_name": "<string>",
          "arrival_time": "<string>",
          "duration_minutes": 123,
          "airline": "<string>",
          "airline_logo": "<string>",
          "flight_number": "<string>",
          "aircraft": "<string>",
          "travel_class": "<string>",
          "legroom": "<string>",
          "extensions": [
            "<string>"
          ]
        }
      ],
      "layovers": [
        {
          "duration_minutes": 123,
          "airport": "<string>",
          "airport_name": "<string>",
          "overnight": false
        }
      ],
      "total_duration_minutes": 123,
      "price": 123,
      "currency": "<string>",
      "booking_token": "<string>",
      "booking_url": "<string>",
      "selection_token": "<string>",
      "departure_token": "<string>",
      "carbon_emissions_grams": 123,
      "carbon_emissions_diff_typical": 123,
      "airline_logo": "<string>",
      "extensions": [
        "<string>"
      ]
    }
  ],
  "price_insights": {
    "lowest_price": 123,
    "typical_price_range": [
      123
    ],
    "price_history": [
      [
        123
      ]
    ]
  },
  "airports": [
    {
      "iata_code": "<string>",
      "name": "<string>",
      "city": "<string>",
      "country": "<string>"
    }
  ],
  "return_date": "<string>",
  "currency": "USD",
  "trip_type": "round_trip",
  "search_url": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Prices

price is the price exactly as Google Flights displays it: the total for the entire party (all passengers combined), including mandatory taxes and fees. Optional extras such as checked bags or seat selection are not included. price_type is always total.

Round trips: the two-step flow

Google Flights selects a round trip in two steps — first the outbound, then the return — and this API mirrors that:
  1. Search with trip_type=round_trip, outbound_date, and return_date. Each offer’s legs contain the outbound segments only, and its price is the lowest complete round-trip total available with that outbound (Google pairs it with the cheapest compatible return).
  2. Pick the return: call this endpoint again with the same parameters plus the chosen offer’s departure_token. The response lists the return-leg options; each offer’s price is the exact final round-trip total for that outbound + return pairing, and its booking_url opens the Google Flights booking page for the fully selected itinerary. Use its selection_token with Booking Options to list per-provider prices.
Each call is billed as a regular Flights search. For one-way searches the offer is already fully selected: booking_url opens the booking page directly and departure_token is null.

Authorizations

x-api-key
string
header
required

Query Parameters

departure_id
string
required

Departure IATA (e.g. JFK) or airport ID.

arrival_id
string
required

Arrival IATA (e.g. LHR) or airport ID.

outbound_date
string
required

Outbound date — YYYY-MM-DD.

return_date
string | null

Return date (YYYY-MM-DD) — required for trip_type=round_trip.

trip_type
enum<string>
default:round_trip

round_trip / one_way / multi_city.

Available options:
one_way,
round_trip,
multi_city
adults
integer
default:1

Adult passengers.

Required range: 1 <= x <= 9
children
integer
default:0

Children passengers.

Required range: 0 <= x <= 8
infants_in_seat
integer
default:0
Required range: 0 <= x <= 4
infants_on_lap
integer
default:0
Required range: 0 <= x <= 4
travel_class
enum<string>
default:economy

Cabin class.

Available options:
economy,
premium_economy,
business,
first
currency
string
default:USD

ISO-4217 currency code.

gl
string
default:us

Country code.

hl
string
default:en

Language code.

stops
enum<string>
default:any

Max stops filter — applied client-side.

Available options:
any,
nonstop,
one_stop,
two_stops
max_price
integer | null

Max price filter — applied client-side.

Required range: x >= 1
departure_token
string | null

A departure_token from a round-trip offer. When set, the search returns the return-leg flights for that selected outbound (pass the same departure_id/arrival_id/dates as the original search). Round-trip only.

Response

Successful Response

Response for GET /api/v1/flights/search.

departure_id
string
required
arrival_id
string
required
outbound_date
string
required
best_flights
FlightOffer · object[]
other_flights
FlightOffer · object[]
price_insights
FlightPriceInsights · object | null

Typical price range insight for the searched route.

airports
FlightAirport · object[]
return_date
string | null
currency
string
default:USD
trip_type
enum<string>
default:round_trip
Available options:
one_way,
round_trip,
multi_city
search_url
string | null

Canonical Google Flights tfs URL for this search (in the requested language; market and prices follow gl/currency) — open to view and book the listed flights.