Class: Amadeus::Namespaces::Travel::Analytics::FareSearches

Inherits:
Client::Decorator
  • Object
show all
Defined in:
lib/amadeus/namespaces/travel/analytics/fare_searches.rb

Overview

A namespaced client for the /v1/travel/analytics/fare-searches endpoints

Access via the Amadeus::Client object

amadeus = Amadeus::Client.new
amadeus.travel.analytics.fare_searches

Instance Method Summary collapse

Instance Method Details

#get(params = {}) ⇒ Amadeus::Response

The Fare Search History API allows to find the number of estimated searches from an origin, optionally a destination, within a time period when travelers are performing the searches.

Examples:

Find the fare searches for LHR, made from France in 2011

amadeus.travel.analytics.fare_searches.get(
  origin: 'LHR',
  sourceCountry: 'FR'
  period: '2011'
)

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :origin (String)

    IATA code of the origin city e.g. BOS for Boston - required

  • :sourceCountry (String)

    IATA code of the country from which fare searches were made - e.g. US for United States

  • :period (String)

    period of search; can be a year or a month or a week. ISO format must be used - e.g. 2015 for year; 2015-05 for month and 2015-W04 for week. Period ranges are not supported. Only periods from year 2011-01 up to current year and previous month or week are valid. Future dates are not supported.

Returns:

Raises:

  • (Amadeus::Base)

    an exception if the call failed



39
40
41
# File 'lib/amadeus/namespaces/travel/analytics/fare_searches.rb', line 39

def get(params = {})
  client.get('/v1/travel/analytics/fare-searches', params)
end