Skip to main content
POST
Search flights between a known origin and destination for flexible dates
Find priced itineraries between a known origin and destination using cached results, ideal when the user is flexible on dates. It answers questions like β€œcheapest week to fly Paris to Barcelona in June” or β€œbest Friday to Sunday options from JFK to LAX next month”. Each itinerary carries its offer_token (also returned as id, a deprecated alias with the same value): pass it unchanged as offer_token to flight_search for live pricing. Add the selected live fare’s trip_item_token to a trip. Filters. Besides cabin_class and max_total (one adult’s fare), the request takes the filters a traveler usually states:
  • max_stops: 0 non-stop, 1 or 2 connections, per leg.
  • departure_time_range and arrival_time_range for the outbound leg, and return_departure_time_range and return_arrival_time_range for the return leg of a round trip. Each is a local HH:MM window at that airport and applies to every date searched.
  • include_carriers and exclude_carriers: on cached itineraries they match the ticketing airline.
  • origin_radius_km and destination_radius_km (at most 500): also search every airport within that distance of each code.
  • connection_time_min_minutes and connection_time_max_minutes: the shortest and longest layover, in minutes, at every connection of every leg; a non-stop leg passes. With either bound set, a page can hold fewer than limit itineraries even when more match, so keep reading with next_page_token; a non-zero offset is refused with 422.
max_stops 1 or 2, the time windows and destination_radius_km need at least one code in destinations. A search across every destination that sends one of them is refused with 422; max_stops: 0 is accepted there. A round trip from JFK or an airport within 100 km to Miami, at most one stop, leaving between 07:00 and 14:00, back home by 22:00, not on Spirit, at most 600 per adult:
Paging. A response holds up to limit itineraries (at most 100). When more match, it carries next_page_token: send the same request again with that value as page_token to read the next page, and stop when a response has no next_page_token. Each page starts right after the last itinerary of the previous one, so an itinerary that expires between two pages does not make you miss another. An itinerary whose price changes between two pages can appear on both or on neither, so deduplicate by offer_token. offset is deprecated on this route: when cached fares expire between two requests, a read paged with offset can skip itineraries.
Prices are in minor units. value is an integer β€” divide by 10 ** decimal_places to display it. { "value": 15977, "decimal_places": 2 } is $159.77, not $15,977. See Money & prices.

Authorizations

X-API-Key
string
header
required

Body

application/json
origins
string[]
required

IATA city or airport codes. See origin_type for how an untyped code is read.

Minimum array length: 1
Example:
trip_type
enum<string>
required
Available options:
oneway,
roundtrip
Example:

"roundtrip"

destinations
string[]

IATA city or airport codes. Omit for global discovery (find_destination) or to scan every destination from the origins. See destination_type for how an untyped code is read.

Example:
origin_type
enum<string>

How to read the code: city searches every airport of the city, airport only that one airport. Omit it and the platform applies one rule: a code that names a multi-airport city is searched as the city; every other code is searched as the airport. Untyped NYC, LON or PAR is the city; untyped JFK, LHR or CDG is the airport; and untyped LAX, MIA or LAS β€” codes a city shares with its main airport β€” is the CITY, so results can land at any airport of that city. If the user named the airport, send airport; if they named the city, omit the field.

Available options:
city,
airport
Example:

"city"

destination_type
enum<string>

How to read the code: city searches every airport of the city, airport only that one airport. Omit it and the platform applies one rule: a code that names a multi-airport city is searched as the city; every other code is searched as the airport. Untyped NYC, LON or PAR is the city; untyped JFK, LHR or CDG is the airport; and untyped LAX, MIA or LAS β€” codes a city shares with its main airport β€” is the CITY, so results can land at any airport of that city. If the user named the airport, send airport; if they named the city, omit the field.

Available options:
city,
airport
Example:

"city"

departure_dates
string[]
Pattern: ^\d{4}-\d{2}-\d{2}$
Example:
departure_date_ranges
object[]
return_dates
string[]
Pattern: ^\d{4}-\d{2}-\d{2}$
Example:
return_date_ranges
object[]
stay_days
integer
Required range: x > 0
Example:

7

stay_days_range
object
cabin_class
enum<string>
Available options:
economy,
premium_economy,
business,
first
Example:

"economy"

direct_only
boolean
deprecated

DEPRECATED β€” send max_stops: 0 instead. Still accepted as the same filter. Setting it beside a non-zero max_stops is rejected.

Example:

false

accuracy
enum<string>

How strict the freshness check on cached fares is. standard (default) returns fares estimated to be at least 80% likely to still be available at the cached price; high raises that to 95%, so fewer fares come back.

