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>",
"price_type": "base",
"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>",
"price_type": "base",
"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,
"price_level": "low",
"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": {}
}
]
}Flights
Google Flights Search
Search Google Flights for one-way, round-trip, or multi-city itineraries with prices, emissions, and price insights.
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>",
"price_type": "base",
"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>",
"price_type": "base",
"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,
"price_level": "low",
"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.
Full inventory: sort_by=price
By default (sort_by=top) the endpoint returns Google’s “Top departing
flights” — the ~6-8 recommended picks, fast. That set demotes cheap-but-long-
layover itineraries, so for price monitoring pass sort_by=price to get the
full price-sorted inventory: every carrier and the cheap long-layover fares,
cheapest first, plus a richer price_insights — Google’s own lowest_price,
typical_price_range, and price_history.
sort_by=price runs a heavier render, so it is slower than the default and, if
Google is slow to respond, falls back to the top set for that call. It applies
to the round-trip / one-way initial search (not the departure_token return-leg
step). A few extreme self-transfer fares Google labels “price unavailable” are
included with a null price.
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:- Search with
trip_type=round_trip,outbound_date, andreturn_date. Each offer’slegscontain the outbound segments only, and itspriceis the lowest complete round-trip total available with that outbound (Google pairs it with the cheapest compatible return). - 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’spriceis the exact final round-trip total for that outbound + return pairing, and itsbooking_urlopens the Google Flights booking page for the fully selected itinerary. Use itsselection_tokenwith Booking Options to list per-provider prices.
booking_url
opens the booking page directly and departure_token is null.Query Parameters
top (default) returns Google's ~6-8 'best' picks — fast. price returns the full price-sorted inventory (every carrier, the cheap long-layover fares) plus Google's own price floor / typical range / history. price is slower (a heavier render) and falls back to the 'top' set under load. Round-trip initial search only.
Available options:
top, price Response
Successful Response
Response for GET /api/v1/flights/search.

