Flight Inspiration Search

GET

Flight Inspiration Search

The Inspiration Flight Search allows you to find the prices of one-way and return flights from an origin city without necessarily having a destination, or even a flight date, in mind. The search doesn't return a distinct set of price options, but rather, can tell you the price of flying from a given city to some destination, for a trip of a given duration, that falls within a given date range.

The search is based on our Extreme Search platform, which continually caches a large number of flight search results from a list of origin cities to a variety of destinations. Since it's a cached search, the response time is fast, but not all origin airports are available. Here is a list of the currently supported origin-destination IATA location pairs. We try to keep this list as fresh as possible for you, but be aware that it may not always be exactly up-to-date and it can change without warning.

Despite this limitation don't underestimate the power of this API. Thanks to its quick response speed you can easily pair it with other APIs to provide a low fare and inspiration for any destination. For example, you can could combine it with a event search API and suggest a total price to see go and see an concert or a game in a selection of cities.

Resource URL

https://api.sandbox.amadeus.com/v1.2 /flights/inspiration-search

Query Parameters


Name Values Description
apikey
(required)

API Key provided for your account, to identify you for API access. Make sure to keep this API key secret.

origin
(required)

IATA code of the city from which the traveler will depart. See the location and airport interfaces for more information.

destination

IATA code of the city to which the traveler is going

departure_date

Range of dates between which the traveler could depart. Dates are specified in the ISO 8601 yyyy-MM-dd date format. Ranges are inclusive and ranges of months will apply from the start to the end of the month. If just a single date is specified, only that date will be searched. By default, the date range starts today and applies up to 361 in the future is applied. Past dates are generally not supported, future dates should be in the next 361 days, although results start to become sparse after about 6 months in the future, as airlines may still be defining their schedules. The default is to search all future dates available.

one-way

When set to true, the query will be for a single trip from the origin to the destination. When this parameter is not provided, or is set to false, the query is for a round trip from the origin to the destination and back again.

duration

The allowed duration or range of durations of the trip, in days. This parameter must not be set if the one-way parameter is set to true.

direct

Limit the search to results that do not require the passenger to change plane?

max_price

Maximum price of trips to find in the result set, in the currency specified for this origin and destination pair in the cache contents spreadsheet. So, for example, if the origin is NYC, and the max price is 400, this means 400 USD. If the origin is PAR, and the max price is 400, this means 400 EUR. By default, no limit is applied

aggregation_mode

Specifies the granularity of results to be found. DESTINATION is the default and finds one result per city. COUNTRY finds one result per country, DAY finds on result for every day in the date range, WEEK finds one result for every week in the date range. Note that specifying a small granularity but a large search scope may result in a huge output. For some very large outputs, the API may refuse to provide a result.


Request Body

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Working...

 

Response format - Flight Inspiration Search

The successful (HTTP 200) response is returned as a JSON object, filled with certain piece of data. The exact format of the output will depend on the aggregation_mode provided.

Element Meaning Multiplicity
Root object
origin The IATA code of the city from which all proposed price results depart 1
currency The ISO 4217 currency code that will be used for all prices in this response 1
results An array of result objects, each summarizing an itinerary from the above origin to a potential destination for the traveler 0..n
Result object
destination The IATA code of the city or airport to which the traveler may go, from the provided origin 1
departure_date The date departure at the origin, in ISO 8601 date format yyyy-MM-dd, to go to the above destination 1
return_date The date at which the flight from the destination to the origin will arrive at the origin. The date is in ISO 8601 date format yyyy-MM-dd, in the local date of the origin 1
price The minimum total price for one adult passenger for a round trip from the origin to the destination and back. Always a string, formatted correctly for the provided currency 1
airline The 2 character alphanumeric IATA airline code of the airline that is responsible for selling the traveler this flight - also known as the Validating Carrier. See the airlines API for more information 1

 

 

Example: Get me out of Boston for a week!

 

Request

Find me all the places I can go to from Boston for $500 or less, for a trip lasting 7-9 days, departing some time between September 6 and 26

http://api.sandbox.amadeus.com/v1.2/flights/inspiration-search?origin=BOS&departure_date=2015-09-06--2015-09-26&duration=7--9&max_price=500&apikey=<your API key>

Sample Response (actual response was much longer!)

{
	"origin": "BOS",
	"currency": "USD",
	"results": [
		{
			"destination": "RIC",
			"departure_date": "2015-09-09",
			"return_date": "2015-09-16",
			"price": "83.95",
			"airline": "B6"
		}, {
			"destination": "SNA",
			"departure_date": "2015-09-23",
			"return_date": "2015-09-30",
			"price": "368.70",
			"airline": "UA"
		}, {
			"destination": "PAP",
			"departure_date": "2015-09-10",
			"return_date": "2015-09-17",
			"price": "371.46",
			"airline": "NK"
		}
	]
}

Following up an Inspiration search

Now that your users have got a destination and date in mind, a good next step is to do a lowfare search. You can formulate a low-fare search from your inspiration search like this:

http://api.sandbox.amadeus.com/v1.2/flights/low-fare-search?origin=<origin>&destination=<destination>&departure_date=<departure_date>&return_by=<return_date>T23:59&apikey=<your API key>

 

If you wish to display ONLY the itinerary for the low price quoted by the inspiration search, you should also include the airline provided, and set the number_of_results to 1. If you set the max_price, you can also identify whether that low price is still available - but be aware that this may sometimes return no result, as the inspiration search is cached hourly, so occasionally the quoted price may no longer exist.

Alternatively, you might want to present a graph of prices to go to that destination on a given date range, in which case you could do an extensive search like this:

http://api.sandbox.amadeus.com/v1.2/flights/extensive-search?origin=<origin>&departure_date=<date_range_start--date_range_end>&duration=<min_duration--max_duration>&apikey=<your API key>