Google Flights API

Using Google Flights API you can scrape Google Hotels result without worrying about proxy rotation and data parsing. Our API is fast and reliable. Each successful request will cost you 5 API credits.

You have to send a GET request to http://api.scrapingdog.com/google_flights with the below-given parameters.

Parameters

Scrapingdog Parameters

Parameter
Description

api_key required

This is your API key.

html

This will return the full HTML of the Google page. Default Value - false Type - Boolean

Search Query

Parameter
Description

departure_id

The parameter sets the departure point using either an airport code or a location kgmid.

An airport code is a 3-letter uppercase identifier. You can find these on Google Flights or via IATA. For example, JFK stands for John F. Kennedy International Airport, and LHR stands for London Heathrow Airport.

A location kgmid is a string that begins with /m/. You can search for a place on Wikidata and use its Freebase ID as the location kgmid. For example, /m/02_286 is the location kgmid for San Francisco, California.

You can enter multiple departure points by separating them with commas. For example: JFK,EWR,/m/0d6lp. Type - String

arrival_id

An airport code is a 3-letter uppercase identifier. You can look it up on Google Flights or through IATA. For example, JFK refers to John F. Kennedy International Airport, and LHR refers to London Heathrow Airport.

A location kgmid is a string that begins with /m/. You can search for a place on Wikidata and use its Freebase ID as the location kgmid. For example, /m/02_286 is the location kgmid for San Francisco, California.

You can also add multiple arrival points by separating them with commas. For example: JFK,EWR,/m/0d6lp. Type - String

Geographic Location and Localization

Parameter
Description

country

This parameter specifies the country for the Google search using a two-letter country code (e.g., US for the United States, UK for the United Kingdom, or FR for France). For a complete list of supported countries, visit the Google countries pagearrow-up-right. Default Value - us Type - String

language

Language of the results. Possible Values - en, es, fr, de, etc. Visit Google's languages pagearrow-up-right for a complete list of supported countries. Default Value - en Type - String

currency

This parameter sets the currency for the returned prices. The default is USD. Refer to the Google Flights Currencies page for the complete list of supported currency codes. Type - String

Advanced Google Flights Parameters

Parameter
Description

type

This parameter specifies the flight type.

Available values:

  • 1 — Round trip (default)

  • 2 — One way

  • 3 — Multi-city

If you set this parameter to 3, use multi_city_json to provide the flight details.

For Round Trip (1), you will need to make a separate request with a departure_token to retrieve the return flight details. Type - String

outbound_date

This parameter sets the outbound travel date. The value must be in YYYY-MM-DD format.

Example: 2026-03-05. Type - String

return_date

This parameter sets the return travel date. The value must be provided in YYYY-MM-DD format, for example: 2026-03-06.

Note: It is required when the type parameter is set to 1 (Round trip).

travel_class

This parameter specifies the travel class.

Available values:

  • 1 — Economy (default)

  • 2 — Premium economy

  • 3 — Business

  • 4 — First class

Type - String

multi_city_json

This parameter is used to provide flight details for multi-city trips. It should be passed as a JSON string containing an array of flight segment objects. Each object can include these fields:

  • departure_id — The departure airport code or location kgmid. It follows the same format as the main departure_id parameter.

  • arrival_id — The arrival airport code or location kgmid. It follows the same format as the main arrival_id parameter.

  • date — The travel date for that segment. It uses the same format as outbound_date.

  • times — The preferred time range for that segment. It uses the same format as outbound_times. This field is optional.

Example:

In this example, the itinerary includes:

  • a flight from JFK to LHR on 2026-04-10

  • a second flight from LHR to DXB or AUH on 2026-04-16

  • a final flight from DXB or AUH to SIN on 2026-04-22

For the last segment, the times value means:

  • departure time between 7:00 AM and 3:00 PM

  • arrival time between 10:00 AM and 8:00 PM

Type - JSON

Number of Passangers

Parameter
Description

adults

Number of adult passengers. Default: 1 Type - String

children

Number of child passengers. Default: 0 Type - String

infants_in_seat

Number of infants travelling in their own seat. Default: 0 Type - String

infants_on_lap

Number of infants traveling on an adult’s lap. Default: 0 Type - String

Sorting

Parameter
Description

sort_by

This parameter sets how the flight results are sorted.

Available values:

  • 1 — Top flights (default)

  • 2 — Price

  • 3 — Departure time

  • 4 — Arrival time

  • 5 — Duration

  • 6 — Emissions

Type - String

Advanced Filters

Parameter
Description

stops

This parameter specifies the maximum number of stops for the flight.

