Choose flight itineraries that match the filter conditions.
flightFilter(x, max_price = Inf, max_duration = Inf, max_stops = Inf, layover = c(0, Inf), carrier_include = unique(x$carriers$Code), carrier_exclude = NULL, out_departure = c("00:00", "24:00"), out_arrival = c("00:00", "24:00"), in_departure = c("00:00", "24:00"), in_arrival = c("00:00", "24:00"))
x | A list of data.frame. |
---|---|
max_price | Maximum price. |
max_duration | Maximum duration in minutes, applied to both outbound and inbound legs. |
max_stops | Maximum number of stops, applied to both outbound and inbound legs. |
layover | Range of layover in minutes, applied to each stop. |
carrier_include | Include specified carriers, applied to both outbound and inbound legs. Must be IATA codes. |
carrier_exclude | Exclude specified carriers, applied to both outbound and inbound legs. Must be IATA codes. |
out_departure | Range of outbound departure time, |
out_arrival | Range of outbound arrival time, |
in_departure | Range of inbound departure time, |
in_arrival | Range of inbound arrival time, |
A tibble of flight itineraries.
# NOT RUN { apiSetKey("skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", "YOUR_API_KEY") resp <- apiCreateSession(origin = "SFO", destination = "LHR", startDate = "2019-07-01", returnDate = "2019-07-10") resp <- apiPollSession(resp) data <- flightGet(resp) flightFilter(data, max_price = 1000, max_duration = 60 * 24, max_stops = 2, layover = c(60, 240), carrier_include = c("UA", "AA", "DL", "CX", "NH"), carrier_exclude = c("MH", "KE")) # }