Google Flights
Perform Search
Overview
| Method | Endpoint | Version | Description |
|---|---|---|---|
POST |
/api/v1/open/search |
v1 | Google Search API endpoint for retrieving search results |
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
Content-Type |
string |
Yes | Must be set to application/json |
Accept |
string |
No | Response format (defaults to application/json) |
Authentication
API Key Authentication
- Pass the API key as a request parameter:
api_key=your_api_key - Example:
"api_key": "your_api_key_here"
HTTP Status Codes
| Code | Status | Description | Retry |
|---|---|---|---|
| 200 | OK | Request successful | No |
Response Codes
| Code | Description | Retry |
|---|---|---|
| 200 | Request successful | No |
| 400100 | Unsupported search engine | No |
| 400200 | The search service is temporarily unavailable. Please try again later | No |
| 400300 | ForUserQuery contains prohibited content | No |
| 400400 | No results found, please adjust keywords and try again | No |
| 400500 | Authorization failed, please check your API credentials | No |
| 400600 | The request frequency is too high, please try again later | No |
| 400700 | You have reached the daily search limit | No |
| 400710 | Insufficient Balance | No |
Request Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
api_key |
string |
Yes | API key for authentication | |
engine |
string |
Yes | Search engine type, currently engine value is google_flights |
|
departure_id |
string |
Yes | Parameter defines the departure airport code or location kgmid. An airport code is an uppercase 3-letter code. You can search for it on Google Flights or IATA. For example, CDG is Paris Charles de Gaulle Airport and AUS is Austin-Bergstrom International Airport. A location kgmid is a string that starts with /m/. You can search for a location on Wikidata and use its "Freebase ID" as the location kgmid. For example, /m/0vzm is the location kgmid for Austin, TX. You can specify multiple departure airports by separating them with a comma. For example, CDG,ORY,/m/04jpl. | |
arrival_id |
string |
No | Parameter defines the arrival airport code or location kgmid. An airport code is an uppercase 3-letter code. You can search for it on Google Flights or IATA. For example, CDG is Paris Charles de Gaulle Airport and AUS is Austin-Bergstrom International Airport. A location kgmid is a string that starts with /m/. You can search for a location on Wikidata and use its "Freebase ID" as the location kgmid. For example, /m/0vzm is the location kgmid for Austin, TX. You can specify multiple arrival airports by separating them with a comma. For example, CDG,ORY,/m/04jpl. | |
currency |
string |
No | Parameter defines the currency of the returned prices. Default to USD. Head to the Google Travel Currencies page for a full list of supported currency codes. | |
adults |
string |
No | Parameter defines the number of adults. Default to 1 | 1 |
children |
string |
No | Parameter defines the number of children. Default to 0 | 0 |
infants_in_seat |
string |
No | Parameter defines the number of infants in seat. Default to 0 | 0 |
infants_on_lap |
string |
No | Parameter defines the number of infants on lap. Default to 0 | 0 |
type |
string |
No | Parameter defines the type of the flights. Available options: 1 - Round trip (default), 2 - One way, 3 - Multi-city. When this parameter is set to 3, use multi_city_json to set the flight information. To obtain the returning flight information for Round Trip (1), you need to make another request using a departure_token. | |
outbound_date |
string |
Yes | Parameter defines the outbound date. The format is YYYY-MM-DD. e.g. 2025-09-20 | |
return_date |
string |
No | Parameter defines the return date. The format is YYYY-MM-DD. e.g. 2025-09-26. Parameter is required if type parameter is set to: 1 (Round trip) | |
travel_class |
string |
No | Parameter defines the travel class. Available options: 1 - Economy (default), 2 - Premium economy, 3 - Business, 4 - First | |
multi_city_json |
string |
No | Fill in this parameter, and its value will take precedence. Parameter defines the flight information for multi-city flights. It's a JSON string containing multiple flight information objects. Each object should contain the following fields: departure_id - The departure airport code or location kgmid. The format is the same as the main departure_id parameter. arrival_id - The arrival airport code or location kgmid. The format is the same as the main arrival_id parameter. date - Flight date. The format is the same as the outbound_date parameter. times - Time range for the flight. The format is the same as the outbound_times parameter. This parameter is optional. Example: {"itinerary":[{"departure_id":"PVG","arrival_id":"PEK","date":"2025-11-01","times":"4,18"},{"departure_id":"PEK","arrival_id":"PVG","date":"2025-11-11","times":"4,18"}],"adults":1,"children":0,"infants_in_seat":0,"infants_on_lap":0,"travel_class":1,"type":1} The example is a round trip flight from PVG to PEK on 2025-11-01, then from PEK to PVG on 2025-11-11. There is a departure time range from 4:00 AM - 7:00 PM for both the outbound and return flights. | |
html |
string |
No | Whether to return HTML format, 1-yes, 0-no | 0 |
Response Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
Complete Response Parameters Overview
search_metadata
object Contains metadata about the search execution
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
id |
string |
Unique identifier for the search request | |
json_endpoint |
string |
Provide an interface endpoint for searching related JSON data, through which JSON-formatted search data can be obtained | |
created_at |
string |
The timestamp when the search request was created, recording the time when the search was initiated | |
processed_at |
string |
The timestamp when the search results were processed and became available for return, recording the time point from processing to completion of the search | |
google_url |
string |
The Google search URL, which contains the search keyword "coffee" along with language parameters (hl=en for English), regional parameters (gl=us for the United States), and other search parameters, used to redirect to the corresponding Google search page | |
status |
string |
Status of the search execution (e.g., Success) | |
raw_html_file |
string |
Identifier for the original HTML file | |
total_time_taken |
number |
The total time spent on the entire search process (including request sending, result parsing, and other stages) |
search_information
object Contains information about the search results
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
time_taken_displayed |
number |
TDisplay time (i.e., the time spent on displaying the search results) |
search_parameters
object Contains the parameters used for the search
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
departure_id |
string |
Departure airport code or location kgmid | |
arrival_id |
string |
Arrival airport code or location kgmid | |
engine |
string |
Search engine used for this query (e.g., google_web) | |
html |
string |
When HTML=0, returns JSON; when HTML=1, returns HTML; when HTML=2, returns both JSON and HTML | |
google_domain |
string |
Specifies the corresponding Google domain (e.g., google.com, etc., used to distinguish Google services in different regions/locales) |
best_flights
object[] Optimal flight recommendation set filtered and returned based on multiple dimensions such as price, flight duration, number of stopovers, and airline reputation
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
flights |
object[] |
Array of flight information containing details of specific flights | |
flights[].departure_airport |
object |
Departure airport information | |
flights[].departure_airport.name |
string |
Departure airport name | |
flights[].departure_airport.id |
string |
Departure airport code | |
flights[].departure_airport.time |
string |
Departure time | |
flights[].arrival_airport |
object |
Arrival airport information | |
flights[].arrival_airport.name |
string |
Arrival airport information | |
flights[].arrival_airport.id |
string |
Arrival airport code | |
flights[].arrival_airport.time |
string |
Arrival time | |
flights[].duration |
number |
Flight duration of a single segment | |
flights[].airplane |
string |
Aircraft model | |
flights[].airline |
string |
Airline | |
flights[].airline_logo |
string |
Image link of airline logo | |
flights[].travel_class |
string |
Cabin class | |
flights[].flight_number |
string |
Flight number | |
flights[].legroom |
string |
Legroom | |
total_duration |
number |
Total flight duration | |
carbon_emissions |
object |
Carbon emission data | |
carbon_emissions.this_flight |
number |
Carbon emissions of this flight | |
carbon_emissions.typical_for_this_route |
number |
Typical carbon emissions of this route | |
carbon_emissions.difference_percent |
number |
Percentage difference between this flight’s carbon emissions and the typical route emissions | |
price |
number |
Flight price | |
type |
string |
Flight type | |
airline_logo |
string |
Airline logo image link | |
departure_token |
string |
Identifier token associated with departure information |
other_flights
object[] A set of alternative flight recommendations filtered and returned based on multiple dimensions such as price, flight duration, number of stopovers, and airline reputation
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
flights |
object[] |
An array of flight information containing details of specific flights | |
flights[].departure_airport |
object |
Departure airport information | |
flights[].departure_airport.name |
string |
Departure airport name | |
flights[].departure_airport.id |
string |
Departure airport code | |
flights[].departure_airport.time |
string |
Departure time | |
flights[].arrival_airport |
object |
Arrival airport information | |
flights[].arrival_airport.name |
string |
Arrival airport information | |
flights[].arrival_airport.id |
string |
Arrival airport code | |
flights[].arrival_airport.time |
string |
Arrival time | |
flights[].duration |
number |
Flight duration of a single segment | |
flights[].airplane |
string |
Aircraft model | |
flights[].airline |
string |
Airline | |
flights[].airline_logo |
string |
Image link of airline logo | |
flights[].travel_class |
string |
Cabin class | |
flights[].flight_number |
string |
Flight number | |
flights[].legroom |
string |
Legroom | |
flights[].ticket_also_sold_by |
string |
Which channels or agencies can also sell the ticket | |
layovers |
object[] |
Array of transfer airport information | |
layovers[].duration |
number |
Layover duration | |
layovers[].name |
string |
Transit airport name | |
layovers[].id |
string |
IATA code of the transit airport | |
total_duration |
number |
Total flight duration | |
carbon_emissions |
object |
Carbon emission data | |
carbon_emissions.this_flight |
number |
Carbon emissions of this flight | |
carbon_emissions.typical_for_this_route |
number |
Typical carbon emissions of this route | |
carbon_emissions.difference_percent |
number |
Percentage difference between this flight’s carbon emissions and the typical route emissions | |
price |
number |
Flight price | |
airline_logo |
string |
Airline logo image link | |
departure_token |
string |
Identifier token associated with departure information |
price_insights
object Price Insights module: Key reference information on flight prices
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
lowest_price |
number |
Lowest available price for the currently queried flight | |
price_level |
string |
Categorical description of price levels, used to indicate how the current price compares among similar flights |
airports
object A collection of airport information related to the flight, including departure airport, arrival airport, and transit airports (if applicable)
| Parameter | Type | Description | Applicable Terminal |
|---|---|---|---|
departure |
object[] |
A list containing details such as departure airport, city, and country | |
departure[].airport |
object |
An object encapsulating detailed information about the departure airport | |
departure[].airport.id |
string |
Identifier code of the departure airport | |
departure[].airport.name |
string |
Departure airport name | |
departure[].city |
string |
Name of the city where the departure airport is located | |
departure[].country |
string |
Name of the country where the departure airport is located | |
departure[].country_code |
string |
Code of the country where the departure airport is located | |
departure[].image |
string |
Image resource link related to the departure airport | |
departure[].thumbnail |
string |
Thumbnail image resource link related to the departure airport |