Google Flights API Documentation
Google Flights API uses the /api/v1/search?engine=google_flights
endpoint to retrieve detailed flight information.
This includes data on departure and arrival airports, flight durations, layovers, carbon emissions, prices, and price insights.
API Parameters
Search Query
-
- Name
-
departure_id
- Required
- Required
- Description
-
This parameter specifies the code for the departure airport or a location identifier.
- Airport Code: A 3-letter uppercase code representing the departure airport (e.g., MAD for Madrid-Barajas Airport or JFK for John F. Kennedy International Airport). You can find these codes using resources like Google Flights or IATA.
-
Location Identifier (kgmid): A string that begins with /m/, used to represent a specific location. You can find this identifier on Wikidata by looking for the "Freebase ID" while searching for location. For example,
/m/02_286
is the identifier for New York,United States. -
Multiple Airports/Locations: You can specify more than one airport or location by separating them with commas. For example:
SEA, MIA, /m/02_286
.
-
- Name
-
arrival_id
- Required
- Required
- Description
-
This parameter specifies the code for the arrival airport or a location identifier.
- Airport Code: A 3-letter uppercase code representing the arrival airport (e.g., MAD for Madrid-Barajas Airport or JFK for John F. Kennedy International Airport). You can find these codes using resources like Google Flights or IATA.
-
Location Identifier (kgmid): A string that begins with /m/, used to represent a specific location. You can find this identifier on Wikidata by looking for the "Freebase ID" while searching for location. For example,
/m/02_286
is the identifier for New York,United States. -
Multiple Airports/Locations: You can specify more than one airport or location by separating them with commas. For example:
SEA, MIA, /m/02_286
.
-
- Name
-
multi_city_json
- Required
- Optional
- Description
-
Defines flight details for multi-city itineraries. This parameter is a JSON string containing multiple flight information objects, each with the following fields:
departure_id
- Departure airport or location identifier.arrival_id
- Arrival airport or location identifier.outbound_date
- Outbound date inYYYY-MM-DD
format.times
- Departure and arrival times range. This parameter accepts a string containing up to 4 comma-separated numbers, where the first two numbers specify the departure time range and the last two numbers specify the arrival time range. Each number represents the beginning of an hour (e.g.,4,18,2,18
for a 4:00 AM - 7:00 PM departure and a 2:00 AM - 7:00 PM arrival). Default values are:0,23,0,23
.
Note: this parameter is required ifflight_type
is set tomulti_city
.
Example:[{"departure_id":"SEA","arrival_id":"MIA","outbound_date":"2025-10-01"},{"departure_id":"MIA","arrival_id":"JFK","outbound_date":"2025-10-08","times":"0,23,0,23"},{"departure_id":"JFK","arrival_id":"SEA","outbound_date":"2025-10-15","times":"8,18,9,23"}]
Localization
-
- Name
-
gl
- Required
- Optional
- Description
-
The default parameter
us
defines the country of the search. Check the full list of supported Google Travelgl
countries.
-
- Name
-
hl
- Required
- Optional
- Description
-
The default parameter
en
defines the interface language of the search. Check the full list of supported Google Travelhl
languages.
-
- Name
-
currency
- Required
- Optional
- Description
-
Defines the currency of the returned prices. Default is
USD
. Check the full list of supported Google Travelcurrency
values.
Filters
-
- Name
-
flight_type
- Required
- Optional
- Description
-
Defines the type of the flights. Available options:
-
round_trip
Default one_way
multi_city
-
-
- Name
-
outbound_date
- Required
- Required
- Description
-
Defines the outbound date. The date format is
YYYY-MM-DD
.
Note: Not required ifflight_type
set tomulti_city
.
-
- Name
-
return_date
- Required
- Required
- Description
-
Defines the return date. The date format is
YYYY-MM-DD
.
Note: Not required ifflight_type
set toone_way
ormulti_city
.
-
- Name
-
travel_class
- Required
- Optional
- Description
-
Defines the travel class. Available options:
-
economy
Default premium_economy
business
first_class
-
-
- Name
-
stops
- Required
- Optional
- Description
-
Defines the number of stops during the flight. Available options:
-
any
- Any number of stops. Default nonstop
- Nonstop only.one_stop_or_fewer
- 1 stop or fewer.two_stops_or_fewer
- 2 stops or fewer.
-
-
- Name
-
max_price
- Required
- Optional
- Description
-
Defines the maximum ticket price. Default is unlimited.
-
- Name
-
carry_on_bags
- Required
- Optional
- Description
-
Defines the number of carry-on bags. Default is
0
.
Note: number can't be higher than amount of passengers.
-
- Name
-
checked_bags
- Required
- Optional
- Description
-
Defines the number of checked bags. Default is
0
.
Note: number can't be higher than amount of passengers.
-
- Name
-
included_airlines
- Required
- Optional
- Description
-
Defines the airline or alliance codes to be selected. An airline or alliance ID is an uppercase code (e.g., AC for Air Canada airline or ONEWORLD for oneworld alliance). Airline codes can be found on IATA. Multiple airlines can be combined by joining them with a comma. For example:
AC,ONEWORLD
.
-
- Name
-
excluded_airlines
- Required
- Optional
- Description
-
Defines the airline or alliance codes to be excluded from available airlines. An airline ID is an uppercase code (e.g., AC for Air Canada airline or ONEWORLD for oneworld alliance). Airline codes can be found on IATA. Multiple airlines can be combined by joining them with a comma. For example:
AC,ONEWORLD
.
Note: ifincluded_airlines
andexcluded_airlines
are used together,included_airlines
takes priority.
-
- Name
-
outbound_times
- Required
- Optional
- Description
-
Defines the outbound departure and arrival times range. This parameter accepts a string containing up to 4 comma-separated numbers, where the first two numbers specify the departure time range and the last two numbers specify the arrival time range. Each number represents the beginning of an hour (e.g.,
4,18,2,18
for a 4:00 AM - 7:00 PM departure and a 2:00 AM - 7:00 PM arrival). Default values are:0,23,0,23
.
-
- Name
-
return_times
- Required
- Optional
- Description
-
Defines the return departure and arrival times range. This parameter also accepts up to 4 comma-separated numbers, where the first two specify the departure time range and the last two specify the arrival time range, following the same format as outbound_times (e.g.,
4,18,2,18
for a 4:00 AM - 7:00 PM departure and a 2:00 AM - 7:00 PM arrival). Default values are:0,23,0,23
.
Note: available only ifflight_type
set toround_trip
.
-
- Name
-
emissions
- Required
- Optional
- Description
-
Defines the emission level of the flight. Use
1
to show only flights with lower than typical emissions for that route.
-
- Name
-
included_connecting_airports
- Required
- Optional
- Description
-
Defines connecting airports to be included. By default all connecting_airports are included. An airport ID is an uppercase 3-letter code (e.g., CDG for Paris Charles de Gaulle Airport). Multiple airports can be combined by joining them with a comma.
-
- Name
-
excluded_connecting_airports
- Required
- Optional
- Description
-
Defines connecting airports to be excluded from available airports. An airport ID is an uppercase 3-letter code (e.g., CDG for Paris Charles de Gaulle Airport). Multiple airports can be combined by joining them with a comma.
-
- Name
-
layover_duration_min
- Required
- Optional
- Description
-
Defines the minimum layover duration in minutes (e.g., 60 for 1 hours).
-
- Name
-
layover_duration_max
- Required
- Optional
- Description
-
Defines the maximum layover duration in minutes (e.g., 240 for 4 hours). Max value is 1800 minutes (30 hours).
-
- Name
-
max_flight_duration
- Required
- Optional
- Description
-
Defines the maximum flight duration in minutes (e.g., 240 for 4 hours).
-
- Name
-
separate_tickets
- Required
- Optional
- Description
-
Defines whether to display separate tickets. The default value is
0
. Set to1
to hide separate and self-transfer tickets, or0
to show them.
Number of Passengers
-
- Name
-
adults
- Required
- Optional
- Description
-
Defines the number of adults. Default is
1
.
Note: Maximum number of passengers is 9.
-
- Name
-
children
- Required
- Optional
- Description
-
Defines the number of children. Default is
0
.
-
- Name
-
infants_in_seat
- Required
- Optional
- Description
-
Defines the number of infants in seat. Default is
0
.
-
- Name
-
infants_on_lap
- Required
- Optional
- Description
-
Defines the number of infants on lap. Default is
0
.
Pagination
-
- Name
-
departure_token
- Required
- Optional
- Description
-
Used to select a flight and view return flights (for round trips) or flights for the next leg (for multi-city trips). This token is found in the flight results.
-
- Name
-
booking_token
- Required
- Optional
- Description
-
Used to retrieve booking options for selected flights. This token is found in the flight results.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_flights
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
API Examples
Flights
The Google Flights API uses two tokens to handle flight selection:
- A
departure_token
is used to select an individual flight. For example, in around_trip
, you use it to select the outbound flight before obtaining abooking_token
for the return flight. booking_token
- Used to finalize selections and retrieve booking details.
flight_type
. Below are examples to illustrate their usage.
https://www.searchapi.io/api/v1/search?arrival_id=MAD&departure_id=JFK&engine=google_flights&flight_type=round_trip&outbound_date=2025-01-29&return_date=2025-02-05
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "round_trip",
"departure_id": "JFK",
"arrival_id": "MAD",
"outbound_date": "2025-01-29",
"return_date": "2025-02-05"
}
response = requests.get(url, params=params)
print(response.text)
{
"best_flights": [
{
"flights": [
{
"departure_airport": {
"name": "John F. Kennedy International Airport",
"id": "JFK",
"date": "2024-11-19",
"time": "17:00"
},
"arrival_airport": {
"name": "Adolfo Suárez Madrid–Barajas Airport",
"id": "MAD",
"date": "2024-11-20",
"time": "06:05"
},
"duration": 425,
"airplane": "Airbus A330",
"airline": "Iberia",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/IB.png",
"travel_class": "Economy",
"flight_number": "IB 212",
"ticket_also_sold_by": ["American", "Finnair", "British Airways"],
"is_overnight": true,
"extensions": [
"Power and USB outlets",
"On-demand video",
"Wi-Fi for fee",
"Seat type Average Legroom",
"Legroom 31 inches",
"Carbon emission: 440 kg"
],
"detected_extensions": {
"has_power_and_usb_outlets": true,
"has_on_demand_video": true,
"wifi": "for fee",
"seat_type": "Average Legroom",
"legroom_short": "31 in",
"legroom_long": "31 inches",
"carbon_emission": 440
}
}
],
"total_duration": 425,
"carbon_emissions": {
"this_flight": 440000,
"typical_for_this_route": 487000,
"difference_percent": -10,
"lowest_route": 509000
},
"price": 490,
"type": "Round trip",
"extensions": ["Bag and fare conditions depend on the return flight"],
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/IB.png",
"departure_token": "WyJDalJJWVRGYVNVSkVSemsyWldOQlRVMVNVR2RDUnkwdExTMHRMUzB0TFc5NVpHMHhOMEZCUVVGQlIyTTNVa2h2VEhORFVrbEJFZ1ZKUWpJeE1ob0xDSzMrQWhBQ0dnTlZVMFE0SEhDdC9nST0iLFtbIkpGSyIsIjIwMjQtMTEtMTkiLCJNQUQiLCJudWxsIiwiSUIiLCIyMTIiXV1d"
},
...
]
}
One-Way Flight
For one_way
flights, only a booking_token
is provided. Since there’s only one flight to select, there is no departure_token
.
Use the booking_token
to retrieve booking_options
.
https://www.searchapi.io/api/v1/search?arrival_id=MAD&departure_id=JFK&engine=google_flights&flight_type=one_way&outbound_date=2025-01-29
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "one_way",
"departure_id": "JFK",
"arrival_id": "MAD",
"outbound_date": "2025-01-29"
}
response = requests.get(url, params=params)
print(response.text)
{
"best_flights": [
{
"flights": [
{
"departure_airport": {
"name": "John F. Kennedy International Airport",
"id": "JFK",
"date": "2024-12-09",
"time": "22:00"
},
"arrival_airport": {
"name": "Humberto Delgado Airport",
"id": "LIS",
"date": "2024-12-10",
"time": "09:55"
},
"duration": 415,
"airplane": "Airbus A330-900neo",
"airline": "Tap Air Portugal",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"travel_class": "Economy",
"flight_number": "TP 210",
"is_overnight": true,
"extensions": [
"Power and USB outlets",
"On-demand video",
"Wi-Fi for fee",
"Seat type Average Legroom",
"Legroom 31 inches",
"Carbon emission: 418 kg"
],
"detected_extensions": {
"has_power_and_usb_outlets": true,
"has_on_demand_video": true,
"wifi": "for fee",
"seat_type": "Average Legroom",
"legroom_short": "31 in",
"legroom_long": "31 inches",
"carbon_emission": 418
}
},
{
"departure_airport": {
"name": "Humberto Delgado Airport",
"id": "LIS",
"date": "2024-12-10",
"time": "11:50"
},
"arrival_airport": {
"name": "Adolfo Suárez Madrid–Barajas Airport",
"id": "MAD",
"date": "2024-12-10",
"time": "14:05"
},
"duration": 75,
"airplane": "Airbus A321neo",
"airline": "Tap Air Portugal",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"travel_class": "Economy",
"flight_number": "TP 1014",
"is_often_delayed": true,
"extensions": [
"Power and USB outlets",
"On-demand video",
"Wi-Fi for fee",
"Seat type Average Legroom",
"Legroom 31 inches",
"Carbon emission: 67 kg"
],
"detected_extensions": {
"has_power_and_usb_outlets": true,
"has_on_demand_video": true,
"wifi": "for fee",
"seat_type": "Average Legroom",
"legroom_short": "31 in",
"legroom_long": "31 inches",
"carbon_emission": 67
}
}
],
"layovers": [
{
"duration": 115,
"name": "Humberto Delgado Airport",
"id": "LIS"
}
],
"total_duration": 605,
"carbon_emissions": {
"this_flight": 486000,
"typical_for_this_route": 487000,
"difference_percent": 0,
"lowest_route": 501000
},
"price": 290,
"type": "One way",
"extensions": ["Bag and fare conditions depend on the return flight"],
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"booking_token": "WyJDalJJY0ZZMU5EUXRUa1p0TkVWQlFuQmtVbEZDUnkwdExTMHRMUzB0TFhCbWIyY3lNRUZCUVVGQlIyUlRMV0p2U1dsNk1sbEJFZ3hVVURJeE1IeFVVREV3TVRRYUN3aU00Z0VRQWhvRFZWTkVPQnh3ak9JQiIsW1siSkZLIiwiMjAyNC0xMi0wOSIsIkxJUyIsbnVsbCwiVFAiLCIyMTAiXSxbIkxJUyIsIjIwMjQtMTItMTAiLCJNQUQiLG51bGwsIlRQIiwiMTAxNCJdXV0="
},
...
]
}
Multi City
For multi_city
flights:
- Use
departure_token
to select each flight sequentially, except the final flight. - Use
booking_token
to select the final flight and retrieve booking details for the entire trip.
https://www.searchapi.io/api/v1/search?engine=google_flights&flight_type=multi_city&multi_city_json=%5B%7B%22departure_id%22%3A%22%2Fm%2F02_286%22%2C%22arrival_id%22%3A%22MIA%22%2C%22outbound_date%22%3A%222025-10-01%22%7D%2C%7B%22departure_id%22%3A%22MIA%22%2C%22arrival_id%22%3A%22JFK%22%2C%22outbound_date%22%3A%222025-10-08%22%2C%22times%22%3A%220%2C23%2C0%2C23%22%7D%2C%7B%22departure_id%22%3A%22JFK%22%2C%22arrival_id%22%3A%22SEA%22%2C%22outbound_date%22%3A%222025-10-15%22%2C%22times%22%3A%228%2C18%2C9%2C23%22%7D%5D
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "multi_city",
"multi_city_json": "[{\"departure_id\":\"/m/02_286\",\"arrival_id\":\"MIA\",\"outbound_date\":\"2025-10-01\"},{\"departure_id\":\"MIA\",\"arrival_id\":\"JFK\",\"outbound_date\":\"2025-10-08\",\"times\":\"0,23,0,23\"},{\"departure_id\":\"JFK\",\"arrival_id\":\"SEA\",\"outbound_date\":\"2025-10-15\",\"times\":\"8,18,9,23\"}]"
}
response = requests.get(url, params=params)
print(response.text)
{
"best_flights": [
{
"flights": [
{
"departure_airport": {
"name": "LaGuardia Airport",
"id": "LGA",
"date": "2025-10-01",
"time": "08:00"
},
"arrival_airport": {
"name": "Miami International Airport",
"id": "MIA",
"date": "2025-10-01",
"time": "11:11"
},
"duration": 191,
"airplane": "Boeing 737",
"airline": "American",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AA.png",
"travel_class": "Economy",
"flight_number": "AA 970",
"extensions": [
"Power and USB outlets",
"Stream video to own device",
"Wi-Fi for fee",
"Seat type Average Legroom",
"Legroom 30 inches",
"Carbon emission: 161 kg"
],
"detected_extensions": {
"has_power_and_usb_outlets": true,
"has_stream_video_to_own_device": true,
"wifi": "for fee",
"seat_type": "Average Legroom",
"legroom_short": "30 in",
"legroom_long": "30 inches",
"carbon_emission": 161
}
}
],
"total_duration": 191,
"carbon_emissions": {
"this_flight": 162000,
"typical_for_this_route": 153000,
"difference_percent": 6,
"lowest_route": 144000
},
"price": 291,
"type": "Multi city",
"extensions": [
"Checked baggage for a fee",
"Bag and fare conditions depend on the return flight"
],
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/AA.png",
"departure_token": "WyJDalJJVVcxa1oyTnFaVFJPTW1OQlEyUTNWbmRDUnkwdExTMHRMUzB0YjJ0aVozRXhPVUZCUVVGQlIyUlpSMEpSU1VWS1NrZEJFZ1ZCUVRrM01Cb0xDS1RqQVJBQ0dnTlZVMFE0SEhDazR3RT0iLFtbIkxHQSIsIjIwMjUtMTAtMDEiLCJNSUEiLG51bGwsIkFBIiwiOTcwIl1dXQ=="
},
...
],
...
}
Selected Flights
Selected flights are only available after selecting the final flight when booking_token
is used.
https://www.searchapi.io/api/v1/search?arrival_id=MAD&booking_token=WyJDalJJZWtGS1VFTjFabVpxYVRCQlFuWlJYMEZDUnkwdExTMHRMUzB0TFhCbVlYZ3hNMEZCUVVGQlIyUlVSRkJqUTNKNVoyTkJFZ3hVVURFd01URjhWRkF5TURrYUN3aTl3QUlRQWhvRFZWTkVPQnh3dmNBQyIsW1siSkZLIiwiMjAyNS0xMC0wMSIsIkxJUyIsbnVsbCwiVFAiLCIyMTAiXSxbIkxJUyIsIjIwMjUtMTAtMDIiLCJNQUQiLG51bGwsIlRQIiwiMTAxNCJdXSxbWyJNQUQiLCIyMDI1LTEwLTA4IiwiTElTIixudWxsLCJUUCIsIjEwMTEiXSxbIkxJUyIsIjIwMjUtMTAtMDgiLCJKRksiLG51bGwsIlRQIiwiMjA5Il1dXQ%3D%3D&departure_id=JFK&engine=google_flights&flight_type=round_trip&outbound_date=2025-10-01&return_date=2025-10-08
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "round_trip",
"departure_id": "JFK",
"arrival_id": "MAD",
"outbound_date": "2025-10-01",
"return_date": "2025-10-08",
"booking_token": "WyJDalJJZWtGS1VFTjFabVpxYVRCQlFuWlJYMEZDUnkwdExTMHRMUzB0TFhCbVlYZ3hNMEZCUVVGQlIyUlVSRkJqUTNKNVoyTkJFZ3hVVURFd01URjhWRkF5TURrYUN3aTl3QUlRQWhvRFZWTkVPQnh3dmNBQyIsW1siSkZLIiwiMjAyNS0xMC0wMSIsIkxJUyIsbnVsbCwiVFAiLCIyMTAiXSxbIkxJUyIsIjIwMjUtMTAtMDIiLCJNQUQiLG51bGwsIlRQIiwiMTAxNCJdXSxbWyJNQUQiLCIyMDI1LTEwLTA4IiwiTElTIixudWxsLCJUUCIsIjEwMTEiXSxbIkxJUyIsIjIwMjUtMTAtMDgiLCJKRksiLG51bGwsIlRQIiwiMjA5Il1dXQ=="
}
response = requests.get(url, params=params)
print(response.text)
{
"selected_flights": [
{
"flights": [
{
"departure_airport": {
"name": "John F. Kennedy International Airport",
"id": "JFK",
"date": "2025-10-01",
"time": "22:05"
},
"arrival_airport": {
"name": "Humberto Delgado Airport",
"id": "LIS",
"date": "2025-10-02",
"time": "10:10"
},
"duration": 425,
"airplane": "Airbus A330",
"airline": "Tap Air Portugal",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"travel_class": "Economy",
"flight_number": "TP 210",
"is_overnight": true,
"extensions": [
"In-seat USB outlet",
"On-demand video",
"Seat type Average Legroom",
"Legroom 31 inches",
"Carbon emission: 500 kg"
],
"detected_extensions": {
"has_in_seat_usb_outlet": true,
"has_on_demand_video": true,
"seat_type": "Average Legroom",
"legroom_short": "31 in",
"legroom_long": "31 inches",
"carbon_emission": 500
}
},
{
"departure_airport": {
"name": "Humberto Delgado Airport",
"id": "LIS",
"date": "2025-10-02",
"time": "13:00"
},
"arrival_airport": {
"name": "Adolfo Suárez Madrid–Barajas Airport",
"id": "MAD",
"date": "2025-10-02",
"time": "15:20"
},
"duration": 80,
"airplane": "Airbus A321neo",
"airline": "Tap Air Portugal",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png",
"travel_class": "Economy",
"flight_number": "TP 1014",
"is_often_delayed": true,
"extensions": [
"Power and USB outlets",
"On-demand video",
"Wi-Fi for fee",
"Seat type Average Legroom",
"Legroom 31 inches",
"Carbon emission: 67 kg"
],
"detected_extensions": {
"has_power_and_usb_outlets": true,
"has_on_demand_video": true,
"wifi": "for fee",
"seat_type": "Average Legroom",
"legroom_short": "31 in",
"legroom_long": "31 inches",
"carbon_emission": 67
}
}
],
"layovers": [
{
"duration": 170,
"name": "Humberto Delgado Airport",
"id": "LIS"
}
],
"total_duration": 675,
"carbon_emissions": {
"this_flight": 568000,
"typical_for_this_route": 487000,
"difference_percent": 17
},
"type": "Round trip",
"airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/TP.png"
},
...
]
}
Booking Options
Booking options are only available after selecting the final flight when booking_token
is used.
https://www.searchapi.io/api/v1/search?arrival_id=MAD&booking_token=WyJDalJJZWtGS1VFTjFabVpxYVRCQlFuWlJYMEZDUnkwdExTMHRMUzB0TFhCbVlYZ3hNMEZCUVVGQlIyUlVSRkJqUTNKNVoyTkJFZ3hVVURFd01URjhWRkF5TURrYUN3aTl3QUlRQWhvRFZWTkVPQnh3dmNBQyIsW1siSkZLIiwiMjAyNS0xMC0wMSIsIkxJUyIsbnVsbCwiVFAiLCIyMTAiXSxbIkxJUyIsIjIwMjUtMTAtMDIiLCJNQUQiLG51bGwsIlRQIiwiMTAxNCJdXSxbWyJNQUQiLCIyMDI1LTEwLTA4IiwiTElTIixudWxsLCJUUCIsIjEwMTEiXSxbIkxJUyIsIjIwMjUtMTAtMDgiLCJKRksiLG51bGwsIlRQIiwiMjA5Il1dXQ%3D%3D&departure_id=JFK&engine=google_flights&flight_type=round_trip&outbound_date=2025-10-01&return_date=2025-10-08
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "round_trip",
"departure_id": "JFK",
"arrival_id": "MAD",
"outbound_date": "2025-10-01",
"return_date": "2025-10-08",
"booking_token": "WyJDalJJZWtGS1VFTjFabVpxYVRCQlFuWlJYMEZDUnkwdExTMHRMUzB0TFhCbVlYZ3hNMEZCUVVGQlIyUlVSRkJqUTNKNVoyTkJFZ3hVVURFd01URjhWRkF5TURrYUN3aTl3QUlRQWhvRFZWTkVPQnh3dmNBQyIsW1siSkZLIiwiMjAyNS0xMC0wMSIsIkxJUyIsbnVsbCwiVFAiLCIyMTAiXSxbIkxJUyIsIjIwMjUtMTAtMDIiLCJNQUQiLG51bGwsIlRQIiwiMTAxNCJdXSxbWyJNQUQiLCIyMDI1LTEwLTA4IiwiTElTIixudWxsLCJUUCIsIjEwMTEiXSxbIkxJUyIsIjIwMjUtMTAtMDgiLCJKRksiLG51bGwsIlRQIiwiMjA5Il1dXQ=="
}
response = requests.get(url, params=params)
print(response.text)
{
"booking_options": [
{
"book_with": "American",
"airline_logos": [
"https://www.gstatic.com/flights/airline_logos/70px/AA.png"
],
"flight_numbers": ["AA 8566", "AA 749", "AA 657"],
"price": 490,
"option_title": "Basic Economy",
"extensions": [
"Seat selection for a fee",
"Standard seat",
"Priority boarding for a fee",
"No ticket changes"
],
"baggage_prices": ["1st checked bag: 150", "1 free carry-on"],
"booking_request": {
"url": "https://www.google.com/travel/clk/f",
"post_data": "u=Et9ACgJBQRoEC..."
}
},
...
{
"book_with": "Iberia",
"airline_logos": [
"https://www.gstatic.com/flights/airline_logos/70px/IB.png"
],
"flight_numbers": ["IB 212", "AA 749", "AA 657"],
"price": 515,
"baggage_prices": ["1 free carry-on"],
"booking_phone": "1 (800) 772-4642",
"estimated_phone_service_fee": 25
}
]
}
Price Insights
https://www.searchapi.io/api/v1/search?arrival_id=MAD&departure_id=JFK&engine=google_flights&flight_type=round_trip&outbound_date=2025-01-29&return_date=2025-02-05
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "round_trip",
"departure_id": "JFK",
"arrival_id": "MAD",
"outbound_date": "2025-01-29",
"return_date": "2025-02-05"
}
response = requests.get(url, params=params)
print(response.text)
{
"price_insights": {
"lowest_price": 490,
"price_level": "typical",
"typical_price_range": {
"low_price": 470,
"high_price": 1050
},
"price_history": [
{
"price": 646,
"iso_date": "2024-09-19T04:00:00Z"
},
{
"price": 646,
"iso_date": "2024-09-20T04:00:00Z"
},
{
"price": 646,
"iso_date": "2024-09-21T04:00:00Z"
},
{
"price": 646,
"iso_date": "2024-09-22T04:00:00Z"
},
{
"price": 876,
"iso_date": "2024-09-23T04:00:00Z"
},
{
"price": 661,
"iso_date": "2024-09-24T04:00:00Z"
},
...
]
}
}
Airports
https://www.searchapi.io/api/v1/search?arrival_id=MAD&departure_id=JFK&engine=google_flights&flight_type=round_trip&outbound_date=2025-01-29&return_date=2025-02-21
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_flights",
"flight_type": "round_trip",
"departure_id": "JFK",
"arrival_id": "MAD",
"outbound_date": "2025-01-29",
"return_date": "2025-02-21"
}
response = requests.get(url, params=params)
print(response.text)
{
"airports": [
{
"departure": [
{
"airport": {
"id": "JFK",
"name": "John F. Kennedy International Airport"
},
"city": "New York",
"country": "United States",
"country_code": "US",
"image": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRa1dwH1NZQk4dsbPiyA9Vrq2RX75jXSZ-OkHn7NkLHl-11HercqDXoZ4p2cDxJkH6vca2degawrCzHEQ",
"thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQEaUa9NsdPWGpAUGkTApkZDT_4M6_6V8wTcC0v1b1wJAJX-BuMSiipXbsoznGgcI1xLOc5QiTcR_xovexgjdOz0gqQe0tRQ9h0bUkZ07Q"
}
],
"arrival": [
{
"airport": {
"id": "MAD",
"name": "Adolfo Suárez Madrid–Barajas Airport"
},
"city": "Madrid",
"country": "Spain",
"country_code": "ES",
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQmeVXVi8Qf2opkC-xAX9Z8sqmXLNnCUyEBCH7lY9Du60ePIdqYcgUv_X08z5SxkepA5VBR3iRIMf2cRQ",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQE3EB-Tm8oy6YFOIxbhJY-zUj5c54BiVwOKamJRAcogeUidKas9ZrofZJVWQSiCADP_jfvrpPYRJ2PM3p1Sv_lzWcdo4ph1bLVdvASdA"
}
]
},
...
]
}