Available values:

  • 0 — Any number of stops (default)

  • 1 — Nonstop only

  • 2 — Up to 1 stop

  • 3 — Up to 2 stops

Type - String

exclude_airlines

This parameter lets you exclude specific airlines from the results. To exclude multiple airlines, separate their codes with commas.

It cannot be used together with include_airlines.

Each airline must be provided as a 2-character IATA code, made up of either:

  • two uppercase letters, or

  • one uppercase letter and one digit

You can look up airline codes through IATA. For example, UA stands for United Airlines.

You can also exclude entire airline alliances using these values:

  • STAR_ALLIANCE — Star Alliance

  • SKYTEAM — SkyTeam

  • ONEWORLD — Oneworld

Use either exclude_airlines or include_airlines, but not both in the same request. Type - String

include_airlines

This parameter lets you include only specific airlines in the results. To add multiple airlines, separate their codes with commas.

It cannot be used together with exclude_airlines.

Each airline must be provided as a 2-character IATA code, made up of either:

  • two uppercase letters, or

  • one uppercase letter and one digit

You can find airline codes through IATA. For example, DL stands for Delta Air Lines.

You can also include entire airline alliances using these values:

  • STAR_ALLIANCE — Star Alliance

  • SKYTEAM — SkyTeam

  • ONEWORLD — Oneworld

Type - String Note - exclude_airlines and include_airlines parameters can't be used together.

bags

This parameter sets the number of carry-on bags. The value cannot be greater than the total number of passengers eligible for a carry-on bag, which includes adults, children, and infants_in_seat.

Default: 0 Type - String

max_price

This parameter sets the maximum ticket price allowed in the results. By default, there is no price limit. Type - String

outbound_times

This parameter sets the preferred time range for the outbound flight. It should be provided as a comma-separated string containing either:

  • 2 numbers for a departure time range only, or

  • 4 numbers for both departure and arrival time ranges

Each number represents the start of an hour.

Examples:

  • 6,14 — departure between 6:00 AM and 3:00 PM

  • 1,16 — departure between 1:00 AM and 5:00 PM

  • 15,22 — departure between 3:00 PM and 11:00 PM

  • 6,14,9,18 — departure between 6:00 AM and 3:00 PM, arrival between 9:00 AM and 7:00 PM

  • 0,23,8,17 — no departure restriction, arrival between 8:00 AM and 6:00 PM

Type - String

return_times

This parameter sets the preferred time range for the return flight. It should be provided as a comma-separated string containing either:

  • 2 numbers for a departure time range only, or

  • 4 numbers for both departure and arrival time ranges

Each number represents the start of an hour.

Examples:

  • 5,13 — departure between 5:00 AM and 2:00 PM

  • 2,17 — departure between 2:00 AM and 6:00 PM

  • 16,21 — departure between 4:00 PM and 10:00 PM

  • 5,13,7,16 — departure between 5:00 AM and 2:00 PM, arrival between 7:00 AM and 5:00 PM

  • 0,23,10,19 — no departure restriction, arrival between 10:00 AM and 8:00 PM

Type - String Note: Use this parameter only when the type parameter is set to 1 (Round trip).

emissions

This parameter filters flights based on emission level.

Available value:

  • 1 — Show only flights with lower emissions

Type - String

layover_duration

This parameter sets the preferred layover duration in minutes. It should be provided as a string with two comma-separated numbers.

Example: 75,240 means a layover range of 1 hour 15 minutes to 4 hours. Type - String

exclude_conns

This parameter lets you exclude specific connecting airports from the results.

An airport ID is a 3-letter uppercase code. You can find it on Google Flights or through IATA.

Example: ORD stands for O’Hare International Airport, and SFO stands for San Francisco International Airport.

You can exclude multiple connecting airports by separating them with commas. For example: ORD,SFO. Type - String

max_duration

This parameter sets the maximum total flight duration in minutes.

Example: 960 means the flight duration can be up to 16 hours. Type - String

Next Flights

Parameter
Description

departure_token

This parameter is used to select a departure flight and retrieve the next set of results:

  • for Round trip, it returns the available return flights

  • for Multi-city, it returns flights for the next segment of the itinerary

You can find this token in the departure flight results. Type - String Note: This token cannot be used with booking token.

Booking Flights

Parameter
Description

booking_token

This parameter retrieves booking options for the selected flight. You can find the token in the flight results.

It cannot be used together with departure_token.

When this token is used, date-based parameters and any parameters listed under Advanced Filters are ignored. Type - String

API Example

With One Way Trip

Last updated