### Install Amadeus Python SDK Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Install the Amadeus Python SDK using pip. This can be done directly or by referencing a requirements.txt file. ```sh pip install amadeus ``` ```sh pip install -r requirements.txt ``` -------------------------------- ### Make a GET API Call Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Example of making a GET request to the checkin-links endpoint using the SDK's path mapping. ```py amadeus.reference_data.urls.checkin_links.get(airlineCode='BA') ``` -------------------------------- ### Make an Arbitrary GET API Call Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Make any arbitrary GET API call directly using the .get method with the full path and parameters. ```py amadeus.get('/v2/reference-data/urls/checkin-links', airlineCode='BA') ``` -------------------------------- ### Flight Offers Search (GET and POST) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for flight offers using both GET and POST methods. The POST method requires a request body. ```python # Flight Offers Search GET amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2022-11-01', adults=1) ``` ```python # Flight Offers Search POST amadeus.shopping.flight_offers_search.post(body) ``` -------------------------------- ### Add Custom Logger Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Example of how to integrate a custom logger with the Amadeus Python SDK. ```py import logging ``` -------------------------------- ### Hotel List (by Hotel IDs) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Gets a list of hotels by their IDs. ```APIDOC ## GET /reference/locations/hotels/by-hotels ### Description Gets a list of hotels by their IDs. ### Method GET ### Endpoint /v1/reference/locations/hotels/by-hotels ### Parameters #### Query Parameters - **hotelIds** (string) - Required - Comma-separated list of hotel IDs. ### Request Example ```python amadeus.reference_data.locations.hotels.by_hotels.get(hotelIds='ADPAR001') ``` ``` -------------------------------- ### City Search GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for cities based on a keyword. ```python # City Search amadeus.reference_data.locations.cities.get(keyword='PAR') ``` -------------------------------- ### Select a Resource by ID Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Example of selecting a specific hotel offer by its ID using the SDK's singular path mapping. ```py amadeus.shopping.hotel_offer('XYZ').get() ``` -------------------------------- ### Hotel List (by City Code) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Gets a list of hotels in a specific city. ```APIDOC ## GET /reference/locations/hotels/by-city ### Description Gets a list of hotels in a specific city. ### Method GET ### Endpoint /v1/reference/locations/hotels/by-city ### Parameters #### Query Parameters - **cityCode** (string) - Required - The city code. ### Request Example ```python amadeus.reference_data.locations.hotels.by_city.get(cityCode='PAR') ``` ``` -------------------------------- ### Hotel Search v3 (List Offers) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Gets a list of available hotel offers by hotel IDs. ```APIDOC ## GET /shopping/hotel-offers-search ### Description Gets a list of available hotel offers by hotel IDs. ### Method GET ### Endpoint /v3/shopping/hotel-offers-search ### Parameters #### Query Parameters - **hotelIds** (string) - Required - Comma-separated list of hotel IDs. - **adults** (string) - Required - The number of adults. ### Request Example ```python amadeus.shopping.hotel_offers_search.get(hotelIds='RTPAR001', adults='2') ``` ``` -------------------------------- ### Flight Checkin Links GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves check-in links for a given airline code. ```python # Flight Checkin Links amadeus.reference_data.urls.checkin_links.get(airlineCode='BA') ``` -------------------------------- ### Get Itinerary Price Metrics Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieve price metrics for a given itinerary defined by origin, destination, and departure date. ```python amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD', destinationIataCode='CDG', departureDate='2021-03-21') ``` -------------------------------- ### Get Airline Destinations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Find all destinations served by a specific airline. ```python amadeus.airline.destinations.get(airlineCode='BA') ``` -------------------------------- ### Get Recommended Locations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Find recommended travel locations based on city codes and traveler country. ```python amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR') ``` -------------------------------- ### Flight SeatMap Display (GET) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Displays flight seat maps. ```APIDOC ## GET /shopping/seatmaps ### Description Displays flight seat maps. ### Method GET ### Endpoint /v1/shopping/seatmaps ### Parameters #### Query Parameters - **flight-orderId** (string) - Required - The ID of the flight order. ### Request Example ```python amadeus.shopping.seatmaps.get(**{"flight-orderId": "orderid"}) ``` ``` -------------------------------- ### Flight Order Management (GET) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves a flight order by its ID. ```APIDOC ## GET /booking/flight-orders/{flight_id} ### Description Retrieves a flight order by its ID. ### Method GET ### Endpoint /v1/booking/flight-orders/{flight_id} ### Parameters #### Path Parameters - **flight_id** (string) - Required - The ID of the flight order. ### Request Example ```python # Assuming flight_booking is the result from Flight Create Orders amadeus.booking.flight_order(flight_booking['id']).get() ``` ``` -------------------------------- ### Flight SeatMap Display Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Displays flight seat maps using either GET or POST requests. The GET request requires a flight order ID. ```python # Flight SeatMap Display GET amadeus.shopping.seatmaps.get(**{"flight-orderId": "orderid"}) ``` ```python # Flight SeatMap Display POST amadeus.shopping.seatmaps.post(body) ``` -------------------------------- ### Get Single Activity by ID Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieve details for a specific activity using its unique ID. ```python amadeus.shopping.activity('4615').get() ``` -------------------------------- ### Hotel Name Autocomplete GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Provides hotel name autocomplete suggestions based on a keyword and sub-type filters. ```python # Hotel Name Autocomplete amadeus.reference_data.locations.hotel.get(keyword='PARI', subType=[Hotel.HOTEL_GDS, Hotel.HOTEL_LEISURE]) ``` -------------------------------- ### Flight Offers Search (GET) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for flight offers based on origin, destination, date, and number of adults. ```APIDOC ## GET /shopping/flight-offers-search ### Description Searches for flight offers based on specified criteria. ### Method GET ### Endpoint /v1/shopping/flight-offers-search ### Parameters #### Query Parameters - **originLocationCode** (string) - Required - The origin location code. - **destinationLocationCode** (string) - Required - The destination location code. - **departureDate** (string) - Required - The departure date in YYYY-MM-DD format. - **adults** (integer) - Required - The number of adults. ### Request Example ```python amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2022-11-01', adults=1) ``` ``` -------------------------------- ### Get Airport Direct Destinations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Find all direct destinations from a specified departure airport. ```python amadeus.airport.direct_destinations.get(departureAirportCode='BLR') ``` -------------------------------- ### Get Popular Activities by Location Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Find popular activities in a given geographical area using latitude and longitude. ```python amadeus.shopping.activities.get(latitude=40.41436995, longitude=-3.69170868) ``` -------------------------------- ### Get Hotel Ratings Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieve traveler opinions for a specific hotel using its ID. ```python amadeus.e_reputation.hotel_sentiments.get(hotelIds = 'ADNYCCTB') ``` -------------------------------- ### Hotel List (by Geocode) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Gets a list of hotels near a specific geographic coordinate. ```APIDOC ## GET /reference/locations/hotels/by-geocode ### Description Gets a list of hotels near a specific geographic coordinate. ### Method GET ### Endpoint /v1/reference/locations/hotels/by-geocode ### Parameters #### Query Parameters - **longitude** (number) - Required - The longitude coordinate. - **latitude** (number) - Required - The latitude coordinate. ### Request Example ```python amadeus.reference_data.locations.hotels.by_geocode.get(longitude=2.160873, latitude=41.397158) ``` ``` -------------------------------- ### Airline Code Lookup GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Looks up airline information using one or more airline codes. ```python # Airline Code Lookup amadeus.reference_data.airlines.get(airlineCodes='U2') ``` -------------------------------- ### Get Airport On-Time Performance Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieve the on-time performance data for a specific airport on a given date. ```python amadeus.airport.predictions.on_time.get(airportCode='JFK', date='2022-11-01') ``` -------------------------------- ### Flight Most Booked Destinations GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves a list of the most booked flight destinations from a specified origin city for a given period. ```python # Flight Most Booked Destinations amadeus.travel.analytics.air_traffic.booked.get(originCityCode='MAD', period='2017-08') ``` -------------------------------- ### Get Popular Activities by Square Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Find popular activities within a specified geographical square defined by north, west, south, and east coordinates. ```python amadeus.shopping.activities.by_square.get(north=41.397158, west=2.160873, south=41.394582, east=2.177181) ``` -------------------------------- ### Retrieve Flight Status Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Get the status of a specific flight identified by carrier code, flight number, and scheduled departure date. ```python amadeus.schedule.flights.get(carrierCode='AZ', flightNumber='319', scheduledDepartureDate='2022-09-13') ``` -------------------------------- ### Flight Busiest Travel Period GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Identifies the busiest travel period for a city, specifying arrival or departure direction. ```python # Flight Busiest Travel Period amadeus.travel.analytics.air_traffic.busiest_period.get(cityCode='MAD', period='2017', direction='ARRIVING') ``` -------------------------------- ### Flight Most Traveled Destinations GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves a list of the most traveled flight destinations from a specified origin city for a given period. ```python # Flight Most Traveled Destinations amadeus.travel.analytics.air_traffic.traveled.get(originCityCode='MAD', period='2017-01') ``` -------------------------------- ### Airport Nearest Relevant Airport GET Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds the nearest relevant airport to a given set of coordinates (longitude and latitude). ```python # Airport Nearest Relevant Airport (for London) amadeus.reference_data.locations.airports.get(longitude=0.1278, latitude=51.5074) ``` -------------------------------- ### Initialize Amadeus Client for Production Environment Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Initialize the Amadeus client for the production environment by specifying the 'production' hostname. ```py amadeus = Client(hostname='production') ``` -------------------------------- ### Initialize Amadeus Client with API Keys Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Initialize the Amadeus client with your API key and secret. Ensure you replace the placeholder values with your actual credentials. ```py from amadeus import Client, ResponseError amadeus = Client( client_id='REPLACE_BY_YOUR_API_KEY', client_secret='REPLACE_BY_YOUR_API_SECRET' ) try: response = amadeus.shopping.flight_offers_search.get( originLocationCode='MAD', destinationLocationCode='ATH', departureDate='2024-11-01', adults=1) print(response.data) except ResponseError as error: print(error) ``` -------------------------------- ### Initialize Amadeus Client with Environment Variables Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Initialize the Amadeus client without parameters if the AMADEUS_CLIENT_ID and AMADEUS_CLIENT_SECRET environment variables are set. ```py amadeus = Client() ``` -------------------------------- ### Initialize Amadeus Client with Logger Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Initializes the Amadeus client with a custom logger for detailed logging. Ensure the logger level is set appropriately. ```python import logging logger = logging.getLogger('your_logger') logger.setLevel(logging.DEBUG) amadeus = Client( client_id='REPLACE_BY_YOUR_API_KEY', client_secret='REPLACE_BY_YOUR_API_SECRET', logger=logger ) ``` -------------------------------- ### Initialize Amadeus Client with Log Level Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Initializes the Amadeus client with a specified log level for verbose logging. This can also be controlled via the AMADEUS_LOG_LEVEL environment variable. ```python amadeus = Client( client_id='REPLACE_BY_YOUR_API_KEY', client_secret='REPLACE_BY_YOUR_API_SECRET', log_level='debug' ) ``` -------------------------------- ### Handle Pagination Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Shows how to retrieve subsequent pages of results using the .next method on a response object. Returns None if no next page is available. ```py from amadeus import Location response = amadeus.reference_data.locations.get( keyword='LON', subType=Location.ANY ) amadeus.next(response) #=> returns a new response for the next page ``` -------------------------------- ### Flight Create Orders Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Creates a flight order based on a selected flight offer and traveler information. ```python # Flight Create Orders amadeus.booking.flight_orders.post(flights[0], traveler) ``` -------------------------------- ### Hotel Booking v1 Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Creates a hotel booking using v1 of the API. ```APIDOC ## POST /booking/hotel-bookings ### Description Creates a hotel booking using v1 of the API. ### Method POST ### Endpoint /v1/booking/hotel-bookings ### Parameters #### Request Body - **offerId** (string) - Required - The offer ID from a hotel offer search. - **guests** (object) - Required - Guest information. - **payments** (object) - Required - Payment information. ### Request Example ```python amadeus.booking.hotel_bookings.post(offerId, guests, payments) ``` ``` -------------------------------- ### Hotel Booking v2 Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Creates a hotel booking using v2 of the API. ```APIDOC ## POST /booking/hotel-orders ### Description Creates a hotel booking using v2 of the API. ### Method POST ### Endpoint /v2/booking/hotel-orders ### Parameters #### Request Body - **guests** (object) - Required - Guest information. - **travel_agent** (object) - Required - Travel agent information. - **room_associations** (object) - Required - Room association details. - **payment** (object) - Required - Payment information. ### Request Example ```python amadeus.booking.hotel_orders.post( guests=guests, travel_agent=travel_agent, room_associations=room_associations, payment=payment) ``` ``` -------------------------------- ### Hotel Booking v1 POST Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Books a hotel using version 1 of the API. Requires offer ID, guest, and payment details. ```python # Hotel Booking v1 # The offerId comes from the hotel_offer above amadeus.booking.hotel_bookings.post(offerId, guests, payments) ``` -------------------------------- ### Flight Create Orders Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Creates a flight order. ```APIDOC ## POST /booking/flight-orders ### Description Creates a flight order. ### Method POST ### Endpoint /v1/booking/flight-orders ### Parameters #### Request Body - **body** (object) - Required - The flight offer to book. - **traveler** (object) - Required - Traveler information. ### Request Example ```python amadeus.booking.flight_orders.post(flights[0], traveler) ``` ``` -------------------------------- ### Itinerary Price Metrics Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Returns itinerary price metrics for a given origin, destination, and date. ```APIDOC ## GET /v1/analytics/itinerary-price-metrics ### Description Returns itinerary price metrics for a given origin, destination, and date. ### Method GET ### Endpoint /v1/analytics/itinerary-price-metrics ### Parameters #### Query Parameters - **originIataCode** (string) - Required - The IATA code of the origin airport. - **destinationIataCode** (string) - Required - The IATA code of the destination airport. - **departureDate** (string) - Required - The departure date in YYYY-MM-DD format. ### Request Example ```python amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD', destinationIataCode='CDG', departureDate='2021-03-21') ``` ``` -------------------------------- ### Flight Offers Pricing Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Prices flight offers. This can be done for a single offer or multiple offers, with options to include additional fees. ```python # Flight Offers Price flights = amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2022-11-01', adults=1).data amadeus.shopping.flight_offers.pricing.post(flights[0]) ``` ```python amadeus.shopping.flight_offers.pricing.post(flights[0:2], include='credit-card-fees,other-services') ``` -------------------------------- ### Hotel Booking v2 POST Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Books a hotel using version 2 of the API. Requires guest, travel agent, room associations, and payment details. ```python # Hotel Booking v2 # The offerId comes from the hotel_offer above amadeus.booking.hotel_orders.post( guests=guests, travel_agent=travel_agent, room_associations=room_associations, payment=payment) ``` -------------------------------- ### Make an Arbitrary POST API Call Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Make any arbitrary POST API call directly using the .post method with the full path and a request body. ```py amadeus.post('/v1/shopping/flight-offers/pricing', body) ``` -------------------------------- ### Search Transfer Offers Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Search for available transfer offers by posting request body. ```python amadeus.shopping.transfer_offers.post(body) ``` -------------------------------- ### Flight Availabilities POST Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for flight availabilities using a POST request with a specified body. ```python # Flight Availabilities POST amadeus.shopping.availability.flight_availabilities.post(body) ``` -------------------------------- ### Hotel List Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves lists of hotels based on hotel IDs, city codes, or geographic coordinates. ```python # Hotel List # Get list of hotels by hotel id amadeus.reference_data.locations.hotels.by_hotels.get(hotelIds='ADPAR001') ``` ```python # Get list of hotels by city code amadeus.reference_data.locations.hotels.by_city.get(cityCode='PAR') ``` ```python # Get list of hotels by a geocode amadeus.reference_data.locations.hotels.by_geocode.get(longitude=2.160873,latitude=41.397158) ``` -------------------------------- ### Flight Offers Search (POST) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for flight offers using a POST request with a request body. ```APIDOC ## POST /shopping/flight-offers-search ### Description Searches for flight offers using a POST request with a request body. ### Method POST ### Endpoint /v1/shopping/flight-offers-search ### Parameters #### Request Body - **body** (object) - Required - The request body containing search criteria. ### Request Example ```python amadeus.shopping.flight_offers_search.post(body) ``` ``` -------------------------------- ### Hotel Search v3 (Offer Conditions) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Checks the conditions of a specific hotel offer. ```APIDOC ## GET /shopping/hotel-offers-search/{offer_id} ### Description Checks the conditions of a specific hotel offer. ### Method GET ### Endpoint /v3/shopping/hotel-offers-search/{offer_id} ### Parameters #### Path Parameters - **offer_id** (string) - Required - The ID of the hotel offer. ### Request Example ```python amadeus.shopping.hotel_offer_search('XXX').get() ``` ``` -------------------------------- ### Flight Offers Pricing Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves pricing information for flight offers. ```APIDOC ## POST /shopping/flight-offers/pricing ### Description Retrieves pricing information for flight offers. ### Method POST ### Endpoint /v1/shopping/flight-offers/pricing ### Parameters #### Request Body - **body** (object or array) - Required - The flight offer(s) to price. - **include** (string) - Optional - Comma-separated list of additional services to include (e.g., 'credit-card-fees,other-services'). ### Request Example ```python # Pricing for a single flight offer amadeus.shopping.flight_offers.pricing.post(flights[0]) # Pricing for multiple flight offers with inclusions amadeus.shopping.flight_offers.pricing.post(flights[0:2], include='credit-card-fees,other-services') ``` ``` -------------------------------- ### Activities by Location Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds popular activities in a given geographical area. ```APIDOC ## GET /v1/shopping/activities ### Description Finds popular activities in a given geographical area. ### Method GET ### Endpoint /v1/shopping/activities ### Parameters #### Query Parameters - **latitude** (number) - Required - The latitude of the location. - **longitude** (number) - Required - The longitude of the location. ### Request Example ```python amadeus.shopping.activities.get(latitude=40.41436995, longitude=-3.69170868) ``` ``` -------------------------------- ### Flight Availabilities POST Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Checks flight availabilities using a POST request. ```APIDOC ## POST /shopping/availability/flight-availabilities ### Description Checks flight availabilities using a POST request. ### Method POST ### Endpoint /v1/shopping/availability/flight-availabilities ### Parameters #### Request Body - **body** (object) - Required - The request body containing availability search criteria. ### Request Example ```python amadeus.shopping.availability.flight_availabilities.post(body) ``` ``` -------------------------------- ### Single Activity Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves details for a single activity by its ID. ```APIDOC ## GET /v1/shopping/activities/{activity_id} ### Description Retrieves details for a single activity by its ID. ### Method GET ### Endpoint /v1/shopping/activities/{activity_id} ### Parameters #### Path Parameters - **activity_id** (string) - Required - The unique identifier of the activity. ### Request Example ```python amadeus.shopping.activity('4615').get() ``` ``` -------------------------------- ### Hotel Search v3 Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for hotel offers by hotel IDs or checks conditions of a specific offer. Requires adult count for offer search. ```python # Hotel Search v3 # Get list of available offers by hotel ids amadeus.shopping.hotel_offers_search.get(hotelIds='RTPAR001', adults='2') ``` ```python # Check conditions of a specific offer amadeus.shopping.hotel_offer_search('XXX').get() ``` -------------------------------- ### Flight Checkin Links Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves check-in links for a given airline. ```APIDOC ## GET /reference/urls/checkin-links ### Description Retrieves check-in links for a given airline. ### Method GET ### Endpoint /v1/reference/urls/checkin-links ### Parameters #### Query Parameters - **airlineCode** (string) - Required - The IATA airline code. ### Request Example ```python amadeus.reference_data.urls.checkin_links.get(airlineCode='BA') ``` ``` -------------------------------- ### Flight Cheapest Date Search Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds the cheapest dates for flights between two specified cities. ```python # Flight Cheapest Date Search amadeus.shopping.flight_dates.get(origin='MAD', destination='MUC') ``` -------------------------------- ### Accessing Response Data Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Demonstrates how to access different parts of the API response: the raw body, the parsed JSON result, and the extracted data attribute. ```py from amadeus import Location response = amadeus.reference_data.locations.get( keyword='LON', subType=Location.ANY ) print(response.body) #=> The raw response, as a string print(response.result) #=> The body parsed as JSON, if the result was parsable print(response.data) #=> The list of locations, extracted from the JSON ``` -------------------------------- ### Airport and City Search (autocomplete) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds cities and airports based on a keyword, with optional subtype filtering. ```APIDOC ## GET /reference/locations ### Description Finds cities and airports based on a keyword, with optional subtype filtering. ### Method GET ### Endpoint /v1/reference/locations ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to search for (e.g., city or airport name). - **subType** (string) - Optional - Filters results by type (e.g., Location.ANY, Location.CITY, Location.AIRPORT). ### Request Example ```python # Find all cities and airports starting by 'LON' amadeus.reference_data.locations.get(keyword='LON', subType=Location.ANY) ``` ``` -------------------------------- ### Recommended Locations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Provides travel recommendations for locations based on city codes and traveler country. ```APIDOC ## GET /v1/reference-data/recommended-locations ### Description Provides travel recommendations for locations based on city codes and traveler country. ### Method GET ### Endpoint /v1/reference-data/recommended-locations ### Parameters #### Query Parameters - **cityCodes** (string) - Required - Comma-separated list of city codes. - **travelerCountryCode** (string) - Required - The IATA code of the traveler's country. ### Request Example ```python amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR') ``` ``` -------------------------------- ### Activities by Square Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds popular activities within a specified geographical square. ```APIDOC ## GET /v1/shopping/activities/by-square ### Description Finds popular activities within a specified geographical square. ### Method GET ### Endpoint /v1/shopping/activities/by-square ### Parameters #### Query Parameters - **north** (number) - Required - The northern boundary of the square. - **west** (number) - Required - The western boundary of the square. - **south** (number) - Required - The southern boundary of the square. - **east** (number) - Required - The eastern boundary of the square. ### Request Example ```python amadeus.shopping.activities.by_square.get(north=41.397158, west=2.160873, south=41.394582, east=2.177181) ``` ``` -------------------------------- ### Airport and City Search (Autocomplete and Specific) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for airports and cities using keyword autocomplete or by specific ID. The `subType` parameter can filter results. ```python # Airport and City Search (autocomplete) # Find all the cities and airports starting by 'LON' amadeus.reference_data.locations.get(keyword='LON', subType=Location.ANY) ``` ```python # Get a specific city or airport based on its id amadeus.reference_data.location('ALHR').get() ``` -------------------------------- ### Location Details Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves details for a specific city or airport using its ID. ```APIDOC ## GET /reference/locations/{location_id} ### Description Retrieves details for a specific city or airport using its ID. ### Method GET ### Endpoint /v1/reference/locations/{location_id} ### Parameters #### Path Parameters - **location_id** (string) - Required - The ID of the location. ### Request Example ```python amadeus.reference_data.location('ALHR').get() ``` ``` -------------------------------- ### Transfer Booking Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Books a selected transfer offer. ```APIDOC ## POST /v1/ordering/transfer-orders ### Description Books a selected transfer offer. ### Method POST ### Endpoint /v1/ordering/transfer-orders ### Parameters #### Query Parameters - **offerId** (string) - Required - The ID of the transfer offer to book. #### Request Body - **body** (object) - Required - The request body containing booking details. ### Request Example ```python amadeus.ordering.transfer_orders.post(body, offerId='1000000000') ``` ``` -------------------------------- ### Flight Cheapest Date Search Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds the cheapest dates for flights between an origin and destination. ```APIDOC ## GET /shopping/flight-dates ### Description Finds the cheapest dates for flights between an origin and destination. ### Method GET ### Endpoint /v1/shopping/flight-dates ### Parameters #### Query Parameters - **origin** (string) - Required - The origin city code. - **destination** (string) - Required - The destination city code. ### Request Example ```python amadeus.shopping.flight_dates.get(origin='MAD', destination='MUC') ``` ``` -------------------------------- ### Flight Inspiration Search Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for flight destinations based on an origin city. ```python # Flight Inspiration Search amadeus.shopping.flight_destinations.get(origin='MAD') ``` -------------------------------- ### Flight SeatMap Display (POST) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Displays flight seat maps using a POST request with a request body. ```APIDOC ## POST /shopping/seatmaps ### Description Displays flight seat maps using a POST request with a request body. ### Method POST ### Endpoint /v1/shopping/seatmaps ### Parameters #### Request Body - **body** (object) - Required - The request body containing seat map details. ### Request Example ```python amadeus.shopping.seatmaps.post(body) ``` ``` -------------------------------- ### Hotel Name Autocomplete Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Provides hotel name suggestions based on a keyword and subtype. ```APIDOC ## GET /reference/locations/hotel ### Description Provides hotel name suggestions based on a keyword and subtype. ### Method GET ### Endpoint /v1/reference/locations/hotel ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to search for. - **subType** (array) - Optional - Filters results by hotel type (e.g., [Hotel.HOTEL_GDS, Hotel.HOTEL_LEISURE]). ### Request Example ```python amadeus.reference_data.locations.hotel.get(keyword='PARI', subType=[Hotel.HOTEL_GDS, Hotel.HOTEL_LEISURE]) ``` ``` -------------------------------- ### Flight Choice Prediction POST Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Predicts flight choices based on search results. Requires flight offer search results as input. ```python # Flight Choice Prediction body = amadeus.shopping.flight_offers_search.get( originLocationCode='MAD', destinationLocationCode='NYC', departureDate='2022-11-01', adults=1).result amadeus.shopping.flight_offers.prediction.post(body) ``` -------------------------------- ### Book Transfer Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Book a specific transfer offer using its offer ID and posting request body. ```python amadeus.ordering.transfer_orders.post(body, offerId='1000000000') ``` -------------------------------- ### Flight Order Management Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Manages flight orders by retrieving or deleting them using their ID. The flight ID is obtained from the Flight Create Orders response. ```python # 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 = amadeus.booking.flight_orders.post(body).data amadeus.booking.flight_order(flight_booking['id']).get() ``` ```python # Delete the order based on it's ID amadeus.booking.flight_order(flight_booking['id']).delete() ``` -------------------------------- ### Airport On-Time Performance Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves on-time performance data for a given airport on a specific date. ```APIDOC ## GET /v1/airport/predictions/on-time ### Description Retrieves on-time performance data for a given airport on a specific date. ### Method GET ### Endpoint /v1/airport/predictions/on-time ### Parameters #### Query Parameters - **airportCode** (string) - Required - The IATA airport code. - **date** (string) - Required - The date in YYYY-MM-DD format. ### Request Example ```python amadeus.airport.predictions.on_time.get(airportCode='JFK', date='2022-11-01') ``` ``` -------------------------------- ### Branded Fares Upsell POST Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Upsells branded fares using a POST request with a specified body. ```python # Branded Fares Upsell amadeus.shopping.flight_offers.upselling.post(body) ``` -------------------------------- ### Predict Trip Purpose Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Predict the purpose of a trip based on origin, destination, and dates. ```python amadeus.travel.predictions.trip_purpose.get(originLocationCode='ATH', destinationLocationCode='MAD', departureDate='2022-11-01', returnDate='2022-11-08') ``` -------------------------------- ### Flight Inspiration Search Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for flight destinations based on an origin city. ```APIDOC ## GET /shopping/flight-destinations ### Description Searches for flight destinations from a specified origin. ### Method GET ### Endpoint /v1/shopping/flight-destinations ### Parameters #### Query Parameters - **origin** (string) - Required - The origin city code. ### Request Example ```python amadeus.shopping.flight_destinations.get(origin='MAD') ``` ``` -------------------------------- ### Transfer Search Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for available transfer offers. ```APIDOC ## POST /v1/shopping/transfer-offers ### Description Searches for available transfer offers. ### Method POST ### Endpoint /v1/shopping/transfer-offers ### Parameters #### Request Body - **body** (object) - Required - The request body containing search criteria. ### Request Example ```python amadeus.shopping.transfer_offers.post(body) ``` ``` -------------------------------- ### City Search Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Searches for cities based on a keyword. ```APIDOC ## GET /reference/locations/cities ### Description Searches for cities based on a keyword. ### Method GET ### Endpoint /v1/reference/locations/cities ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to search for (e.g., city name). ### Request Example ```python amadeus.reference_data.locations.cities.get(keyword='PAR') ``` ``` -------------------------------- ### Flight Schedule Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves the status of a given flight based on carrier, flight number, and scheduled departure date. ```APIDOC ## GET /v1/schedule/flights ### Description Retrieves the status of a given flight based on carrier, flight number, and scheduled departure date. ### Method GET ### Endpoint /v1/schedule/flights ### Parameters #### Query Parameters - **carrierCode** (string) - Required - The IATA carrier code. - **flightNumber** (string) - Required - The flight number. - **scheduledDepartureDate** (string) - Required - The scheduled departure date in YYYY-MM-DD format. ### Request Example ```python amadeus.schedule.flights.get(carrierCode='AZ', flightNumber='319', scheduledDepartureDate='2022-09-13') ``` ``` -------------------------------- ### Airport Direct Destinations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Lists direct destinations from a specified departure airport. ```APIDOC ## GET /v1/airport/direct-destinations ### Description Lists direct destinations from a specified departure airport. ### Method GET ### Endpoint /v1/airport/direct-destinations ### Parameters #### Query Parameters - **departureAirportCode** (string) - Required - The IATA code of the departure airport. ### Request Example ```python amadeus.airport.direct_destinations.get(departureAirportCode='BLR') ``` ``` -------------------------------- ### Hotel Sentiments Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves traveler sentiment data for a given hotel ID. ```APIDOC ## GET /v1/e_reputation/hotel_sentiments ### Description Retrieves traveler sentiment data for a given hotel ID. ### Method GET ### Endpoint /v1/e_reputation/hotel_sentiments ### Parameters #### Query Parameters - **hotelIds** (string) - Required - Comma-separated list of hotel IDs to retrieve sentiments for. ### Request Example ```python amadeus.e_reputation.hotel_sentiments.get(hotelIds='ADNYCCTB') ``` ``` -------------------------------- ### Predict Flight Delay Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Predict the delay of a specific flight based on detailed flight information. ```python amadeus.travel.predictions.flight_delay.get(originLocationCode='NCE', destinationLocationCode='IST', departureDate='2022-08-01', departureTime='18:20:00', arrivalDate='2022-08-01', arrivalTime='22:15:00', aircraftCode='321', carrierCode='TK', flightNumber='1816', duration='PT31H10M') ``` -------------------------------- ### Flight Order Management (DELETE) Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Deletes a flight order by its ID. ```APIDOC ## DELETE /booking/flight-orders/{flight_id} ### Description Deletes a flight order by its ID. ### Method DELETE ### Endpoint /v1/booking/flight-orders/{flight_id} ### Parameters #### Path Parameters - **flight_id** (string) - Required - The ID of the flight order. ### Request Example ```python # Assuming flight_booking is the result from Flight Create Orders amadeus.booking.flight_order(flight_booking['id']).delete() ``` ``` -------------------------------- ### Flight Most Booked Destinations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves the most booked flight destinations from a given origin city for a specific period. ```APIDOC ## GET /travel/analytics/air-traffic/booked ### Description Retrieves the most booked flight destinations from a given origin city for a specific period. ### Method GET ### Endpoint /v1/travel/analytics/air-traffic/booked ### Parameters #### Query Parameters - **originCityCode** (string) - Required - The origin city code. - **period** (string) - Required - The period in 'YYYY-MM' format. ### Request Example ```python amadeus.travel.analytics.air_traffic.booked.get(originCityCode='MAD', period='2017-08') ``` ``` -------------------------------- ### Flight Choice Prediction Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Predicts flight choices based on previous search results. ```APIDOC ## POST /shopping/flight-offers/prediction ### Description Predicts flight choices based on previous search results. ### Method POST ### Endpoint /v1/shopping/flight-offers/prediction ### Parameters #### Request Body - **body** (object) - Required - The result from a flight offers search. ### Request Example ```python # First, perform a flight offers search search_results = amadeus.shopping.flight_offers_search.get( originLocationCode='MAD', destinationLocationCode='NYC', departureDate='2022-11-01', adults=1).result # Then, use the results for prediction amadeus.shopping.flight_offers.prediction.post(search_results) ``` ``` -------------------------------- ### Airline Destinations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Lists destinations served by a specific airline. ```APIDOC ## GET /v1/airline/destinations ### Description Lists destinations served by a specific airline. ### Method GET ### Endpoint /v1/airline/destinations ### Parameters #### Query Parameters - **airlineCode** (string) - Required - The IATA airline code. ### Request Example ```python amadeus.airline.destinations.get(airlineCode='BA') ``` ``` -------------------------------- ### Branded Fares Upsell Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Provides branded fare upsell options. ```APIDOC ## POST /shopping/flight-offers/upselling ### Description Provides branded fare upsell options. ### Method POST ### Endpoint /v1/shopping/flight-offers/upselling ### Parameters #### Request Body - **body** (object) - Required - The request body containing details for upsell options. ### Request Example ```python amadeus.shopping.flight_offers.upselling.post(body) ``` ``` -------------------------------- ### Flight Delay Prediction Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Predicts the likelihood of a flight delay. ```APIDOC ## GET /v1/travel/predictions/flight-delay ### Description Predicts the likelihood of a flight delay. ### Method GET ### Endpoint /v1/travel/predictions/flight-delay ### Parameters #### Query Parameters - **originLocationCode** (string) - Required - The IATA code of the origin location. - **destinationLocationCode** (string) - Required - The IATA code of the destination location. - **departureDate** (string) - Required - The departure date in YYYY-MM-DD format. - **departureTime** (string) - Optional - The departure time in HH:MM:SS format. - **arrivalDate** (string) - Required - The arrival date in YYYY-MM-DD format. - **arrivalTime** (string) - Optional - The arrival time in HH:MM:SS format. - **aircraftCode** (string) - Optional - The IATA aircraft code. - **carrierCode** (string) - Optional - The IATA carrier code. - **flightNumber** (string) - Optional - The flight number. - **duration** (string) - Optional - The flight duration in ISO 8601 format (e.g., PT31H10M). ### Request Example ```python amadeus.travel.predictions.flight_delay.get(originLocationCode='NCE', destinationLocationCode='IST', departureDate='2022-08-01', departureTime='18:20:00', arrivalDate='2022-08-01', arrivalTime='22:15:00', aircraftCode='321', carrierCode='TK', flightNumber='1816', duration='PT31H10M') ``` ``` -------------------------------- ### Airport Nearest Relevant Airport Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds the nearest relevant airport to a given geographic coordinate. ```APIDOC ## GET /reference/locations/airports ### Description Finds the nearest relevant airport to a given geographic coordinate. ### Method GET ### Endpoint /v1/reference/locations/airports ### Parameters #### Query Parameters - **longitude** (number) - Required - The longitude coordinate. - **latitude** (number) - Required - The latitude coordinate. ### Request Example ```python amadeus.reference_data.locations.airports.get(longitude=0.1278, latitude=51.5074) ``` ``` -------------------------------- ### Cancel Transfer Booking Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Cancel a transfer booking using the order ID, confirmation number, and posting request body. ```python amadeus.ordering.transfer_order('ABC').transfers.cancellation.post(body, confirmNbr=123) ``` -------------------------------- ### Trip Purpose Prediction Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Predicts the purpose of a trip based on origin, destination, and dates. ```APIDOC ## GET /v1/travel/predictions/trip-purpose ### Description Predicts the purpose of a trip based on origin, destination, and dates. ### Method GET ### Endpoint /v1/travel/predictions/trip-purpose ### Parameters #### Query Parameters - **originLocationCode** (string) - Required - The IATA code of the origin location. - **destinationLocationCode** (string) - Required - The IATA code of the destination location. - **departureDate** (string) - Required - The departure date in YYYY-MM-DD format. - **returnDate** (string) - Required - The return date in YYYY-MM-DD format. ### Request Example ```python amadeus.travel.predictions.trip_purpose.get(originLocationCode='ATH', destinationLocationCode='MAD', departureDate='2022-11-01', returnDate='2022-11-08') ``` ``` -------------------------------- ### Transfer Cancellation Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Cancels a booked transfer. ```APIDOC ## POST /v1/ordering/transfer-orders/{orderId}/transfers/cancellation ### Description Cancels a booked transfer. ### Method POST ### Endpoint /v1/ordering/transfer-orders/{orderId}/transfers/cancellation ### Parameters #### Path Parameters - **orderId** (string) - Required - The ID of the transfer order to cancel. #### Query Parameters - **confirmNbr** (integer) - Required - The confirmation number for the transfer. #### Request Body - **body** (object) - Required - The request body containing cancellation details. ### Request Example ```python amadeus.ordering.transfer_order('ABC').transfers.cancellation.post(body, confirmNbr=123) ``` ``` -------------------------------- ### Flight Busiest Travel Period Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Finds the busiest travel period for a given city and direction. ```APIDOC ## GET /travel/analytics/air-traffic/busiest-period ### Description Finds the busiest travel period for a given city and direction. ### Method GET ### Endpoint /v1/travel/analytics/air-traffic/busiest-period ### Parameters #### Query Parameters - **cityCode** (string) - Required - The city code. - **period** (string) - Required - The period in 'YYYY' format. - **direction** (string) - Required - The direction of travel ('ARRIVING' or 'DEPARTING'). ### Request Example ```python amadeus.travel.analytics.air_traffic.busiest_period.get(cityCode='MAD', period='2017', direction='ARRIVING') ``` ``` -------------------------------- ### Airline Code Lookup Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Looks up airline information using IATA airline codes. ```APIDOC ## GET /reference/airlines ### Description Looks up airline information using IATA airline codes. ### Method GET ### Endpoint /v1/reference/airlines ### Parameters #### Query Parameters - **airlineCodes** (string) - Required - Comma-separated IATA airline codes. ### Request Example ```python amadeus.reference_data.airlines.get(airlineCodes='U2') ``` ``` -------------------------------- ### Flight Most Traveled Destinations Source: https://github.com/amadeus4dev/amadeus-python/blob/master/README.rst Retrieves the most traveled flight destinations from a given origin city for a specific period. ```APIDOC ## GET /travel/analytics/air-traffic/traveled ### Description Retrieves the most traveled flight destinations from a given origin city for a specific period. ### Method GET ### Endpoint /v1/travel/analytics/air-traffic/traveled ### Parameters #### Query Parameters - **originCityCode** (string) - Required - The origin city code. - **period** (string) - Required - The period in 'YYYY-MM' format. ### Request Example ```python amadeus.travel.analytics.air_traffic.traveled.get(originCityCode='MAD', period='2017-01') ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.