Flight Flex Search API

Guidance and examples for accessing the Flight Flex Search API

The Flight Flex Search API will return the lowest rates available for all dates within a +/- 3 day range of the requested dates.

Endpoint

MethodEndpoint
GEThttps://apim.expedia.com/flights/flexsearch

Required Headers

Key:Expedia API key
Authorization:Expedia API Authorization String
Accept:application/vnd.exp-flight.v3+json
Partner-Transaction-Id:Partner TransactionID String

Optional Headers

Accept-Encodinggzip

More info on gzip

Example of Flight Flex API Request

Request

https://apim.expedia.com/flights/flexsearch?segment1.origin=SEA&segment1.destination=LAS&segment1.departureDate=2021-09-03

Response

{
	"Offers": [{
			"DepartureDates": [
				"2021-09-30"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			}
		},
		{
			"DepartureDates": [
				"2021-09-01"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			}
		},
		{
			"DepartureDates": [
				"2021-09-02"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "95.39",
					"Currency": "USD"
				}
			}
		},
		{
			"DepartureDates": [
				"2021-09-03"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "95.39",
					"Currency": "USD"
				}
			}
		},
		{
			"DepartureDates": [
				"2021-09-04"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			}
		},
		{
			"DepartureDates": [
				"2021-09-05"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "105.39",
					"Currency": "USD"
				}
			}
		},
		{
			"DepartureDates": [
				"2021-09-06"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "95.39",
					"Currency": "USD"
				}
			}
		}
	],
	"TransactionId": "75989c80-7299-11ea-81fa-aad83eab0074"
}

One Way Flex Search with Segment Details

Request

https://apim.expedia.com/flights/flexsearch?segment1.origin=SEA&segment1.destination=LAS&segment1.departureDate=2021-09-03&includeSegmentDetails=true

Response

{
	"Offers": [{
			"DepartureDates": [
				"2021-09-30"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-30T19:30:00-08:00",
					"ArrivalDateTime": "2021-09-30T22:03:00-08:00",
					"FlightNumber": "1064",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H33M",
					"CabinClass": "ECONOMY"
				}]
			}]
		},
		{
			"DepartureDates": [
				"2021-09-01"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-01T11:40:00-08:00",
					"ArrivalDateTime": "2021-09-01T14:15:00-08:00",
					"FlightNumber": "1630",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H35M",
					"CabinClass": "ECONOMY"
				}]
			}]
		},
		{
			"DepartureDates": [
				"2021-09-02"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-02T19:30:00-08:00",
					"ArrivalDateTime": "2021-09-02T22:03:00-08:00",
					"FlightNumber": "1064",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H33M",
					"CabinClass": "ECONOMY"
				}]
			}]
		},
		{
			"DepartureDates": [
				"2021-09-03"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "105.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-03T19:30:00-08:00",
					"ArrivalDateTime": "2021-09-03T22:03:00-08:00",
					"FlightNumber": "1064",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H33M",
					"CabinClass": "ECONOMY"
				}]
			}]
		},
		{
			"DepartureDates": [
				"2021-09-04"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "100.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-04T15:50:00-08:00",
					"ArrivalDateTime": "2021-09-04T18:20:00-08:00",
					"FlightNumber": "688",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H30M",
					"CabinClass": "ECONOMY"
				}]
			}]
		},
		{
			"DepartureDates": [
				"2021-09-05"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "105.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-05T19:30:00-08:00",
					"ArrivalDateTime": "2021-09-05T22:03:00-08:00",
					"FlightNumber": "1064",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H33M",
					"CabinClass": "ECONOMY"
				}]
			}]
		},
		{
			"DepartureDates": [
				"2021-09-06"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "95.39",
					"Currency": "USD"
				}
			},
			"Segments": [{
				"DepartureArrivalDayDifference": 0,
				"AirportChange": false,
				"Legs": [{
					"DepartureAirport": {
						"Code": "SEA"
					},
					"ArrivalAirport": {
						"Code": "LAS"
					},
					"DepartureDateTime": "2021-09-06T06:10:00-08:00",
					"ArrivalDateTime": "2021-09-06T08:45:00-08:00",
					"FlightNumber": "1120",
					"MarketingAirlineCode": "AS",
					"FlightDuration": "PT2H35M",
					"CabinClass": "ECONOMY"
				}]
			}]
		}
	],
	"TransactionId": "ab1d4390-72aa-11ea-81fa-aad83eab0074"
}

Request

https://apim.expedia.com/flights/flexsearch?segment1.origin=SEA&segment1.destination=LAS&segment1.departureDate=2021-09-06&segment2.origin=LAS&segment2.destination=SEA&segment2.departureDate=2021-09-13

Response

{
    "Offers": [
        {
            "DepartureDates": [
                "2021-09-03",
                "2021-09-10"
            ],
            "OfferPrice": {
                "TotalPrice": {
                    "Value": "153.19",
                    "Currency": "USD"
                }
            }
        },
        {
            "DepartureDates": [
                "2021-09-03",
                "2021-09-11"
            ],
            "OfferPrice": {
                "TotalPrice": {
                    "Value": "153.19",
                    "Currency": "USD"
                }
            }
        }
        {
            "DepartureDates": [
                "2021-09-03",
                "2021-09-12"
            ],
            "OfferPrice": {
                "TotalPrice": {
                    "Value": "104.19",
                    "Currency": "USD"
                }
            }
        }
    ],
    "TransactionId": "826877c0-72ab-11ea-81fa-aad83eab0074"
}

