Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python module for the Amadeus travel APIs

Project description

Module Version Build Status Maintainability Dependencies Contact Support Discord

Amadeus provides a rich set of APIs for the travel industry. For more details, check out the Amadeus for Developers Portal or the SDK class reference.


This SDK requires Python 2.7+ or 3.4+. You can install it directly with pip:

pip install amadeus

OR, add it to your requirements.txt file and install using:

pip install -r requirements.txt

Getting Started

To make your first API call, you will need to register for an Amadeus Developer Account and set up your first application.

from amadeus import Client, ResponseError

amadeus = Client(

    response =
except ResponseError as error:


You can find all the endpoints in self-contained code examples.


The client can be initialized directly.

# Initialize using parameters
amadeus = Client(client_id='REPLACE_BY_YOUR_API_KEY', client_secret='REPLACE_BY_YOUR_API_SECRET')

Alternatively, it can be initialized without any parameters if the environment variables AMADEUS_CLIENT_ID and AMADEUS_CLIENT_SECRET are present.

amadeus = Client()

Your credentials can be found on the Amadeus dashboard.

By default, the SDK environment is set to test environment. To switch to a production (pay-as-you-go) environment, please switch the hostname as follows:

amadeus = Client(hostname='production')


Amadeus has a large set of APIs, and our documentation is here to get you started today. Head over to our reference documentation for in-depth information about every SDK method, as well as its arguments and return types.

Making API calls

This library conveniently maps every API path to a similar path.

For example, GET /v2/reference-data/urls/checkin-links?airlineCode=BA would be:


Similarly, to select a resource by ID, you can pass in the ID to the singular path.

For example, GET /v2/shopping/hotel-offers/XZY would be:'XYZ').get()

You can make any arbitrary API call directly with the .get method as well:

amadeus.get('/v2/reference-data/urls/checkin-links', airlineCode='BA')

Or, with POST method:'/v1/shopping/flight-offers/pricing', body)


Every API call returns a Response object. If the API call contained a JSON response it will parse the JSON into the .result attribute. If this data also contains a data key, it will make that available as the .data attribute. The raw body of the response is always available as the .body attribute.

from amadeus import Location

response = amadeus.reference_data.locations.get(

print(response.body) #=> The raw response, as a string
print(response.result) #=> The body parsed as JSON, if the result was parsable
print( #=> The list of locations, extracted from the JSON

Logging & Debugging

The SDK makes it easy to add your own logger.

import logging

logger = logging.getLogger('your_logger')

amadeus = Client(

Additionally, to enable more verbose logging, you can set the appropriate level on your own logger. The easiest way would be to enable debugging via a parameter during initialization, or using the AMADEUS_LOG_LEVEL environment variable.

amadeus = Client(

List of supported endpoints

# Flight Inspiration Search'MAD')

# Flight Cheapest Date Search'MAD', destination='MUC')

# Flight Offers Search GET'SYD', destinationLocationCode='BKK', departureDate='2020-07-01', adults=1)
# Flight Offers Search POST

# Flight Offers Price
flights ='SYD', destinationLocationCode='BKK', departureDate='2020-07-01', adults=1).data[0])[0:2], include='credit-card-fees,other-services')

# Flight Create Orders[0], traveler)

# Flight Order Management
# The flight ID comes from the Flight Create Orders (in test environment it's temporary)
# Retrieve the order based on it's ID
flight_booking =['id']).get()
# Delete the order based on it's ID['id']).delete()

# Flight SeatMap Display GET**{"flight-orderId": "orderid"})
# Flight SeatMap Display POST

# Flight Choice Prediction
body =

# Flight Checkin Links

# Airline Code Lookup

# Airport and City Search (autocomplete)
# Find all the cities and airports starting by 'LON'
amadeus.reference_data.locations.get(keyword='LON', subType=Location.ANY)
# Get a specific city or airport based on its id

# Airport Nearest Relevant Airport (for London)
amadeus.reference_data.locations.airports.get(longitude=0.1278, latitude=51.5074)

# Flight Most Booked Destinations'MAD', period='2017-08')

# Flight Most Traveled Destinations'MAD', period='2017-01')

# Flight Busiest Travel Period'MAD', period='2017', direction='ARRIVING')

# Hotel Search
# Get list of Hotels by city code = 'LON')
# Get list of offers for a specific hotel = 'BGLONBGB')
# Confirm the availability of a specific offer
offerId ='8123DD9DE5102DADF5DA3B55C8C575F54114336EE718578753888747FE0652FC').get()

# Hotel Booking
# The offerId comes from the hotel_offer above, guests, payments)

# Hotel Ratings
# What travelers think about this hotel?
amadeus.e_reputation.hotel_sentiments.get(hotelIds = 'ADNYCCTB')

# Points of Interest
# What are the popular places in Barcelona (based a geo location and a radius)
amadeus.reference_data.locations.points_of_interest.get(latitude=41.397158, longitude=2.160873)
# What are the popular places in Barcelona? (based on a square)
amadeus.reference_data.locations.points_of_interest.by_square.get(north=41.397158, west=2.160873,
                                                                  south=41.394582, east=2.177181)
# Returns a single Point of Interest from a given id

# Safe Place
# How safe is Barcelona? (based a geo location and a radius), longitude=2.160873)
# How safe is Barcelona? (based on a square), west=2.160873,
                                                    south=41.394582, east=2.177181)
# What is the safety information of a location based on it's Id?'Q930400801').get()

# Trip Purpose Prediction'ATH', destinationLocationCode='MAD', departureDate='2020-08-01', returnDate='2020-08-12', searchDate='2020-06-11')

# Flight Delay Prediction'NCE', destinationLocationCode='IST', departureDate='2020-08-01', \
departureTime='18:20:00', arrivalDate='2020-08-01', arrivalTime='22:15:00', aircraftCode='321', carrierCode='TK', flightNumber='1816', duration='PT31H10M')

# Airport On-Time Performance
amadeus.airport.predictions.on_time.get(airportCode='JFK', date='2020-09-01')

# AI Generated Photos'MOUNTAIN')

# Trip Parser
# Encode to Base64 your booking confirmation file (.html, .eml, .pdf supported)
response =
# Alternatively you can use a Base64 encoded content directly
response =
# Or you can call the API with the JSON directly
response =
# Get the parsing status of the process by jobId['id']).get()
# Get the result of the process by jobId['id']).get()

# Travel Recommendations
amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR')

# Retrieve status of a given flight'AZ', flightNumber='319', scheduledDepartureDate='2021-03-13')

# Tours and Activities
# What are the popular activities in Madrid (based a geo location and a radius), longitude=-3.69170868)
# What are the popular activities in Barcelona? (based on a square), west=2.160873,
                                          south=41.394582, east=2.177181)
# Returns a single activity from a given id'4615').get()

Development & Contributing

Want to contribute? Read our Contributors Guide for guidance on installing and running this code in a development environment.


This library is released under the MIT License.


Our developer support team is here to help you. You can also find us on StackOverflow, or email directly.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for amadeus, version 4.4.0
Filename, size File type Python version Upload date Hashes
Filename, size amadeus-4.4.0-py2.py3-none-any.whl (64.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size amadeus-4.4.0.tar.gz (32.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page