Available options:
standard,
high
Example:

"standard"

include_carriers
string[]

Keep only itineraries ticketed by these IATA carriers (the validating carrier, which issues the ticket). A codeshare segment marketed or operated by another airline does not change the match. Unlike POST /v1/flight_search, which matches the marketing carrier of every segment.

Pattern: ^[A-Za-z0-9]{2}$
Example:
exclude_carriers
string[]

Drop itineraries ticketed by these IATA carriers (the validating carrier). Must not overlap include_carriers.

Pattern: ^[A-Za-z0-9]{2}$
Example:
max_total
number

Caps the cached fare's total. Cached fares are priced for one adult.

Required range: x > 0
Example:

800

currency
string
Example:

"USD"

locale
string
Example:

"en-US"

limit
integer
default:20

What limit counts depends on the route; 1 to 100, default 20. On flight_calendar, the maximum number of itineraries returned across the entire matching date range after sort_by is applied. This is a global result cap, not one itinerary per date pair: with the default sort_by: lowest, limit: N returns the cheapest N itineraries overall, so some matching date pairs may be absent. On find_dates, the maximum number of date pairs, each answered with its cheapest itinerary and spread across the requested departure window.

Required range: 1 <= x <= 100
offset
integer
default:0
deprecated

Deprecated: page with page_token instead. Skips this many itineraries. When cached fares expire between two requests, every later itinerary moves up and the one at the page boundary is skipped, so a read paged with offset can miss itineraries. A non-zero offset cannot be combined with page_token, connection_time_min_minutes or connection_time_max_minutes.

Required range: x >= 0
sort_by
enum<string>
default:lowest

The order of the results. lowest, the only order today, is cheapest first by the cached one-adult total; on find_destination it orders destinations by their cheapest itinerary. Omit it for the same order.

Available options:
lowest
intent
object
max_stops
integer

Maximum stops per leg: 0 non-stop, 1 one connection, 2 two. Applies to every leg of the trip. 1 and 2 need at least one code in destinations.

Required range: 0 <= x <= 2
Example:

1

departure_time_range
object

Filter the OUTBOUND leg by its local departure time-of-day, on every date searched. Needs at least one code in destinations.

arrival_time_range
object

Filter the OUTBOUND leg by its local arrival time-of-day (at its last airport), on every date searched. Needs at least one code in destinations.

return_departure_time_range
object

Filter the RETURN leg by its local departure time-of-day (round trip only). Needs at least one code in destinations.

return_arrival_time_range
object

Filter the RETURN leg by its local arrival time-of-day (round trip only). Needs at least one code in destinations.

origin_radius_km
number

Also search every airport within this many kilometres (straight-line distance) of each origin code: an airport code is measured from that airport, a city code from the city. Widening only: the origins are always searched as well. Greater than 0, at most 500.

Required range: 0 < x <= 500
Example:

100

destination_radius_km
number

Also search every airport within this many kilometres of each destination code. Same rules as origin_radius_km; needs at least one code in destinations.

Required range: 0 < x <= 500
Example:

100

connection_time_min_minutes
integer

Shortest acceptable layover, in minutes, applied to every connection of every leg; a non-stop leg passes. Must not exceed connection_time_max_minutes. An itinerary whose connection times cannot be read is dropped. With either bound set, a response can hold fewer than limit itineraries even when more match.

Required range: x >= 0
Example:

60

connection_time_max_minutes
integer

Longest acceptable layover, in minutes, applied to every connection of every leg; a non-stop leg passes. Same rules as connection_time_min_minutes.

Required range: x >= 0
Example:

240

page_token
string

Reads the next page: the next_page_token of the previous response, sent with the same request (limit may change). The page starts right after the last itinerary of the previous page, so no itinerary is skipped when cached fares expire between pages. An itinerary whose price changes between two pages can appear on both or on neither, so deduplicate by offer_token. Keep reading until a response has no next_page_token.

Minimum string length: 1
Example:

"eyJzIjoiYyIsImYiOiI5YzFlNDIifQ"

Response

Matching itineraries

priced_for
enum<string>
required

Whose price the cached fares in this answer are: always one_adult. Every cached total is one adult's fare; this request takes no passenger counts. Price the whole party with POST /v1/flight_search.

Available options:
one_adult
Example:

"one_adult"

itineraries
object[]
required
next_page_token
string

flight_calendar only: present when more itineraries match. Send it as page_token with the same request to read the next page. Absent on the last page.

Example:

"eyJzIjoiYyIsImYiOiI5YzFlNDIifQ"