Gets you information about flights from the skyscanner cache. It might be slightly outdated in comparison to live search, but more detailed and immediate. Make sure you have set API using apiSetKey before.

See https://rapidapi.com/skyscanner/api/skyscanner-flight-search.

apiBrowseFlight(endpoint = c("quotes", "routes", "dates"), origin,
  destination, startDate, returnDate = NULL, country = "US",
  currency = "USD", locale = "en-US")

Arguments

endpoint

Endpoint to choose. One of "quotes", "routes", "dates".

origin

(REQUIRED) The origin place, can be country, city, airport, in Skyscanner code.

destination

(REQUIRED) The destination, can be country, city, airport, in Skyscanner code.

startDate

(REQUIRED) The outbound date. Format "yyyy-mm-dd", "yyyy-mm" or "anytime".

returnDate

(OPTIONAL) The return date. Format "yyyy-mm-dd", "yyyy-mm" or "anytime". Use NULL for oneway trip.

country

(REQUIRED) The market country your user is in.

currency

(REQUIRED) The currency you want the prices in.

locale

(REQUIRED) The locale you want the results in (ISO locale).

Value

A response() object of request.

Details

The endpoint argument:

"quotes"

Returns the cheapest quotes that meet your query. The prices come from our cached prices resulting from our users' searches.

"routes"

Similar to Browse Quotes but with the quotes grouped by routes. This provides the cheapest destinations (countries, cities or airports) from our cached data.

"dates"

Similar to Browse Quotes but with the quotes grouped by outbound and inbound date. Useful to find the lowest price for a given route, over either a month or a 12 month period.

Examples

# NOT RUN {
apiSetKey("YOUR_API_KEY")
apiBrowseFlight("quotes", origin = "SFO", destination = "LHR", startDate = "2019-07-01")
apiBrowseFlight("routes", origin = "SFO", destination = "LHR", startDate = "2019-07-01")
apiBrowseFlight("dates", origin = "SFO", destination = "LHR", startDate = "2019-07-01")
# }