Skip to content

Google Flights

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 google
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

{
    "code": 200,
    "data": {
        "search_metadata": {
            "raw_html_file": "oss_html",
            "total_time_taken": 2.032416469,
            "id": "1985902431212408832",
            "json_endpoint": "oss_json",
            "created_at": "2025-10-29 08:53:31",
            "processed_at": "2025-10-29 08:53:33",
            "google_url": "https://www.google.com/travel/flights/search?tfs=CBwQAhoeEgoyMDI1LTExLTExagcIARIDUFZHcgcIARIDUEVLQAFIAXABggELCP___________wGYAQI",
            "status": "Success"
        },
        "search_information": {
          "time_taken_displayed": 0.042
        },
        "search_parameters": {
            "engine": "google_flights",
            "html": "0",
            "google_domain": "www.google.com",
            "q": "google_flights",
            "departure_id": "PVG",
            "arrival_id": "PEK",
        },
        "best_flights": [
          {
            "flights": [
              {
                "departure_airport": {
                  "name": "Shanghai Pudong International Airport",
                  "id": "PVG",
                  "time": "2025-10-17 18:00"
                },
                "arrival_airport": {
                  "name": "Beijing Capital International Airport",
                  "id": "PEK",
                  "time": "2025-10-17 15:30"
                },
                "duration": 150,
                "airplane": "Airbus A321",
                "airline": "China Eastern",
                "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/MU.png",
                "travel_class": "Economy",
                "flight_number": "MU 5161",
                "legroom": "31 in"
              }
            ],
            "total_duration": 150,
            "carbon_emissions": {
              "this_flight": 137000,
              "typical_for_this_route": 114000,
              "difference_percent": 20
            },
            "price": 312,
            "type": "round trip",
            "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/MU.png",
            "departure_token": "CjRIemlncmtPQjRBWEVBQ0VfVHdCRy0tLS0tLS0tc21iZHQxMkFBQUFBR2p3c2MwTlFsa2dBEgZNVTUxNjEaCwjM8wEQAhoDVVNEOB1wzPMB"
          }
        ],
        "other_flights": [
          {
            "flights": [
              {
                "departure_airport": {
                  "name": "Shanghai Pudong International Airport",
                  "id": "PVG",
                  "time": "2025-10-17 16:55"
                },
                "arrival_airport": {
                  "name": "Macau International Airport",
                  "id": "MFM",
                  "time": "2025-10-17 19:45"
                },
                "duration": 170,
                "airplane": "Airbus A321",
                "airline": "Air Macau",
                "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/NX.png",
                "travel_class": "Economy",
                "flight_number": "NX 135",
                "legroom": "29 in",
                "ticket_also_sold_by": "Shenzhen"
              },
              {
                "departure_airport": {
                  "name": "Macau International Airport",
                  "id": "MFM",
                  "time": "2025-10-18 8:10"
                },
                "arrival_airport": {
                  "name": "Beijing Capital International Airport",
                  "id": "PEK",
                  "time": "2025-10-18 11:25"
                },
                "duration": 195,
                "airplane": "Airbus A320",
                "airline": "Air Macau",
                "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/NX.png",
                "travel_class": "Economy",
                "flight_number": "NX 6",
                "legroom": "29 in",
                "ticket_also_sold_by": "Shenzhen"
              }
            ],
            "layovers": [
              {
                "duration": 745,
                "name": "Macau International Airport",
                "id": "MFM"
              }
            ],
            "total_duration": 1110,
            "carbon_emissions": {
              "this_flight": 353000,
              "typical_for_this_route": 114000,
              "difference_percent": 210
            },
            "price": 233,
            "airline_logo": "https://www.gstatic.com/flights/airline_logos/70px/NX.png",
            "departure_token": "CjRIemlncmtPQjRBWEVBQ0VfVHdCRy0tLS0tLS0tc21iZHQxMkFBQUFBR2p3c2MwTlFsa2dBEglOWDEzNXxOWDYaCwjTtQEQAhoDVVNEOB1w07UB"
          }
        ],
        "price_insights": {
          "lowest_price": 233,
          "price_level": "high"
        },
        "airports": [
          {
            "departure": [
              {
                "airport": {
                  "id": "PVG",
                  "name": "Shanghai Pudong International Airport"
                },
                "city": "Shanghai",
                "country": "China",
                "country_code": "CN",
                "image": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTujsAS0i3-zbeimLQQ8RJnTX80xFZm7VnTsswhTD6W1aHQZWxzA7pNb0BMAVpelCNQq3SEx1592gylHw",
                "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSf_rHrecM1vgBbijdc3hHmMhc7Ur5d25JUiJtkb1TFjyb8o00dh6hVYtkXSkreGSokUxE8IQygysyFoMm4DaloR8oEdOOr1fKHxMByxDQ"
              }
            ]
          }
        ]
    },
    "msg": "string",
    "reqId": "string"
}

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