Round Trip Flex Search with Segment Details

Request

https://apim.expedia.com/flights/flexsearch?segment1.origin=SEA&segment1.destination=LAS&segment1.departureDate=2021-09-06&segment2.origin=LAS&segment2.destination=SEA&segment2.departureDate=2021-09-13&includeSegmentDetails=true

Response

{
	"Offers": [{
			"DepartureDates": [
				"2021-09-03",
				"2021-09-10"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "153.19",
					"Currency": "USD"
				}
			},
			"Segments": [{
					"DepartureArrivalDayDifference": 0,
					"AirportChange": false,
					"Legs": [{
						"DepartureAirport": {
							"Code": "SEA"
						},
						"ArrivalAirport": {
							"Code": "LAS"
						},
						"DepartureDateTime": "2021-09-03T09:40:00-08:00",
						"ArrivalDateTime": "2021-09-03T12:06:00-08:00",
						"FlightNumber": "557",
						"MarketingAirlineCode": "DL",
						"FlightDuration": "PT2H26M",
						"CabinClass": "ECONOMY"
					}]
				},
				{
					"DepartureArrivalDayDifference": 0,
					"AirportChange": false,
					"Legs": [{
						"DepartureAirport": {
							"Code": "LAS"
						},
						"ArrivalAirport": {
							"Code": "SEA"
						},
						"DepartureDateTime": "2021-09-10T14:55:00-08:00",
						"ArrivalDateTime": "2021-09-10T17:30:00-08:00",
						"FlightNumber": "1694",
						"MarketingAirlineCode": "DL",
						"FlightDuration": "PT2H35M",
						"CabinClass": "ECONOMY"
					}]
				}
			]
		},
		{
			"DepartureDates": [
				"2021-09-03",
				"2021-09-11"
			],
			"OfferPrice": {
				"TotalPrice": {
					"Value": "153.19",
					"Currency": "USD"
				}
			},
			"Segments": [{
					"DepartureArrivalDayDifference": 0,
					"AirportChange": false,
					"Legs": [{
						"DepartureAirport": {
							"Code": "SEA"
						},
						"ArrivalAirport": {
							"Code": "LAS"
						},
						"DepartureDateTime": "2021-09-03T15:20:00-08:00",
						"ArrivalDateTime": "2021-09-03T17:41:00-08:00",
						"FlightNumber": "2793",
						"MarketingAirlineCode": "DL",
						"FlightDuration": "PT2H21M",
						"CabinClass": "ECONOMY"
					}]
				},
				{
					"DepartureArrivalDayDifference": 0,
					"AirportChange": false,
					"Legs": [{
						"DepartureAirport": {
							"Code": "LAS"
						},
						"ArrivalAirport": {
							"Code": "SEA"
						},
						"DepartureDateTime": "2021-09-11T07:45:00-08:00",
						"ArrivalDateTime": "2021-09-11T10:14:00-08:00",
						"FlightNumber": "2837",
						"MarketingAirlineCode": "DL",
						"FlightDuration": "PT2H29M",
						"CabinClass": "ECONOMY"
					}]
				}
			]
		}
	],
	"TransactionId": "2ab18d20-72a9-11ea-81fa-aad83eab0074"
}

Example with Disambiguation Error

Request

https://apim.expedia.com/flights/flexsearch?segment1.origin=Seattle&segment1.destination=France&segment1.departureDate=2021-09-03

Response

{
	"Errors": [{
		"Code": "AMBIGUOUS_LOCATION",
		"DetailCode": "MULTIPLE_AMBIGUOUS_LOCATION",
		"Description": "No or multiple available airport(s) was found which match your city name, please check the details."
	}],
	"LocationOptions": [{
		"RequestedLocation": "France",
		"Locations": [{
				"Type": "MULTICITY",
				"Id": "6139103",
				"Name": "Paris (PAR-All Airports)",
				"Code": "PAR",
				"Address": {
					"Address1": "Paris, France (PAR-All Airports)"
				},
				"GeoLocation": {
					"Latitude": "48.97388",
					"Longitude": "2.763012"
				},
				"Country": {
					"Name": "France",
					"Code": "FRA"
				}
			},
			{
				"Type": "AIRPORT",
				"Id": "4670531",
				"Name": "Paris (CDG-Roissy-Charles de Gaulle)",
				"Code": "CDG",
				"Address": {
					"Address1": "Paris, France (CDG-Roissy-Charles de Gaulle)"
				},
				"GeoLocation": {
					"Latitude": "49.004061",
					"Longitude": "2.571006"
				},
				"Country": {
					"Name": "France",
					"Code": "FRA"
				}
			},
	...
			{
				"Type": "AIRPORT",
				"Id": "6125067",
				"Name": "Paris (XDT-Charles de Gaulle Airport TGV Train Station)",
				"Code": "XDT",
				"Address": {
					"Address1": "Paris, France (XDT-Charles de Gaulle Airport TGV Train Station)"
				},
				"GeoLocation": {
					"Latitude": "49.00385",
					"Longitude": "2.571048"
				},
				"Country": {
					"Name": "France",
					"Code": "FRA"
				}
			}
		]
	}],
	"TransactionId": "3718f780-7298-11ea-81fa-aad83eab0074"
}

API details

Here, you can explore the endpoint definitions for this API, then go to the API Explorer to try out all the XAP endpoints, download OpenAPI specs, or download our Postman collections. Testing with one or all of these options will give you an understanding of how the examples and schema definitions compare to the actual output.


Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve!