├── output_file ├── flight_order_management └── v1 │ ├── delete │ ├── response.json │ ├── iOS SDK │ │ └── FlightOrderManagement.swift │ ├── Python SDK │ │ └── flight_order_management.py │ ├── curl │ │ └── flight_order_management.sh │ ├── Java SDK │ │ └── FlightOrderManagement.java │ └── Android SDK │ │ └── FlightOrderManagement.kt │ └── get │ ├── iOS SDK │ └── FlightOrderManagement.swift │ ├── Python SDK │ └── flight_order_management.py │ ├── curl │ └── flight_order_management.sh │ ├── Java SDK │ └── FlightOrderManagement.java │ └── Android SDK │ └── FlightOrderManagement.kt ├── .gitignore ├── .github └── CODEOWNERS ├── hotel_booking └── v1 │ └── post │ ├── response.json │ ├── Python SDK │ └── hotel_booking.py │ ├── Java SDK │ └── HotelBookings.java │ ├── iOS SDK │ └── HotelBookings.swift │ ├── curl │ └── hotel_booking.sh │ └── Node SDK │ └── hotel_booking.js ├── airport_on_time_performance └── v1 │ └── get │ ├── response.json │ ├── Node SDK │ └── airport_on_time_performance.js │ ├── Python SDK │ └── airport_on_time_performance.py │ ├── iOS SDK │ └── AirportOnTime.swift │ ├── curl │ └── airport_on_time_performance.sh │ ├── Java SDK │ └── AirportOnTime.java │ └── Android SDK │ └── AirportOnTime.kt ├── airline_code_lookup └── v1 │ └── get │ ├── response.json │ ├── Node SDK │ └── airline_code_lookup.js │ ├── Python SDK │ └── airline_code_lookup.py │ ├── curl │ └── airline_code_lookup.sh │ ├── iOS SDK │ └── AirlineCodeLookup.swift │ ├── Java SDK │ └── AirlineCodeLookup.java │ └── Android SDK │ └── AirlineCodeLookup.kt ├── location_score └── v1 │ └── get │ ├── Node SDK │ └── location_score.js │ ├── Python SDK │ └── location_score.py │ ├── cURL │ └── location_score.sh │ └── Java SDK │ └── LocationScore.java ├── trip_purpose_prediction └── v2 │ └── get │ ├── response.json │ ├── Node SDK │ └── trip_purpose_prediction.js │ ├── iOS SDK │ └── TripPurposePrediction.swift │ ├── curl │ └── trip_purpose_prediction.sh │ ├── Python SDK │ └── trip_purpose_prediction.py │ ├── Java SDK │ └── TripPurposePrediction.java │ └── Android SDK │ └── TripPurposePrediction.kt ├── airport_and_city_search └── v1 │ └── get │ ├── locations │ ├── Node SDK │ │ └── airport_and_city_search.js │ ├── iOS SDK │ │ └── AirportCitySearch.swift │ ├── Python SDK │ │ └── airport_and_city_search.py │ ├── cURL │ │ └── airport_city_search.sh │ ├── Java SDK │ │ └── AirportCitySearch.java │ └── Android SDK │ │ └── AirportCitySearch.kt │ └── locations_locationsid │ ├── Node SDK │ └── airport_and_city_search.js │ ├── cURL │ └── airport_city_search.sh │ ├── iOS SDK │ └── AirportCitySearch.swift │ ├── Python SDK │ └── airport_and_city_search.py │ ├── Android SDK │ └── AirportCitySerch.kt │ ├── Java SDK │ └── AirportCitySearch.java │ └── response.json ├── seatmaps └── v1 │ ├── get │ ├── iOS SDK │ │ └── SeatMaps.swift │ ├── Node SDK │ │ └── seatmaps.js │ ├── Python SDK │ │ └── seatmaps.py │ ├── curl │ │ └── seatmaps.sh │ ├── Android SDK │ │ └── SeatMaps.kt │ └── Java SDK │ │ └── SeatMaps.java │ └── post │ ├── Node SDK │ └── seatmaps.js │ ├── Python SDK │ └── seatmaps.py │ └── Java SDK │ └── SeatMaps.java ├── hotel_list └── v1 │ └── get │ ├── hotels_by_city │ ├── Node SDK │ │ └── hotel_list.js │ ├── Python SDK │ │ └── hotel_list.py │ └── Java SDK │ │ └── HotelList.java │ ├── hotels_by_hotels │ ├── Python SDK │ │ └── hotel_list.py │ ├── Node SDK │ │ └── hotel_list.js │ ├── response.json │ └── Java SDK │ │ └── HotelList.java │ └── hotels_by_geocode │ ├── Python SDK │ └── hotel_list.py │ ├── Node SDK │ └── hotel_list.js │ └── Java SDK │ └── HotelList.java ├── hotel_ratings └── v2 │ └── get │ ├── Python SDK │ └── hotel_ratings.py │ ├── Node SDK │ └── hotel_ratings.js │ ├── iOS SDK │ └── HotelRatings.swift │ ├── curl │ └── hotel_ratings.sh │ ├── Android SDK │ └── HotelRatings.kt │ ├── Java SDK │ └── HotelRatings.java │ └── response.json ├── travel_redommendations └── v1 │ └── get │ ├── Python SDK │ └── travel_recommendations.py │ ├── iOS SDK │ └── TravelRecommendations.swift │ ├── Node SDK │ └── travel_recommendations.js │ ├── cURL │ └── travel_recommendations.sh │ ├── Android SDK │ └── travel_recommendations.kt │ └── Java SDK │ └── TravelRecommendations.java ├── city_search └── v1 │ └── get │ ├── Python SDK │ └── city_search.py │ ├── Node SDK │ └── city_search.js │ └── Java SDK │ └── CitySearch.java ├── flight_insipiration_search └── v1 │ └── get │ ├── iOS SDK │ └── FlightInspirationSearch.swift │ ├── Node SDK │ └── flight_insipiration_search.js │ ├── Python SDK │ └── flight_inspiration_search.py │ ├── curl │ └── flight_inspiration_search.sh │ ├── Android SDK │ └── FlightInspirationSearch.kt │ └── Java SDK │ └── FlightInspirationSearch.java ├── hotel_search └── v3 │ └── get │ ├── hotel_offers_offerId │ ├── Python SDK │ │ └── hotel_search.py │ ├── Node SDK │ │ └── hotel_search.js │ └── Java SDK │ │ └── HotelSearch.java │ └── hotel_offers │ ├── Python SDK │ └── hotel_search.py │ ├── Node SDK │ └── hotel_search.js │ └── Java SDK │ └── HotelSearch.java ├── points_of_interest └── v1 │ └── get │ ├── pois_poisId │ ├── iOS SDK │ │ └── PointsOfInterest.swift │ ├── Python SDK │ │ └── points_of_interest.py │ ├── Node SDK │ │ └── points_of_interest.js │ ├── cURL │ │ └── by_id.sh │ ├── response.json │ ├── Android SDK │ │ └── PointOfInterest.kt │ └── Java SDK │ │ └── PointsOfInterest.java │ ├── pois │ ├── Python SDK │ │ └── points_of_interest.py │ ├── iOS SDK │ │ └── PointsOfInterest.swift │ ├── Node SDK │ │ └── points_of_interest.js │ ├── cURL │ │ └── by_coords.sh │ ├── Android SDK │ │ └── PointsOfInterest.kt │ └── Java SDK │ │ └── PointsOfInterest.java │ └── pois_by_square │ ├── Node SDK │ └── points_of_interest.js │ ├── iOS SDK │ └── PointsOfInterest.swift │ ├── cURL │ └── by_sqare.sh │ ├── Python SDK │ └── points_of_interest.py │ ├── Android SDK │ └── PointsOfInterest.kt │ └── Java SDK │ └── PointsOfInterest.java ├── tours_and_activities └── v1 │ └── get │ ├── tours_and_activities_retrieve │ ├── iOS SDK │ │ └── ToursActivities.swift │ ├── Python SDK │ │ └── tours_and_activities.py │ ├── Node SDK │ │ └── tours_activities.js │ ├── cURL │ │ └── tours_activities.sh │ ├── Java SDK │ │ └── ToursActivities.java │ ├── Android SDK │ │ └── tours_and_activities.kt │ └── response.json │ ├── tours_and_activities │ ├── iOS SDK │ │ └── ToursActivities.swift │ ├── Python SDK │ │ └── tours_and_activities.py │ ├── Node SDK │ │ └── tous_activities.js │ ├── cURL │ │ └── tours_activities.sh │ ├── Java SDK │ │ └── ToursActivities.java │ ├── Android SDK │ │ └── tours_and_activities.kt │ └── response.json │ └── tours_and_activities_by_square │ ├── iOS SDK │ └── ToursActivities.swift │ ├── Node SDK │ └── tours_activities.js │ ├── cURL │ └── tours_activities.sh │ ├── Python SDK │ └── tours_and_activities.py │ ├── Java SDK │ └── ToursActivities.java │ ├── Android SDK │ └── tours_and_activities.kt │ └── response.json ├── airline_routes └── v1 │ └── get │ ├── Python SDK │ └── airline_routes.py │ ├── Node SDK │ └── airline_routes.js │ ├── cURL │ └── airline_routes.sh │ └── Java SDK │ └── AirlineRoutes.java ├── airport_routes └── v1 │ └── get │ ├── Node SDK │ └── airport_routes.js │ ├── Python SDK │ └── airport_routes.py │ └── Java SDK │ └── AirportRoutes.java ├── flight_checkin_links └── v2 │ └── get │ ├── Python SDK │ └── flight_checkin_links.py │ ├── Node SDK │ └── flight_checkin_links.js │ ├── curl │ └── flight_checkin_links.sh │ ├── iOS SDK │ └── FlightCheckinLinks.swift │ ├── Java SDK │ └── FlightCheckinLinks.java │ ├── Android SDK │ └── FlightCheckinLinks.kt │ └── response.json ├── flight_cheapest_date_search └── v1 │ └── get │ ├── iOS SDK │ └── FlightCheapestDate.swift │ ├── Python SDK │ └── flight_cheapest_date_search.py │ ├── Node SDK │ └── flight_cheapest_date_search.js │ ├── curl │ └── flight_cheapest_date_search.sh │ ├── Java SDK │ └── FlightCheapestDate.java │ └── Android SDK │ └── FlightCheapestDate.kt ├── on_demand_flight_status └── v2 │ └── get │ ├── iOS SDK │ └── OnDemandFlightStatus.swift │ ├── Node SDK │ └── on_demand_flight_status.js │ ├── Python SDK │ └── on_demand_flight_status.py │ ├── cURL │ └── on_demand_flight_status.sh │ ├── Android SDK │ └── on_demand_flight_status.kt │ └── Java SDK │ └── OnDemandFlightStatus.java ├── airport_nearest_relevant_airport └── v1 │ └── get │ ├── Python SDK │ └── airport_nearest_relevant_airport.py │ ├── Node SDK │ └── airport_nearest_relevant_airport.js │ ├── iOS SDK │ └── AirportNearest.swift │ ├── curl │ └── airport_nearest_relevant_airport.sh │ ├── Java SDK │ └── AirportNearest.java │ └── Android SDK │ └── AirportNearest.kt ├── flight_most_booked_destinations └── v1 │ └── get │ ├── Python SDK │ └── flight_most_booked_destinations.py │ ├── Node SDK │ └── flight_most_booked_destinations.js │ ├── iOs SDK │ └── FlightMostBookedDestinations.swift │ ├── curl │ └── flight_most_booked_destinations.sh │ ├── Android SDK │ └── FlightMostBookedDestinations.kt │ └── Java SDK │ └── FlightMostBookedDestinations.java ├── flight_most_traveled_destinations └── v1 │ └── get │ ├── Python SDK │ └── flight_most_traveled_destinations.py │ ├── Node SDK │ └── flight_most_traveled_destinations.js │ ├── iOS SDK │ └── FlightMostTraveledDestinations.swift │ ├── curl │ └── flight_most_traveled_destinations.sh │ ├── Android SDK │ └── FlightMostTraveledDestinations.kt │ └── Java SDK │ └── FlightMostTraveledDestinations.java ├── flight_price_analysis └── v1 │ └── get │ ├── iOS SDK │ └── FlightPriceAnalysis.swift │ ├── Node SDK │ └── flight_price_analysis.js │ ├── cURL │ └── flight_price_analysis.sh │ ├── Python SDK │ └── flight_price_analysis.py │ ├── Android SDK │ └── flight_price_analysis.kt │ ├── Java SDK │ └── FlightPriceAnalysis.java │ └── response.json ├── flight_busiest_traveling_period └── v1 │ └── get │ ├── Python SDK │ └── flight_busiest_traveling_period.py │ ├── iOS SDK │ └── FlightBusiestPeriod.swift │ ├── Node SDK │ └── flight_busiest_traveling_period.js │ ├── curl │ └── flight_busiest_traveling_period.sh │ ├── Java SDK │ └── FlightBusiestPeriod.java │ └── Android SDK │ └── FlightBusiestPeriod.kt ├── flight_offers_search └── v2 │ ├── get │ ├── Python SDK │ │ └── flight_offers_search.py │ ├── Node SDK │ │ └── flight_offers_search.js │ ├── iOS SDK │ │ └── FlightOffersSearch.swift │ ├── curl │ │ └── flight_offers_search.sh │ ├── Android SDK │ │ └── FlightOffersSearch.kt │ └── Java SDK │ │ └── FlightOffersSearch.java │ └── post │ └── Java SDK │ └── FlightOffersSearch.java ├── hotel_name_autocomplete └── v1 │ └── get │ ├── Python SDK │ └── hotel_name_autocomplete.py │ ├── Node SDK │ └── hotel_name_autocomplete.js │ ├── cURL │ └── hotel_name_autocompletion.sh │ └── Java SDK │ └── HotelNameAutocomplete.java ├── flight_choice_prediction └── v2 │ └── post │ ├── Node SDK │ └── flight_choice_prediction.js │ ├── Python SDK │ └── flight_choice_prediction.py │ ├── Java SDK │ └── FlightChoicePrediction.java │ └── iOS SDK │ └── FlightChoicePrediction.swift ├── transfer_management └── v1 │ └── post │ ├── curl │ └── transfer_management.sh │ └── Java SDK │ └── TransferManagement.java ├── flight_delay_prediction └── v1 │ └── get │ ├── curl │ └── flight_delay_prediction.sh │ ├── iOS SDK │ └── FlightDelayPrediction.swift │ ├── Node SDK │ └── flight_delay_prediction.js │ ├── Python SDK │ └── flight_delay_prediction.py │ ├── Java SDK │ └── FlightDelayPrediction.java │ ├── Android SDK │ └── FlightDelayPrediction.kt │ └── response.json ├── flight_availabilities_search └── v1 │ └── post │ ├── Node SDK │ └── flight_availabilities.js │ ├── Python SDK │ └── flight_availabilities_search.py │ ├── cURL │ └── flight_availabilities_search.sh │ └── Java SDK │ └── FlightAvailabilities.java ├── flight_offers_price └── v1 │ └── post │ ├── Python SDK │ └── flight_offers_price.py │ ├── Node SDK │ └── flight_offers_price.js │ ├── iOS SDK │ └── FlightOffersPrice.swift │ └── Java SDK │ └── FlightOffersPrice.java ├── LICENSE ├── branded_fares_upsell └── v1 │ └── post │ ├── Node SDK │ └── branded_fares_upsell.js │ └── Java SDK │ └── BrandedFaresUpsell.java ├── transfer_search └── v1 │ └── post │ └── Python SDK │ └── transfer_search.py └── README.md /output_file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /flight_order_management/v1/delete/response.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info 2 | venv 3 | __pycache__ 4 | test.py 5 | *.pyc 6 | .python-version 7 | .tox 8 | .pytest_cache 9 | htmlcov 10 | .coverage 11 | _docs 12 | dist 13 | build 14 | .vscode 15 | env 16 | **/.DS_Store 17 | 18 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Each line is a file pattern followed by one or more owners. 2 | 3 | # The '*' pattern is global owners. 4 | 5 | # These owners will be the default owners for everything in 6 | # the repo and will be requested for 7 | # review when someone opens a pull request. 8 | 9 | # Global Rule 10 | * @tsolakoua @minjikarin @jabrena 11 | -------------------------------------------------------------------------------- /hotel_booking/v1/post/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "type": "hotel-booking", 5 | "id": "XD_8138319951754", 6 | "providerConfirmationId": "8138319951754", 7 | "associatedRecords": [ 8 | { 9 | "reference": "QVH2BX", 10 | "originSystemCode": "GDS" 11 | } 12 | ] 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "id": "JFK20200801", 4 | "probability": "0.928", 5 | "result": "0.74906671", 6 | "subType": "on-time", 7 | "type": "prediction" 8 | }, 9 | "meta": { 10 | "links": { 11 | "self": "https://test.api.amadeus.com/v1/airport/predictions/on-time?airportCode=JFK&date=2020-08-01" 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "count": 1, 4 | "links": { 5 | "self": "https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA" 6 | } 7 | }, 8 | "data": [ 9 | { 10 | "type": "airline", 11 | "iataCode": "BA", 12 | "icaoCode": "BAW", 13 | "businessName": "BRITISH AIRWAYS", 14 | "commonName": "BRITISH A/W" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /location_score/v1/get/Node SDK/location_score.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus(); 4 | 5 | async function main() { 6 | try { 7 | //What are the location scores for the given coordinates? 8 | const response = await amadeus.location.analytics.categoryRatedAreas.get({ 9 | latitude: 41.397158, 10 | longitude: 2.160873, 11 | }); 12 | 13 | console.log(response); 14 | } catch (error) { 15 | console.error(error); 16 | } 17 | } 18 | 19 | main(); 20 | -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "links": { 4 | "self": "https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2020-08-01&returnDate=2020-08-12&searchDate=2020-06-11" 5 | } 6 | }, 7 | "data": { 8 | "id": "NCECDG25012019", 9 | "type": "prediction", 10 | "subtype": "trip-purpose", 11 | "result": "BUSINESS", 12 | "probability" : 0.7891235 13 | } 14 | } -------------------------------------------------------------------------------- /location_score/v1/get/Python SDK/location_score.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from ast import keyword 3 | from amadeus import Client, ResponseError 4 | 5 | amadeus = Client( 6 | ) 7 | 8 | try: 9 | ''' 10 | What are the location scores for the given coordinates? 11 | ''' 12 | response = amadeus.location.analytics.category_rated_areas.get(latitude=41.397158, longitude=2.160873) 13 | print(response.data) 14 | except ResponseError as error: 15 | raise error 16 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations/Node SDK/airport_and_city_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_KEY", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Retrieve information about the LHR airport? 11 | const response = await amadeus.referenceData.location("ALHR").get(); 12 | 13 | console.log(response); 14 | } catch (error) { 15 | console.error(error); 16 | } 17 | } 18 | 19 | main(); 20 | -------------------------------------------------------------------------------- /seatmaps/v1/get/iOS SDK/SeatMaps.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.seatMaps.get(params: ["flight-orderId": "eJzTd9f3NjIJdzUGAAp%2fAiY="], 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_city/Node SDK/hotel_list.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // List of hotels in Paris 11 | const response = await amadeus.referenceData.locations.hotels.byCity.get({ 12 | cityCode: "PAR", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /hotel_ratings/v2/get/Python SDK/hotel_ratings.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What travelers think about this hotel? 12 | ''' 13 | response = amadeus.e_reputation.hotel_sentiments.get(hotelIds = 'ADNYCCTB') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /travel_redommendations/v1/get/Python SDK/travel_recommendations.py: -------------------------------------------------------------------------------- 1 | from amadeus import Client, ResponseError 2 | 3 | amadeus = Client( 4 | client_id='YOUR_AMADEUS_API_KEY', 5 | client_secret='YOUR_AMADEUS_API_SECRET' 6 | ) 7 | 8 | try: 9 | ''' 10 | Recommends travel destinations similar to Paris for travelers in France 11 | ''' 12 | response = amadeus.reference_data.recommended_locations.get(cityCodes='PAR', travelerCountryCode='FR') 13 | print(response.data) 14 | except ResponseError as error: 15 | raise error -------------------------------------------------------------------------------- /city_search/v1/get/Python SDK/city_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What are the cities matched with keyword 'Paris' ? 12 | ''' 13 | response = amadeus.reference_data.locations.cities.get(keyword='Paris') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_insipiration_search/v1/get/iOS SDK/FlightInspirationSearch.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.flightDestinations.get(params: ["origin": "MAD"], 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_city/Python SDK/hotel_list.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Get list of hotels by city code 12 | ''' 13 | response = amadeus.reference_data.locations.hotels.by_city.get(cityCode='PAR') 14 | 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error -------------------------------------------------------------------------------- /hotel_ratings/v2/get/Node SDK/hotel_ratings.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What travelers think about this hotel? 11 | const response = await amadeus.eReputation.hotelSentiments.get({ 12 | hotelIds: "ADNYCCTB", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /hotel_search/v3/get/hotel_offers_offerId/Python SDK/hotel_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | # Get list of Hotels by city code 11 | hotels_by_city = amadeus.shopping.hotel_offer_search('63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3').get() 12 | except ResponseError as error: 13 | raise error -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/Node SDK/airline_code_lookup.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What's the airline name for the IATA code BA? 11 | const response = await amadeus.referenceData.airlines.get({ 12 | airlineCodes: "BA", 13 | }); 14 | console.log(response); 15 | } catch (error) { 16 | console.error(error); 17 | } 18 | } 19 | 20 | main(); 21 | -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/Python SDK/airline_code_lookup.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What's the airline name for the IATA code BA? 12 | ''' 13 | response = amadeus.reference_data.airlines.get(airlineCodes='BA') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/iOS SDK/PointsOfInterest.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.referenceData.locations.pointOfInterest(poiId: "9CB40CB5D0").get( 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /seatmaps/v1/get/Node SDK/seatmaps.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Returns all the seat maps of a given order 11 | const response = await amadeus.shopping.seatmaps.get({ 12 | "flight-orderId": "eJzTd9cPDPMwcooAAAtXAmE=", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/iOS SDK/ToursActivities.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.activity(activityId: "56777").get( 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /airline_routes/v1/get/Python SDK/airline_routes.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What are the destinations served by the British Airways (BA)? 12 | ''' 13 | response = amadeus.airline.destinations.get(airlineCode='BA') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /airport_routes/v1/get/Node SDK/airport_routes.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Find all destinations served by CDG Airport 11 | const response = await amadeus.airport.directDestinations.get({ 12 | departureAirportCode: "MAD", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /airport_routes/v1/get/Python SDK/airport_routes.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What are the destinations served by MAD airport? 12 | ''' 13 | response = amadeus.airport.direct_destinations.get(departureAirportCode='MAD') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/Python SDK/flight_checkin_links.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What is the URL to my online check-in? 12 | ''' 13 | response = amadeus.reference_data.urls.checkin_links.get(airlineCode='BA') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_hotels/Python SDK/hotel_list.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Get list of hotels by hotel id 12 | ''' 13 | response = amadeus.reference_data.locations.hotels.by_hotels.get(hotelIds='ADPAR001') 14 | 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error -------------------------------------------------------------------------------- /seatmaps/v1/get/Python SDK/seatmaps.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Retrieve the seat map of a flight present in an order 12 | ''' 13 | response = amadeus.shopping.seatmaps.get(flightorderId='eJzTd9cPDPMwcooAAAtXAmE=') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/Node SDK/flight_checkin_links.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What is the URL to my online check-in? 11 | const response = await amadeus.referenceData.urls.checkinLinks.get({ 12 | airlineCode: "BA", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /flight_insipiration_search/v1/get/Node SDK/flight_insipiration_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Find cheapest destinations from Madrid 11 | const response = await amadeus.shopping.flightDestinations.get({ 12 | origin: "MAD", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /flight_order_management/v1/get/iOS SDK/FlightOrderManagement.swift: -------------------------------------------------------------------------------- 1 | import Amadeu 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.booking.flightOrder(flightOrderId: "MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy").get( 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /flight_cheapest_date_search/v1/get/iOS SDK/FlightCheapestDate.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.flightDates.get(params: ["origin": "MAD", 9 | "destination": "MUC"], 10 | onCompletion: { result in 11 | switch result { 12 | case let .success(response): 13 | print(response.data) 14 | case let .failure(error): 15 | fatalError(error.localizedDescription) 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /flight_order_management/v1/delete/iOS SDK/FlightOrderManagement.swift: -------------------------------------------------------------------------------- 1 | import Amadeu 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.booking.flightOrder(flightOrderId: "MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy").delete( 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_hotels/Node SDK/hotel_list.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Get Marriot Hotel information in Paris 11 | const response = await amadeus.referenceData.locations.hotels.byHotels.get({ 12 | hotelIds: "ARPARARA", 13 | }); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /hotel_ratings/v2/get/iOS SDK/HotelRatings.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Hotel Ratings / Sentiments 9 | amadeus.eReputation.hotelSentiments.get(params: ["hotelIds": "ADNYCCTB"], 10 | onCompletion: { result in 11 | switch result { 12 | case let .success(response): 13 | print(response.data) 14 | case let .failure(error): 15 | fatalError(error.localizedDescription) 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /flight_cheapest_date_search/v1/get/Python SDK/flight_cheapest_date_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Find cheapest dates from Madrid to Munich 12 | ''' 13 | response = amadeus.shopping.flight_dates.get(origin='MAD', destination='MUC') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_order_management/v1/get/Python SDK/flight_order_management.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | # Retrieve the flight order based on it's id 12 | ''' 13 | response = amadeus.booking.flight_order('MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy').get() 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_geocode/Python SDK/hotel_list.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Get list of hotels by a geocode 12 | ''' 13 | response = amadeus.reference_data.locations.hotels.by_geocode.get(longitude=2.160873,latitude=41.397158) 14 | 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations/iOS SDK/AirportCitySearch.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Get a specific city or airport based on its id 9 | amadeus.referenceData.location(locationId: "CMUC").get(onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /flight_order_management/v1/delete/Python SDK/flight_order_management.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | # Delete a given flight order based on it's id 12 | ''' 13 | response = amadeus.booking.flight_order('MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy').delete() 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/Python SDK/points_of_interest.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Give me information about a place based on it's ID 12 | ''' 13 | response = amadeus.reference_data.locations.point_of_interest('9CB40CB5D0').get() 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/Python SDK/tours_and_activities.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Returns information of an activity from a given Id 12 | ''' 13 | response = amadeus.shopping.activity('3216547684').get() 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_cheapest_date_search/v1/get/Node SDK/flight_cheapest_date_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Find cheapest dates from Madrid to Munich 11 | const response = await amadeus.shopping.flightDates.get({ 12 | origin: "MAD", 13 | destination: "MUC", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/iOS SDK/ToursActivities.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.activities.get(params: ["latitude": "41.397158", 9 | "longitude": "2.160873"], 10 | onCompletion: { result in 11 | switch result { 12 | case let .success(response): 13 | print(response.data) 14 | case let .failure(error): 15 | fatalError(error.localizedDescription) 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /travel_redommendations/v1/get/iOS SDK/TravelRecommendations.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.referenceData.recommendedLocations.get(params: ["cityCodes": "PAR", 9 | "travelerCountryCode": "FR"], 10 | onCompletion: { result in 11 | switch result { 12 | case let .success(response): 13 | print(response.data) 14 | case let .failure(error): 15 | fatalError(error.localizedDescription) 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/Node SDK/points_of_interest.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Extract the information about point of interest with ID '9CB40CB5D0' 11 | const response = await amadeus.referenceData.locations 12 | .pointOfInterest("9CB40CB5D0") 13 | .get(); 14 | 15 | console.log(response); 16 | } catch (error) { 17 | console.error(error); 18 | } 19 | } 20 | 21 | main(); 22 | -------------------------------------------------------------------------------- /travel_redommendations/v1/get/Node SDK/travel_recommendations.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Recommended locations similar to PAR 11 | const response = await amadeus.referenceData.recommendedLocations.get({ 12 | cityCodes: "PAR", 13 | travelerCountryCode: "FR", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.log(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /hotel_search/v3/get/hotel_offers/Python SDK/hotel_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | # Get list of available offers in specific hotels by hotel ids 11 | hotels_by_city = amadeus.shopping.hotel_offers_search.get( 12 | hotelIds='RTPAR001', adults='2', checkInDate='2023-10-01', checkOutDate='2023-10-04') 13 | except ResponseError as error: 14 | raise error 15 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_geocode/Node SDK/hotel_list.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // List of hotels in Paris 11 | const response = await amadeus.referenceData.locations.hotels.byGeocode.get( 12 | { 13 | latitude: 48.83152, 14 | longitude: 2.24691, 15 | } 16 | ); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /on_demand_flight_status/v2/get/iOS SDK/OnDemandFlightStatus.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.schedule.flights.get(params:["carrierCode":"AZ", 9 | "flightNumber":"319", 10 | "scheduledDepartureDate":"2022-03-13"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/Node SDK/airport_and_city_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Which cities or airports start with ’r'? 11 | const response = await amadeus.referenceData.locations.get({ 12 | keyword: "r", 13 | subType: Amadeus.location.any, 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /airport_nearest_relevant_airport/v1/get/Python SDK/airport_nearest_relevant_airport.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What relevant airports are there around a specific location? 12 | ''' 13 | response = amadeus.reference_data.locations.airports.get(longitude=49.000, latitude=2.55) 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_most_booked_destinations/v1/get/Python SDK/flight_most_booked_destinations.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Where were people flying to from Madrid in the August 2017? 12 | ''' 13 | response = amadeus.travel.analytics.air_traffic.booked.get(originCityCode='MAD', period='2017-08') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/Node SDK/airport_on_time_performance.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Will there be a delay in the JFK airport on the 1st of September? 11 | const response = await amadeus.airport.predictions.onTime.get({ 12 | airportCode: "JFK", 13 | date: "2022-09-01", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/Python SDK/airport_on_time_performance.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Will there be a delay in the JFK airport on the 1st of December? 12 | ''' 13 | response = amadeus.airport.predictions.on_time.get( 14 | airportCode='JFK', date='2021-12-01') 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error 18 | -------------------------------------------------------------------------------- /city_search/v1/get/Node SDK/city_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Finds cities that match a specific word or string of letters. 11 | // Return a list of cities matching a keyword 'Paris' 12 | const response = await amadeus.referenceData.locations.cities.get({ 13 | keyword: "Paris", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /flight_insipiration_search/v1/get/Python SDK/flight_inspiration_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus/# Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Find cheapest destinations from Madrid 12 | ''' 13 | response = amadeus.shopping.flight_destinations.get(origin='MAD') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /airport_nearest_relevant_airport/v1/get/Node SDK/airport_nearest_relevant_airport.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What relevant airports are there around a specific location? 11 | const response = await amadeus.referenceData.locations.airports.get({ 12 | longitude: 2.55, 13 | latitude: 49.0, 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /airport_nearest_relevant_airport/v1/get/iOS SDK/AirportNearest.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Airport Nearest Relevant (for London) 9 | amadeus.referenceData.locations.airports.get(params: ["longitude": "49.0000", 10 | "latitude": "2.55"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /flight_most_traveled_destinations/v1/get/Python SDK/flight_most_traveled_destinations.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Where were people flying to from Madrid in the January 2017? 12 | ''' 13 | response = amadeus.travel.analytics.air_traffic.traveled.get(originCityCode='MAD', period='2017-01') 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/iOS SDK/FlightPriceAnalysis.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.analytics.itineraryPriceMetrics.get(params: ["originIataCode": "MAD", 9 | "destinationIataCode": "CDG", 10 | "departureDate": "2022-01-15"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /on_demand_flight_status/v2/get/Node SDK/on_demand_flight_status.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What's the current status of my flight? 11 | const response = await amadeus.schedule.flights.get({ 12 | carrierCode: "AZ", 13 | flightNumber: "319", 14 | scheduledDepartureDate: "2022-03-13", 15 | }); 16 | 17 | console.log(response); 18 | } catch (error) { 19 | console.error(error); 20 | } 21 | } 22 | 23 | main(); 24 | -------------------------------------------------------------------------------- /on_demand_flight_status/v2/get/Python SDK/on_demand_flight_status.py: -------------------------------------------------------------------------------- 1 | from amadeus import Client, ResponseError 2 | 3 | amadeus = Client( 4 | client_id='YOUR_AMADEUS_API_KEY', 5 | client_secret='YOUR_AMADEUS_API_SECRET' 6 | ) 7 | 8 | try: 9 | ''' 10 | Returns flight status of a given flight 11 | ''' 12 | response = amadeus.schedule.flights.get(carrierCode='AZ', 13 | flightNumber='319', 14 | scheduledDepartureDate='2022-03-13') 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error 18 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois/Python SDK/points_of_interest.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What are the popular places in Barcelona (based on a geo location and a radius) 12 | ''' 13 | response = amadeus.reference_data.locations.points_of_interest.get(latitude=41.397158, longitude=2.160873) 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/Python SDK/tours_and_activities.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Returns activities for a location in Barcelona based on geolocation coordinates 12 | ''' 13 | response = amadeus.shopping.activities.get(latitude=40.41436995, longitude=-3.69170868) 14 | print(response.data) 15 | except ResponseError as error: 16 | raise error 17 | -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/iOS SDK/AirportOnTime.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Percentage of on-time flight departures for JFK Airport 9 | amadeus.airport.predictions.onTime.get(params: ["airportCode": "JFK", 10 | "date": "2022-09-01"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/Node SDK/tous_activities.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Returns activities for a location in Barcelona based on geolocation coordinates 11 | const response = await amadeus.shopping.activities.get({ 12 | latitude: 41.397158, 13 | longitude: 2.160873, 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /flight_most_booked_destinations/v1/get/Node SDK/flight_most_booked_destinations.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Where were people flying to from Madrid in the August 2017? 11 | const response = await amadeus.travel.analytics.airTraffic.booked.get({ 12 | originCityCode: "MAD", 13 | period: "2017-08", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /hotel_search/v3/get/hotel_offers_offerId/Node SDK/hotel_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Check offer conditions of a specific offer id 11 | const response = await amadeus.shopping 12 | .hotelOfferSearch( 13 | "63A93695B58821ABB0EC2B33FE9FAB24D72BF34B1BD7D707293763D8D9378FC3" 14 | ) 15 | .get(); 16 | 17 | console.log(response); 18 | } catch (error) { 19 | console.error(error); 20 | } 21 | } 22 | 23 | main(); 24 | -------------------------------------------------------------------------------- /flight_busiest_traveling_period/v1/get/Python SDK/flight_busiest_traveling_period.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What were the busiest months for Madrid in 2022? 12 | ''' 13 | response = amadeus.travel.analytics.air_traffic.busiest_period.get( 14 | cityCode='MAD', period='2017', direction='ARRIVING') 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error 18 | -------------------------------------------------------------------------------- /flight_most_traveled_destinations/v1/get/Node SDK/flight_most_traveled_destinations.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Where were people flying to from Madrid in the January 2017? 11 | const response = await amadeus.travel.analytics.airTraffic.traveled.get({ 12 | originCityCode: "MAD", 13 | period: "2017-01", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /flight_offers_search/v2/get/Python SDK/flight_offers_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Find the cheapest flights from SYD to BKK 12 | ''' 13 | response = amadeus.shopping.flight_offers_search.get( 14 | originLocationCode='SYD', destinationLocationCode='BKK', departureDate='2022-07-01', adults=1) 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error 18 | -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/Node SDK/flight_price_analysis.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Am I getting a good deal on this flight? 11 | const response = await amadeus.analytics.itineraryPriceMetrics.get({ 12 | originIataCode: "MAD", 13 | destinationIataCode: "CDG", 14 | departureDate: "2022-01-13", 15 | }); 16 | 17 | console.log(response); 18 | } catch (error) { 19 | console.error(error); 20 | } 21 | } 22 | 23 | main(); 24 | -------------------------------------------------------------------------------- /hotel_ratings/v2/get/curl/hotel_ratings.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v2/e-reputation/hotel-sentiments?hotelIds=ADNYCCTB" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /seatmaps/v1/get/curl/seatmaps.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/shopping/seatmaps?flight-orderId=eJzTd9cPDPMwcooAAAtXAmE=" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/curl/airline_code_lookup.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/airlines?airlineCodes=BA" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /flight_most_traveled_destinations/v1/get/iOS SDK/FlightMostTraveledDestinations.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Flight Most Traveles Destinations 9 | amadeus.travel.analytics.airTraffic.traveled.get(params: ["originCityCode": "MAD", 10 | "period": "2017-01"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /hotel_name_autocomplete/v1/get/Python SDK/hotel_name_autocomplete.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from ast import keyword 3 | from amadeus import Client, ResponseError 4 | 5 | amadeus = Client( 6 | client_id='YOUR_AMADEUS_API_KEY', 7 | client_secret='YOUR_AMADEUS_API_SECRET' 8 | ) 9 | 10 | try: 11 | ''' 12 | Hotel name autocomplete for keyword 'PARI' using HOTEL_GDS category of search 13 | ''' 14 | response = amadeus.reference_data.locations.hotel.get(keyword='PARI', subType=[Hotel.HOTEL_GDS]) 15 | print(response.data) 16 | except ResponseError as error: 17 | raise error 18 | -------------------------------------------------------------------------------- /airline_routes/v1/get/Node SDK/airline_routes.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_AMADEUS_API_KEY", 5 | clientSecret: "YOUR_AMADEUS_API_SECRET", 6 | }); 7 | // Or `const amadeus = new Amadeus()` if the environment variables are set 8 | 9 | async function main() { 10 | try { 11 | // What are the destinations served by the British Airways (BA)? 12 | const response = await amadeus.airline.destinations.get({ 13 | airlineCode: "BA", 14 | }); 15 | 16 | console.log(response); 17 | } catch (error) { 18 | console.error(error); 19 | } 20 | } 21 | 22 | main(); 23 | -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/curl/flight_checkin_links.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airlineCode=BA" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/iOS SDK/ToursActivities.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.activities.bySquare.get(params: ["north": "41.397158", 9 | "west": "2.160873", 10 | "south": "41.394582", 11 | "east": "2.177181"], 12 | onCompletion: { result in 13 | switch result { 14 | case let .success(response): 15 | print(response.data) 16 | case let .failure(error): 17 | fatalError(error.localizedDescription) 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/cURL/airport_city_search.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations/ALHR" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/iOS SDK/AirportCitySearch.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | /// Find all the cities and airports starting by the keyword 'LON' 9 | amadeus.referenceData.locations.get(params: ["subType": "AIRPORT,CITY", 10 | "keyword": "LON"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /flight_busiest_traveling_period/v1/get/iOS SDK/FlightBusiestPeriod.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Flight Busiest Traveling Period 9 | amadeus.travel.analytics.airTraffic.busiestPeriod.get(params: ["cityCode": "MAD", 10 | "period": "2017", 11 | "direction": "ARRIVING"], 12 | onCompletion: { result in 13 | switch result { 14 | case let .success(response): 15 | print(response.data) 16 | case let .failure(error): 17 | fatalError(error.localizedDescription) 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /flight_insipiration_search/v1/get/curl/flight_inspiration_search.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/shopping/flight-destinations?origin=MAD" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois/iOS SDK/PointsOfInterest.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // What are the popular places in Barcelona? 9 | amadeus.referenceData.locations.pointsOfInterest.get(params: ["latitude": "41.397158", 10 | "longitude": "2.160873", 11 | "radius": "2"], 12 | onCompletion: { result in 13 | switch result { 14 | case let .success(response): 15 | print(response.data) 16 | case let .failure(error): 17 | fatalError(error.localizedDescription) 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations/Python SDK/airport_and_city_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | from amadeus import Location 4 | 5 | amadeus = Client( 6 | client_id='YOUR_AMADEUS_API_KEY', 7 | client_secret='YOUR_AMADEUS_API_SECRET' 8 | ) 9 | 10 | try: 11 | ''' 12 | Which cities or airports start with 'r'? 13 | ''' 14 | response = amadeus.reference_data.locations.get(keyword='r', 15 | subType=Location.ANY) 16 | print(response.data) 17 | except ResponseError as error: 18 | raise error 19 | -------------------------------------------------------------------------------- /flight_offers_search/v2/get/Node SDK/flight_offers_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Find the cheapest flights from SYD to BKK 11 | const response = await amadeus.shopping.flightOffersSearch.get({ 12 | originLocationCode: "SYD", 13 | destinationLocationCode: "BKK", 14 | departureDate: "2022-08-01", 15 | adults: "2", 16 | }); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois/Node SDK/points_of_interest.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What are the popular places in Barcelona (based on a geo location and a radius) 11 | const response = await amadeus.referenceData.locations.pointsOfInterest.get( 12 | { 13 | latitude: 41.397158, 14 | longitude: 2.160873, 15 | } 16 | ); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /flight_cheapest_date_search/v1/get/curl/flight_cheapest_date_search.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/shopping/flight-dates?origin=MAD&destination=MUC" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /hotel_search/v3/get/hotel_offers/Node SDK/hotel_search.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Get list of available offers in specific hotels by hotel ids 11 | const response = await amadeus.shopping.hotelOffersSearch.get({ 12 | hotelIds: "RTPAR001", 13 | adults: "2", 14 | checkInDate: "2023-10-10", 15 | checkOutDate: "2023-10-12", 16 | }); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /flight_order_management/v1/get/curl/flight_order_management.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/booking/flight-orders/MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/Node SDK/tours_activities.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Extract the information about an activity with ID '56777' 11 | const response = await amadeus.shopping.activity("56777").get({ 12 | north: 41.397158, 13 | west: 2.160873, 14 | south: 41.394582, 15 | east: 2.177181, 16 | }); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations/cURL/airport_city_search.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations?subType=AIRPORT,CITY&keyword=r" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/Python SDK/airport_and_city_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | from amadeus import Location 4 | 5 | amadeus = Client( 6 | client_id='YOUR_AMADEUS_API_KEY', 7 | client_secret='YOUR_AMADEUS_API_SECRET' 8 | ) 9 | 10 | try: 11 | ''' 12 | Which cities or airports start with 'r'? 13 | ''' 14 | response = amadeus.reference_data.locations.get(keyword='r', 15 | subType=Location.ANY) 16 | print(response.data) 17 | except ResponseError as error: 18 | raise error 19 | -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/curl/airport_on_time_performance.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/airport/predictions/on-time?airportCode=JFK&date=2022-09-01" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /flight_order_management/v1/delete/curl/flight_order_management.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X DELETE "https://test.api.amadeus.com/v1/booking/flight-orders/MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /location_score/v1/get/cURL/location_score.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/location/analytics/category-rated-areas?latitude=41.397158&longitude=2.160873" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /flight_offers_search/v2/get/iOS SDK/FlightOffersSearch.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.shopping.flightOffersSearch.get(params: ["originLocationCode": "MAD", 9 | "destinationLocationCode": "BER", 10 | "departureDate": "2022-09-16", 11 | "returnDate": "2022-09-30", 12 | "adults": "2"], 13 | onCompletion: { result in 14 | switch result { 15 | case let .success(response): 16 | print(response.data) 17 | case let .failure(error): 18 | fatalError(error.localizedDescription) 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /travel_redommendations/v1/get/cURL/travel_recommendations.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/recommended-locations?cityCodes=PAR&travelerCountryCode=FR" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /flight_busiest_traveling_period/v1/get/Node SDK/flight_busiest_traveling_period.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What were the busiest months for Madrid in 2017? 11 | const response = 12 | await amadeus.travel.analytics.airTraffic.busiestPeriod.get({ 13 | cityCode: "MAD", 14 | period: "2017", 15 | direction: Amadeus.direction.arriving, 16 | }); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /flight_most_booked_destinations/v1/get/iOs SDK/FlightMostBookedDestinations.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // Flight Most Booked Destinations 9 | amadeus.travel.analytics.airTraffic.booked.get(params: ["originCityCode": "MAD", 10 | "period": "2017-08"], 11 | onCompletion: { result in 12 | switch result { 13 | case let .success(response): 14 | print(response.data) 15 | case let .failure(error): 16 | fatalError(error.localizedDescription) 17 | } 18 | }) 19 | -------------------------------------------------------------------------------- /airport_nearest_relevant_airport/v1/get/curl/airport_nearest_relevant_airport.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations/airports?latitude=49.0000&longitude=2.55" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /on_demand_flight_status/v2/get/cURL/on_demand_flight_status.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v2/schedule/flights?carrierCode=AZ&flightNumber=319&scheduledDepartureDate=2022-03-13" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/Node SDK/tours_activities.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What are the best tours and activities in Barcelona? (based on a Square) 11 | const response = await amadeus.shopping.activities.bySquare.get({ 12 | north: 41.397158, 13 | west: 2.160873, 14 | south: 41.394582, 15 | east: 2.177181, 16 | }); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /airline_routes/v1/get/cURL/airline_routes.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # What are the destinations served by the British Airways (BA)? 9 | curl -X GET "https://test.api.amadeus.com/v1/airline/destinations?airlineCode=BA" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /flight_most_booked_destinations/v1/get/curl/flight_most_booked_destinations.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/booked?originCityCode=MAD&period=2017-08" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/cURL/by_id.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # Give me information about a POI based on it's Id 9 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations/pois/9CB40CB5D0" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/Node SDK/trip_purpose_prediction.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // The passenger is traveling for leisure or business? 11 | const response = await amadeus.travel.predictions.tripPurpose.get({ 12 | originLocationCode: "NYC", 13 | destinationLocationCode: "MAD", 14 | departureDate: "2022-08-01", 15 | returnDate: "2022-08-12", 16 | }); 17 | 18 | console.log(response); 19 | } catch (error) { 20 | console.error(error); 21 | } 22 | } 23 | 24 | main(); 25 | -------------------------------------------------------------------------------- /flight_most_traveled_destinations/v1/get/curl/flight_most_traveled_destinations.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/traveled?originCityCode=MAD&period=2017-01" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /hotel_name_autocomplete/v1/get/Node SDK/hotel_name_autocomplete.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | // Or `const amadeus = new Amadeus()` if the environment variables are set 8 | 9 | async function main() { 10 | try { 11 | // Hotel name autocomplete for keyword 'PARI' using HOTEL_GDS category of search 12 | const response = await amadeus.referenceData.locations.hotel.get({ 13 | keyword: "PARI", 14 | subType: "HOTEL_GDS", 15 | }); 16 | 17 | console.log(response); 18 | } catch (error) { 19 | console.error(error); 20 | } 21 | } 22 | 23 | main(); 24 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_by_square/Node SDK/points_of_interest.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // What are the popular places in Barcelona? (based on a square) 11 | const response = 12 | await amadeus.referenceData.locations.pointsOfInterest.bySquare.get({ 13 | north: 41.397158, 14 | west: 2.160873, 15 | south: 41.394582, 16 | east: 2.177181, 17 | }); 18 | 19 | console.log(response); 20 | } catch (error) { 21 | console.error(error); 22 | } 23 | } 24 | 25 | main(); 26 | -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/iOS SDK/TripPurposePrediction.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.travel.predictions.tripPurpose.get(params: ["originLocationCode": "NYC", 9 | "destinationLocationCode": "MAD", 10 | "departureDate": "2022-08-01", 11 | "returnDate": "2022-08-12", 12 | "searchDate": "2022-06-11"], 13 | onCompletion: { result in 14 | switch result { 15 | case let .success(response): 16 | print(response.data) 17 | case let .failure(error): 18 | fatalError(error.localizedDescription) 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /flight_busiest_traveling_period/v1/get/curl/flight_busiest_traveling_period.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/travel/analytics/air-traffic/traveled?originCityCode=MAD&period=2017-01&direction=ARRIVING" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/cURL/tours_activities.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # Returns information of an activity from a given Id 9 | curl -X GET "https://test.api.amadeus.com/v1/shopping/activities/3216547684" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_by_square/iOS SDK/PointsOfInterest.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | // What are the popular places in Barcelona? (based on a square) 9 | amadeus.referenceData.locations.pointsOfInterest.bySquare.get(params: ["north": "41.397158", 10 | "west": "2.160873", 11 | "south": "41.394582", 12 | "east": "2.177181"], 13 | onCompletion: { result in 14 | switch result { 15 | case let .success(response): 16 | print(response.data) 17 | case let .failure(error): 18 | fatalError(error.localizedDescription) 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/cURL/flight_price_analysis.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/analytics/itinerary-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2022-03-21¤cyCode=EUR&oneWay=false" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_hotels/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "chainCode": "AR", 5 | "iataCode": "PAR", 6 | "dupeId": 700222594, 7 | "name": "AC BY MARRIOTT PORTE MAILLOT", 8 | "hotelId": "ARPARARA", 9 | "geoCode": { 10 | "latitude": 48.88202, 11 | "longitude": 2.28223 12 | }, 13 | "address": { 14 | "countryCode": "FR" 15 | } 16 | } 17 | ], 18 | "meta": { 19 | "count": 1, 20 | "links": { 21 | "self": "http://test.api.amadeus.com/reference-data/locations/hotels/by-hotels?hotelIds=ARPARARA" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/Python SDK/flight_price_analysis.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Returns price metrics of a given itinerary 12 | ''' 13 | response = amadeus.analytics.itinerary_price_metrics.get(originIataCode='MAD', 14 | destinationIataCode='CDG', 15 | departureDate='2022-03-21') 16 | print(response.data) 17 | except ResponseError as error: 18 | raise error 19 | -------------------------------------------------------------------------------- /flight_choice_prediction/v2/post/Node SDK/flight_choice_prediction.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | const flightOffersResponse = await amadeus.shopping.flightOffersSearch.get({ 11 | originLocationCode: "SYD", 12 | destinationLocationCode: "BKK", 13 | departureDate: "2022-08-01", 14 | adults: "2", 15 | }); 16 | const response = await amadeus.shopping.flightOffers.prediction.post( 17 | flightOffersResponse 18 | ); 19 | console.log(response.data); 20 | } catch (error) { 21 | console.error(error); 22 | } 23 | } 24 | 25 | main(); 26 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois/cURL/by_coords.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # What are the popular places in Barcelona (based on a geo location and a radius) 9 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations/pois?latitude=41.397158&longitude=2.160873" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /flight_offers_search/v2/get/curl/flight_offers_search.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=SYD&destinationLocationCode=BKK&departureDate=2022-08-01&returnDate=2022-08-05&adults=2&includedAirlineCodes=TG&max=3" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/cURL/tours_activities.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # # What are the best activities in Barcelona? (based on a geolocation) 9 | curl -X GET "https://test.api.amadeus.com/v1/shopping/activities/longitude=-3.69170868&latitude=40.41436995&radius=1" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/curl/trip_purpose_prediction.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2022-08-01&returnDate=2022-08-12&searchDate=2022-06-11" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/iOS SDK/AirlineCodeLookup.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.referenceData.airLines.get(params: ["airlineCodes": "BA"], 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_by_square/cURL/by_sqare.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # What are the popular places in Barcelona (based on a square) 9 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations/pois/by-square?north=41.397158&west=2.160873&south=41.394582&east=2.177181" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /transfer_management/v1/post/curl/transfer_management.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \ 9 | -H "Content-Type: application/json" \ 10 | https://test.api.amadeus.com/v1/ordering/transfer-orders/VEg0Wk43fERPRXwyMDIzLTA2LTE1VDE1OjUwOjE4/transfers/cancellation?confirmNbr=12029761' \ 11 | -d '' -------------------------------------------------------------------------------- /seatmaps/v1/post/Node SDK/seatmaps.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Returns all the seat maps of a given flightOffer 11 | const flightOffersResponse = await amadeus.shopping.flightOffersSearch.get({ 12 | originLocationCode: "SYD", 13 | destinationLocationCode: "BKK", 14 | departureDate: "2022-08-01", 15 | adults: "2", 16 | }); 17 | 18 | const response = await amadeus.shopping.seatmaps.post({ 19 | data: [flightOffersResponse.data[0]], 20 | }); 21 | 22 | console.log(response); 23 | } catch (error) { 24 | console.error(error); 25 | } 26 | } 27 | 28 | main(); 29 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/cURL/tours_activities.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # What are the best activities in Barcelona? (based on a square) 9 | curl -X GET "https://test.api.amadeus.com/v1/shopping/activities/by-square?north=43.645218&west=7.182018&south=43.760768&east=7.323896" -H "Authorization: Bearer $ACCESS_TOKEN" -k -------------------------------------------------------------------------------- /hotel_name_autocomplete/v1/get/cURL/hotel_name_autocompletion.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | # Hotel name autocomplete for keyword 'PARI' using HOTEL_GDS category of search 9 | curl -X GET "https://test.api.amadeus.com/v1/reference-data/locations/hotel?keyword=PARI&subType=HOTEL_LEISURE&subType=HOTEL_GDS" -H "Authorization: Bearer $ACCESS_TOKEN" -k 10 | -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/Python SDK/trip_purpose_prediction.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | The passenger is traveling for leisure or business? 12 | ''' 13 | response = amadeus.travel.predictions.trip_purpose.get(originLocationCode='NYC', destinationLocationCode='MAD', 14 | departureDate='2022-08-01', returnDate='2022-08-12', 15 | searchDate='2022-06-11') 16 | print(response.data) 17 | except ResponseError as error: 18 | raise error 19 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/Python SDK/tours_and_activities.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import ResponseError, Client 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Returns activities in Barcelona within a designated area 12 | ''' 13 | response = amadeus.shopping.activities.by_square.get(north=41.397158, 14 | west=2.160873, 15 | south=41.394582, 16 | east=2.177181) 17 | print(response.data) 18 | except ResponseError as error: 19 | raise error 20 | -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/iOS SDK/FlightCheckinLinks.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.referenceData.urls.checkinLinks.get(params: ["airlineCode": "BA"], 9 | onCompletion: { result in 10 | switch result { 11 | case let .success(response): 12 | print(response.data) 13 | case let .failure(error): 14 | fatalError(error.localizedDescription) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/curl/flight_delay_prediction.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X GET "https://test.api.amadeus.com/v1/travel/predictions/flight-delay?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" -H "Authorization: Bearer $ACCESS_TOKEN" -k 9 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "type": "location", 4 | "subType": "POINT_OF_INTEREST", 5 | "id": "9CB40CB5D0", 6 | "self": { 7 | "href": "https://test.api.amadeus.com/v1/reference-data/locations/pois/9CB40CB5D0", 8 | "methods": [ 9 | "GET" 10 | ] 11 | }, 12 | "geoCode": { 13 | "latitude": 41.39165, 14 | "longitude": 2.164772 15 | }, 16 | "name": "Casa Batlló", 17 | "category": "SIGHTS", 18 | "rank": 1, 19 | "tags": [ 20 | "sightseeing", 21 | "sights", 22 | "museum", 23 | "landmark", 24 | "tourguide", 25 | "restaurant", 26 | "attraction", 27 | "activities", 28 | "commercialplace", 29 | "shopping", 30 | "souvenir" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /city_search/v1/get/Java SDK/CitySearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.City; 6 | 7 | public class CitySearch { 8 | 9 | public static void main(String[] args) throws ResponseException { 10 | Amadeus amadeus = Amadeus 11 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 12 | .build(); 13 | 14 | City[] cities = amadeus.referenceData.locations.cities.get( 15 | Params.with("keyword","PARIS") 16 | ); 17 | 18 | if (cities[0].getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + cities[0].getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | 23 | System.out.println(cities[0]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/iOS SDK/FlightDelayPrediction.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | amadeus.travel.predictions.flightDelay.get(data: ["originLocationCode": "NCE", 9 | "destinationLocationCode": "IST", 10 | "departureDate": "2022-05-01", 11 | "departureTime": "18:20:00", 12 | "arrivalDate": "2022-05-01", 13 | "arrivalTime": "22:15:00", 14 | "aircraftCode": "321", 15 | "carrierCode": "TK", 16 | "flightNumber": "1816", 17 | "duration": "PT31H10M"], 18 | onCompletion: { result in 19 | switch result { 20 | case let .success(response): 21 | print(response.data) 22 | case let .failure(error): 23 | fatalError(error.localizedDescription) 24 | } 25 | }) 26 | 27 | -------------------------------------------------------------------------------- /hotel_search/v3/get/hotel_offers_offerId/Java SDK/HotelSearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.HotelOfferSearch; 6 | 7 | public class HotelSearch { 8 | 9 | public static void main(String[] args) throws ResponseException { 10 | Amadeus amadeus = Amadeus 11 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 12 | .build(); 13 | 14 | HotelOfferSearch offer = amadeus.shopping.hotelOfferSearch( 15 | "0W7UU1NT9B") 16 | .get(); 17 | 18 | if (offer.getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + offer.getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | 23 | System.out.println(offer); 24 | } 25 | } -------------------------------------------------------------------------------- /seatmaps/v1/post/Python SDK/seatmaps.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Retrieve the seat map of a given flight offer 12 | ''' 13 | body = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD', 14 | destinationLocationCode='NYC', 15 | departureDate='2022-11-01', 16 | adults=1, 17 | max=1).result 18 | response = amadeus.shopping.seatmaps.post(body) 19 | print(response.data) 20 | except ResponseError as error: 21 | raise error 22 | -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/Node SDK/flight_delay_prediction.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Will there be a delay from BRU to FRA? If so how much delay? 11 | const response = await amadeus.travel.predictions.flightDelay.get({ 12 | originLocationCode: "NCE", 13 | destinationLocationCode: "IST", 14 | departureDate: "2022-08-01", 15 | departureTime: "18:20:00", 16 | arrivalDate: "2022-08-01", 17 | arrivalTime: "22:15:00", 18 | aircraftCode: "321", 19 | carrierCode: "TK", 20 | flightNumber: "1816", 21 | duration: "PT31H10M", 22 | }); 23 | 24 | console.log(response); 25 | } catch (error) { 26 | console.error(error); 27 | } 28 | } 29 | 30 | main(); 31 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_by_square/Python SDK/points_of_interest.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | What are the popular places in Barcelona? (based on a square) 12 | ''' 13 | response = amadeus.reference_data.locations.points_of_interest.by_square.get(north=41.397158, 14 | west=2.160873, 15 | south=41.394582, 16 | east=2.177181) 17 | print(response.data) 18 | except ResponseError as error: 19 | raise error 20 | -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_city/Java SDK/HotelList.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Hotel; 7 | 8 | public class HotelList { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Hotel[] hotels = amadeus.referenceData.locations.hotels.byCity.get( 16 | Params.with("cityCode", "PAR")); 17 | 18 | if (hotels[0].getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + hotels[0].getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | 23 | System.out.println(hotels[0]); 24 | } 25 | } -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_hotels/Java SDK/HotelList.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Hotel; 7 | 8 | public class HotelList { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Hotel[] hotels = amadeus.referenceData.locations.hotels.byHotels.get( 16 | Params.with("hotelIds", "ARPARARA")); 17 | 18 | if (hotels[0].getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + hotels[0].getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | 23 | System.out.println(hotels[0]); 24 | } 25 | } -------------------------------------------------------------------------------- /flight_order_management/v1/get/Java SDK/FlightOrderManagement.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.booking.FlightOrder; 5 | import com.amadeus.exceptions.ResponseException; 6 | 7 | public class FlightOrderManagement { 8 | public static void main(String[] args) throws ResponseException { 9 | 10 | Amadeus amadeus = Amadeus 11 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMAEUS_API_SECRET") 12 | .build(); 13 | 14 | com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder("MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy").get(); 15 | 16 | if (order.getResponse().getStatusCode() != 200) { 17 | System.out.println("Wrong status code: " + order.getResponse().getStatusCode()); 18 | System.exit(-1); 19 | } 20 | 21 | System.out.println(order); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/Java SDK/AirlineCodeLookup.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Airline; 7 | 8 | public class AirlineCodeLookup { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | Airline[] airlines = amadeus.referenceData.airlines.get(Params 17 | .with("airlineCodes", "BA")); 18 | 19 | if (airlines[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + airlines[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println(airlines); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /flight_order_management/v1/delete/Java SDK/FlightOrderManagement.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.booking.FlightOrder; 5 | import com.amadeus.exceptions.ResponseException; 6 | 7 | public class FlightOrderManagement { 8 | public static void main(String[] args) throws ResponseException { 9 | 10 | Amadeus amadeus = Amadeus 11 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS)API_SECRET") 12 | .build(); 13 | 14 | com.amadeus.resources.FlightOrder order = amadeus.booking.flightOrder("MlpZVkFMfFdBVFNPTnwyMDE1LTExLTAy").delete(); 15 | 16 | if (order.getResponse().getStatusCode() != 200) { 17 | System.out.println("Wrong status code: " + order.getResponse().getStatusCode()); 18 | System.exit(-1); 19 | } 20 | 21 | System.out.println(order); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/Java SDK/ToursActivities.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Activity; 7 | 8 | 9 | public class ToursActivities { 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Activity tour = amadeus.shopping.activity("3216547684").get(); 16 | 17 | if(tour.getResponse().getStatusCode() != 200) { 18 | System.out.println("Wrong status code: " + tour.getResponse().getStatusCode()); 19 | System.exit(-1); 20 | } 21 | System.out.println(tour); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/Java SDK/AirportOnTime.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.OnTime; 7 | 8 | public class AirportOnTime { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | OnTime onTime = amadeus.airport.predictions.onTime.get(Params 17 | .with("airportCode", "JFK") 18 | .and("date", "2022-09-01")); 19 | 20 | if(onTime.getResponse().getStatusCode() != 200) { 21 | System.out.println("Wrong status code: " + onTime.getResponse().getStatusCode()); 22 | System.exit(-1); 23 | } 24 | System.out.println(onTime); 25 | } 26 | } -------------------------------------------------------------------------------- /hotel_list/v1/get/hotels_by_geocode/Java SDK/HotelList.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Hotel; 7 | 8 | public class HotelList { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Hotel[] hotels = amadeus.referenceData.locations.hotels.byGeocode.get( 16 | Params.with("latitude", 48.83152) 17 | .and("longitude", 2.24691)); 18 | 19 | if (hotels[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + hotels[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println(hotels[0]); 25 | } 26 | } -------------------------------------------------------------------------------- /airport_routes/v1/get/Java SDK/AirportRoutes.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Destination; 7 | 8 | public class AirportRoutes { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Destination[] directDestinations = amadeus.airport.directDestinations.get( 16 | Params.with("departureAirportCode", "MAD")); 17 | 18 | if (directDestinations[0].getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + directDestinations[0].getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | 23 | System.out.println(directDestinations[0]); 24 | } 25 | } -------------------------------------------------------------------------------- /airline_code_lookup/v1/get/Android SDK/AirlineCodeLookup.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val airlines = amadeus.referenceData.airlines.get(airlineCodes = "BA")) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_availabilities_search/v1/post/Node SDK/flight_availabilities.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | const response = 11 | await amadeus.shopping.availability.flightAvailabilities.post({ 12 | originDestinations: [ 13 | { 14 | id: "1", 15 | originLocationCode: "MIA", 16 | destinationLocationCode: "ATL", 17 | departureDateTime: { 18 | date: "2022-11-01", 19 | }, 20 | }, 21 | ], 22 | travelers: [ 23 | { 24 | id: "1", 25 | travelerType: "ADULT", 26 | }, 27 | ], 28 | sources: ["GDS"], 29 | }); 30 | console.log(response); 31 | } catch (error) { 32 | console.error(error); 33 | } 34 | } 35 | 36 | main(); 37 | -------------------------------------------------------------------------------- /flight_offers_price/v1/post/Python SDK/flight_offers_price.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Confirm availability and price from SYD to BKK in summer 2022 12 | ''' 13 | flights = amadeus.shopping.flight_offers_search.get(originLocationCode='SYD', destinationLocationCode='BKK', 14 | departureDate='2022-07-01', adults=1).data 15 | response_one_flight = amadeus.shopping.flight_offers.pricing.post( 16 | flights[0]) 17 | print(response_one_flight.data) 18 | 19 | response_two_flights = amadeus.shopping.flight_offers.pricing.post( 20 | flights[0:2]) 21 | print(response_two_flights.data) 22 | except ResponseError as error: 23 | raise error 24 | -------------------------------------------------------------------------------- /hotel_search/v3/get/hotel_offers/Java SDK/HotelSearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.HotelOfferSearch; 7 | 8 | public class HotelSearch { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | HotelOfferSearch[] offers = amadeus.shopping.hotelOffersSearch.get( 16 | Params.with("hotelIds", "RTPAR001") 17 | .and("adults", 2) 18 | ); 19 | 20 | if (offers[0].getResponse().getStatusCode() != 200) { 21 | System.out.println("Wrong status code: " + offers[0].getResponse().getStatusCode()); 22 | System.exit(-1); 23 | } 24 | 25 | System.out.println(offers[0]); 26 | } 27 | } -------------------------------------------------------------------------------- /seatmaps/v1/get/Android SDK/SeatMaps.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val seatMap = amadeus.shopping.seatMaps.get(flightOfferId = "eJzTd9f3NjIJdzUGAAp%2fAiY=")) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations/Java SDK/AirportCitySearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Location; 7 | 8 | public class AirportCitySearch { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // Get a specific city or airport based on its id 17 | Location location = amadeus.referenceData 18 | .location("ALHR").get(); 19 | 20 | if(location.getResponse().getStatusCode() != 200) { 21 | System.out.println("Wrong status code: " + location.getResponse().getStatusCode()); 22 | System.exit(-1); 23 | } 24 | 25 | System.out.println(location); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/Java SDK/FlightCheckinLinks.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.CheckinLink; 7 | 8 | public class FlightCheckinLinks { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | CheckinLink[] checkinLinks = amadeus.referenceData.urls.checkinLinks.get(Params 17 | .with("airlineCode", "BA")); 18 | 19 | if(checkinLinks[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + (checkinLinks[0].getResponse().getStatusCode())); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println((checkinLinks[0])); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /flight_choice_prediction/v2/post/Python SDK/flight_choice_prediction.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Find the probability of the flight MAD to NYC to be chosen 12 | ''' 13 | body = amadeus.shopping.flight_offers_search.get(originLocationCode='MAD', 14 | destinationLocationCode='NYC', 15 | departureDate='2022-11-01', 16 | returnDate='2022-11-09', 17 | adults=1).result 18 | response = amadeus.shopping.flight_offers.prediction.post(body) 19 | print(response.data) 20 | except ResponseError as error: 21 | raise error 22 | -------------------------------------------------------------------------------- /flight_order_management/v1/delete/Android SDK/FlightOrderManagement.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (amadeus.booking.flightOrder("eJzTd9f3NjIJdzUGAAp%2fAiY=").delete()) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/Android SDK/AirportCitySerch.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val location = amadeus.referenceData.location("ALHR").get()) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_cheapest_date_search/v1/get/Java SDK/FlightCheapestDate.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightDate; 7 | 8 | public class FlightCheapestDate { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | FlightDate[] flightDates = amadeus.shopping.flightDates.get(Params 17 | .with("origin", "MAD") 18 | .and("destination", "MUC")); 19 | 20 | if(flightDates[0].getResponse().getStatusCode() != 200) { 21 | System.out.println("Wrong status code: " + (flightDates[0].getResponse().getStatusCode()); 22 | System.exit(-1); 23 | } 24 | System.out.println((flightDates[0]); 25 | } 26 | } -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/Android SDK/FlightCheckinLinks.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val checkinLinks = amadeus.referenceData.urls.checkinLinks.get(airlineCode = "LH")) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_order_management/v1/get/Android SDK/FlightOrderManagement.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val flightOffer = amadeus.booking.flightOrder("eJzTd9f3NjIJdzUGAAp%2fAiY=").get()) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/Android SDK/tours_and_activities.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val activity = amadeus.shopping.activity("23642").get()) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_cheapest_date_search/v1/get/Android SDK/FlightCheapestDate.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val flightDates = amadeus.shopping.flightDates.get(origin = "MAD", destination = "MUC")) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_insipiration_search/v1/get/Android SDK/FlightInspirationSearch.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val flightDestinations = amadeus.shopping.flightDestinations.get(origin = "MAD")) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hotel_ratings/v2/get/Android SDK/HotelRatings.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val hotelSentiments = amadeus.ereputation.hotelSentiments.get(listOf("TELONMFS","ADNYCCTB","XXXYYY01"))) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hotel_ratings/v2/get/Java SDK/HotelRatings.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.HotelSentiment; 7 | 8 | public class HotelRatings { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMAEUS_API_SECRET") 14 | .build(); 15 | 16 | // Hotel Ratings / Sentiments 17 | HotelSentiment[] hotelSentiments = amadeus.ereputation.hotelSentiments.get(Params.with("hotelIds", "ADNYCCTB")); 18 | 19 | if (hotelSentiments[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + hotelSentiments[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println(hotelSentiments[0]); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/Android SDK/PointOfInterest.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val pointOfInterest = amadeus.referenceData.locations.pointsOfInterest("9CB40CB5D0").get()) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_insipiration_search/v1/get/Java SDK/FlightInspirationSearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightDestination; 7 | 8 | public class FlightInspirationSearch { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | FlightDestination[] flightDestinations = amadeus.shopping.flightDestinations.get(Params 17 | .with("origin", "MAD")); 18 | 19 | if (flightDestinations[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + flightDestinations[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println(flightDestinations[0]); 25 | } 26 | } -------------------------------------------------------------------------------- /flight_offers_price/v1/post/Node SDK/flight_offers_price.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_API_KEY", 5 | clientSecret: "YOUR_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Confirm availability and price from MAD to ATH in summer 2024 11 | const flightOffersResponse = await amadeus.shopping.flightOffersSearch.get({ 12 | originLocationCode: "MAD", 13 | destinationLocationCode: "ATH", 14 | departureDate: "2024-07-01", 15 | adults: "1", 16 | }); 17 | 18 | const response = await amadeus.shopping.flightOffers.pricing.post( 19 | { 20 | data: { 21 | type: "flight-offers-pricing", 22 | flightOffers: [flightOffersResponse.data[0]], 23 | }, 24 | }, 25 | { include: "credit-card-fees,detailed-fare-rules" } 26 | ); 27 | console.log(response); 28 | } catch (error) { 29 | console.error(error); 30 | } 31 | } 32 | 33 | main(); 34 | -------------------------------------------------------------------------------- /airport_nearest_relevant_airport/v1/get/Java SDK/AirportNearest.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Location; 7 | 8 | public class AirportNearest { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_API_ID","YOUR_API_SECRET") 14 | .build(); 15 | 16 | // Airport Nearest Relevant (for London) 17 | Location[] locations = amadeus.referenceData.locations.airports.get(Params 18 | .with("latitude", 49.0000) 19 | .and("longitude", 2.55)); 20 | 21 | if(locations[0].getResponse().getStatusCode() != 200) { 22 | System.out.println("Wrong status code: " + locations[0].getResponse().getStatusCode()); 23 | System.exit(-1); 24 | } 25 | System.out.println(locations[0]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /travel_redommendations/v1/get/Android SDK/travel_recommendations.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val recommendations = amadeus.referenceData.recommendedLocations.get(cityCodes = "PAR", travelerCountryCode = "FR")) { 21 | is ApiResult.Success -> { 22 | Log.d("Result", "${result.data}") 23 | } 24 | is ApiResult.Error -> { 25 | // Handle your error 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_poisId/Java SDK/PointsOfInterest.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.PointOfInterest; 7 | 8 | public class PointsOfInterest { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // Returns a single Point of Interest from a given id 17 | PointOfInterest pointOfInterest = amadeus.referenceData.locations.pointOfInterest("9CB40CB5D0").get(); 18 | 19 | if (pointsOfInterest[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + pointsOfInterest[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println(pointsOfInterest[0]); 25 | } 26 | } -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/Java SDK/ToursActivities.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Activity; 7 | 8 | 9 | public class ToursActivities { 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Activity[] activities = amadeus.shopping.activities.get(Params 16 | .with("latitude", "41.39715") 17 | .and("longitude", "2.160873")); 18 | 19 | if(activities[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + activities[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | System.out.println(activities[0]); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/Python SDK/flight_delay_prediction.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | ''' 11 | Will there be a delay from BRU to FRA? If so how much delay? 12 | ''' 13 | response = amadeus.travel.predictions.flight_delay.get(originLocationCode='NCE', destinationLocationCode='IST', 14 | departureDate='2022-08-01', departureTime='18:20:00', 15 | arrivalDate='2022-08-01', arrivalTime='22:15:00', 16 | aircraftCode='321', carrierCode='TK', 17 | flightNumber='1816', duration='PT31H10M') 18 | print(response.data) 19 | except ResponseError as error: 20 | raise error 21 | -------------------------------------------------------------------------------- /transfer_management/v1/post/Java SDK/TransferManagement.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | import com.amadeus.Amadeus; 3 | import com.amadeus.Params; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.TransferCancellation; 6 | 7 | public class TransferManagement { 8 | 9 | public static void main(String[] args) throws ResponseException { 10 | 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | Params params = Params.with("confirmNbr", "12029761"); 15 | 16 | TransferCancellation transfers = amadeus.ordering 17 | .transferOrder("VEg0Wk43fERPRXwyMDIzLTA2LTE1VDE1OjUwOjE4").transfers.cancellation.post(params); 18 | if (transfers.getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + transfers.getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | 23 | System.out.println(transfers); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /airport_on_time_performance/v1/get/Android SDK/AirportOnTime.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val airportOnTime = amadeus.airport.predictions.onTime.get( 21 | airportCode = "BOS", 22 | date = "2022-12-01")) { 23 | is ApiResult.Success -> { 24 | Log.d("Result", "${result.data}") 25 | } 26 | is ApiResult.Error -> { 27 | // Handle your error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /airport_nearest_relevant_airport/v1/get/Android SDK/AirportNearest.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val locations = amadeus.referenceData.locations.airports.get( 21 | latitude = 40.416775, 22 | longitude = -3.703790)) { 23 | is ApiResult.Success -> { 24 | Log.d("Result", "${result.data}") 25 | } 26 | is ApiResult.Error -> { 27 | // Handle your error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /airline_routes/v1/get/Java SDK/AirlineRoutes.java: -------------------------------------------------------------------------------- 1 | 2 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.Destination; 6 | 7 | // What are the destinations served by the British Airways (BA)? 8 | public class AirlineRoutes { 9 | public static void main(String[] args) throws ResponseException { 10 | 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | // Set query parameters 16 | Params params = Params 17 | .with("airlineCode", "BA"); 18 | 19 | // Run the query 20 | Destination[] destinations = amadeus.airline.destinations.get(params); 21 | 22 | if (destinations[0].getResponse().getStatusCode() != 200) { 23 | System.out.println("Wrong status code: " + destinations[0].getResponse().getStatusCode()); 24 | System.exit(-1); 25 | } 26 | 27 | System.out.println(destinations[0]); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois/Android SDK/PointsOfInterest.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.get( 21 | latitude = 41.397158, 22 | longitude = 2.160873)) { 23 | is ApiResult.Success -> { 24 | Log.d("Result", "${result.data}") 25 | } 26 | is ApiResult.Error -> { 27 | // Handle your error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flight_availabilities_search/v1/post/Python SDK/flight_availabilities_search.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | body = { 11 | "originDestinations": [ 12 | { 13 | "id": "1", 14 | "originLocationCode": "MIA", 15 | "destinationLocationCode": "ATL", 16 | "departureDateTime": { 17 | "date": "2022-11-01" 18 | } 19 | } 20 | ], 21 | "travelers": [ 22 | { 23 | "id": "1", 24 | "travelerType": "ADULT" 25 | } 26 | ], 27 | "sources": [ 28 | "GDS" 29 | ] 30 | } 31 | 32 | response = amadeus.shopping.availability.flight_availabilities.post(body) 33 | print(response.data) 34 | except ResponseError as error: 35 | raise error 36 | -------------------------------------------------------------------------------- /flight_most_booked_destinations/v1/get/Android SDK/FlightMostBookedDestinations.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val airTraffics = amadeus.travel.analytics.airTraffic.booked.get( 21 | originCityCode = "MAD", 22 | period = "2017-05")) { 23 | is ApiResult.Success -> { 24 | Log.d("Result", "${result.data}") 25 | } 26 | is ApiResult.Error -> { 27 | // Handle your error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flight_most_booked_destinations/v1/get/Java SDK/FlightMostBookedDestinations.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.AirTraffic; 7 | 8 | public class FlightMostBookedDestinations { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // Flight Most Booked Destinations 17 | AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.booked.get(Params 18 | .with("originCityCode", "MAD") 19 | .and("period", "2017-08")); 20 | 21 | if (airTraffics[0].getResponse().getStatusCode() != 200) { 22 | System.out.println("Wrong status code: " + airTraffics[0].getResponse().getStatusCode()); 23 | System.exit(-1); 24 | } 25 | 26 | System.out.println(airTraffics[0]); 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /flight_most_traveled_destinations/v1/get/Android SDK/FlightMostTraveledDestinations.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val airTraffics = amadeus.travel.analytics.airTraffic.traveled.get( 21 | originCityCode = "MAD", 22 | period = "2017-05")) { 23 | is ApiResult.Success -> { 24 | Log.d("Result", "${result.data}") 25 | } 26 | is ApiResult.Error -> { 27 | // Handle your error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /on_demand_flight_status/v2/get/Android SDK/on_demand_flight_status.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val status = amadeus.schedule.flights.get( 21 | carrierCode = "IB", 22 | flightNumber = "532", 23 | scheduleDepartureDate = "2022-11-23") { 24 | is ApiResult.Success -> { 25 | Log.d("Result", "${result.data}") 26 | } 27 | is ApiResult.Error -> { 28 | // Handle your error 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /flight_most_traveled_destinations/v1/get/Java SDK/FlightMostTraveledDestinations.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.AirTraffic; 7 | 8 | public class FlightMostTraveledDestinations { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // Flight Most Traveled Destinations 17 | AirTraffic[] airTraffics = amadeus.travel.analytics.airTraffic.traveled.get(Params 18 | .with("originCityCode", "MAD") 19 | .and("period", "2017-01")); 20 | 21 | if (airTraffics[0].getResponse().getStatusCode() != 200) { 22 | System.out.println("Wrong status code: " + airTraffics[0].getResponse().getStatusCode()); 23 | System.exit(-1); 24 | } 25 | 26 | System.out.println(airTraffics[0]); 27 | } 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /flight_offers_price/v1/post/iOS SDK/FlightOffersPrice.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | import Foundation 3 | import SwiftyJSON 4 | 5 | var amadeus: Amadeus = Amadeus( 6 | client_id: "YOUR_API_ID", 7 | client_secret: "YOUR_API_SECRET" 8 | ) 9 | 10 | // Build the body from the first flight offer returned by 11 | // Flight Offers Search API response array 12 | let jsonString: String = """ 13 | { 14 | 'data': { 15 | 'type': 'flight-offers-pricing', 16 | 'flightOffers': \(flightOffersSearchResponse.data[0]) 17 | } 18 | """ 19 | 20 | let dataFromString = jsonString.data(using: .utf8, allowLossyConversion: false) 21 | 22 | do { 23 | let body: JSON = try JSON(data: dataFromString!) 24 | 25 | amadeus.shopping.flightOffers.pricing.post(body: body, 26 | onCompletion: { result in 27 | switch result { 28 | case let .success(response): 29 | print(response.data) 30 | case let .failure(error): 31 | fatalError(error.localizedDescription) 32 | } 33 | }) 34 | } catch _ as NSError { 35 | assertionFailure("JSON not valid") 36 | } 37 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois/Java SDK/PointsOfInterest.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.PointOfInterest; 7 | 8 | public class PointsOfInterest { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_API_ID","YOUR_API_SECRET") 14 | .build(); 15 | 16 | // What are the popular places in Barcelona (based on a geolocation) 17 | PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.get(Params 18 | .with("latitude", "41.39715") 19 | .and("longitude", "2.160873")); 20 | 21 | if (pointsOfInterest[0].getResponse().getStatusCode() != 200) { 22 | System.out.println("Wrong status code: " + pointsOfInterest[0].getResponse().getStatusCode()); 23 | System.exit(-1); 24 | } 25 | 26 | System.out.println(pointsOfInterest[0]); 27 | } 28 | } -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/Android SDK/tours_and_activities.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val activities = amadeus.shopping.activities.get( 21 | latitude = 41.397158, 22 | longitude = 2.160873, 23 | radius = 2)) { 24 | is ApiResult.Success -> { 25 | Log.d("Result", "${result.data}") 26 | } 27 | is ApiResult.Error -> { 28 | // Handle your error 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/Android SDK/flight_price_analysis.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val analysis = amadeus.analytics.itineraryPriceMetrics.get( 21 | originIataCode = "MAD", 22 | destinationIataCode = "CDG", 23 | departureDate = "2022-03-21")) { 24 | is ApiResult.Success -> { 25 | Log.d("Result", "${result.data}") 26 | } 27 | is ApiResult.Error -> { 28 | // Handle your error 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations/Android SDK/AirportCitySearch.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val locations = amadeus.referenceData.locations.get( 21 | subType = listOf(Location.SubTypeEnum.AIRPORT.value, Location.SubTypeEnum.CITY.value), 22 | keyword = "LON")) { 23 | is ApiResult.Success -> { 24 | Log.d("Result", "${result.data}") 25 | } 26 | is ApiResult.Error -> { 27 | // Handle your error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flight_busiest_traveling_period/v1/get/Java SDK/FlightBusiestPeriod.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Period; 7 | 8 | public class FlightBusiestPeriod { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // Flight Busiest Traveling Period 17 | Period[] busiestPeriods = amadeus.travel.analytics.airTraffic.busiestPeriod.get(Params 18 | .with("cityCode", "MAD") 19 | .and("period", "2017") 20 | .and("direction", BusiestPeriod.ARRIVING)); 21 | 22 | if(busiestPeriods[0].getResponse().getStatusCode() != 200) { 23 | System.out.println("Wrong status code: " + (busiestPeriods[0].getResponse().getStatusCode()); 24 | System.exit(-1); 25 | } 26 | System.out.println((busiestPeriods[0]); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/Java SDK/FlightPriceAnalysis.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.ItineraryPriceMetric; 7 | 8 | public class FlightPriceAnalysis { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_API_ID","YOUR_API_SECRET") 14 | .build(); 15 | 16 | // What's the flight price analysis from MAD to CDG 17 | ItineraryPriceMetric[] metrics = amadeus.analytics.itineraryPriceMetrics.get(Params 18 | .with("originIataCode", "MAD") 19 | .and("destinationIataCode", "CDG") 20 | .and("departureDate", "2022-03-21")); 21 | 22 | if (metrics[0].getResponse().getStatusCode() != 200) { 23 | System.out.println("Wrong status code: " + metrics[0].getResponse().getStatusCode()); 24 | System.exit(-1); 25 | } 26 | 27 | System.out.println(metrics[0]); 28 | } 29 | } -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/Java SDK/ToursActivities.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Activity; 7 | 8 | 9 | public class ToursActivities { 10 | public static void main(String[] args) throws ResponseException { 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | Activity[] activities = amadeus.shopping.activities.get(Params 16 | .with("north", "41.397158") 17 | .and("west", "2.160873") 18 | .and("south", "41.394582") 19 | .and("east", "2.177181")); 20 | 21 | if(activities[0].getResponse().getStatusCode() != 200) { 22 | System.out.println("Wrong status code: " + activities[0].getResponse().getStatusCode()); 23 | System.exit(-1); 24 | } 25 | System.out.println(activities[0]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /flight_busiest_traveling_period/v1/get/Android SDK/FlightBusiestPeriod.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val busiestPeriods = amadeus.travel.analytics.airTraffic.busiestPeriod.get( 21 | cityCode = "MAD", 22 | period = "2017", 23 | direction = "ARRIVING")) { 24 | is ApiResult.Success -> { 25 | Log.d("Result", "${result.data}") 26 | } 27 | is ApiResult.Error -> { 28 | // Handle your error 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /on_demand_flight_status/v2/get/Java SDK/OnDemandFlightStatus.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.Response; 7 | import com.amadeus.resources.DatedFlight; 8 | 9 | public class OnDemandFlightStatus { 10 | 11 | public static void main(String[] args) throws ResponseException { 12 | 13 | Amadeus amadeus = Amadeus 14 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 15 | .build(); 16 | 17 | // Returns the status of a given flight 18 | DatedFlight[] flightStatus = amadeus.schedule.flights.get(Params 19 | .with("flightNumber", "319") 20 | .and("carrierCode", "AZ") 21 | .and("scheduledDepartureDate", "2022-03-13")); 22 | 23 | if (flightStatus[0].getResponse().getStatusCode() != 200) { 24 | System.out.println("Wrong status code: " + flightStatus[0].getResponse().getStatusCode()); 25 | System.exit(-1); 26 | } 27 | 28 | System.out.println(flightStatus[0]); 29 | } 30 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2017 Amadeus IT Group SA 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit 7 | persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the 10 | Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 13 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 14 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 15 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 16 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/Android SDK/tours_and_activities.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val activities = amadeus.shopping.activities.bySquare.get( 21 | north = 41.397158, 22 | west = 2.160873, 23 | south = 41.394582, 24 | east = 2.177181)) { 25 | is ApiResult.Success -> { 26 | Log.d("Result", "${result.data}") 27 | } 28 | is ApiResult.Error -> { 29 | // Handle your error 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /seatmaps/v1/get/Java SDK/SeatMaps.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.SeatMap; 7 | 8 | public class SeatMaps { 9 | public static void main(String[] args) throws ResponseException { 10 | 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | SeatMap[] seatmap = amadeus.shopping.seatMaps.get(Params 16 | .with("flight-orderId", "eJzTd9cPDPMwcooAAAtXAmE=")); 17 | if(seatmap.length != 0){ 18 | if (seatmap[0].getResponse().getStatusCode() != 200) { 19 | System.out.println("Wrong status code: " + seatmap[0].getResponse().getStatusCode()); 20 | System.exit(-1); 21 | } 22 | System.out.println(seatmap[0]); 23 | } 24 | else { 25 | System.out.println("No booking found for this flight-orderId"); 26 | System.exit(-1); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/Java SDK/AirportCitySearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.referenceData.Locations; 7 | import com.amadeus.resources.Location; 8 | 9 | public class AirportCitySearch { 10 | 11 | public static void main(String[] args) throws ResponseException { 12 | 13 | Amadeus amadeus = Amadeus 14 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 15 | .build(); 16 | 17 | // Airport & City Search (autocomplete) 18 | // Find all the cities and airports starting by the keyword 'LON' 19 | Location[] locations = amadeus.referenceData.locations.get(Params 20 | .with("keyword", "LON") 21 | .and("subType", Locations.ANY)); 22 | 23 | if(locations[0].getResponse().getStatusCode() != 200) { 24 | System.out.println("Wrong status code: " + locations[0].getResponse().getStatusCode()); 25 | System.exit(-1); 26 | } 27 | System.out.println(locations[0]); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/Java SDK/TripPurposePrediction.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Prediction; 7 | 8 | public class TripPurposePrediction { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // Predict the purpose of the trip: business or leisure 17 | Prediction tripPurpose = amadeus.travel.predictions.tripPurpose.get(Params 18 | .with("originLocationCode", "NYC") 19 | .and("destinationLocationCode", "MAD") 20 | .and("departureDate", "2022-08-01") 21 | .and("returnDate", "2022-08-12")); 22 | 23 | if(tripPurpose.getResponse().getStatusCode() != 200) { 24 | System.out.println("Wrong status code" + tripPurpose.getResponse().getStatusCode()); 25 | System.exit(-1); 26 | } 27 | 28 | System.out.println(tripPurpose); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /airport_and_city_search/v1/get/locations_locationsid/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "links": { 4 | "self": "http://test.api.amadeus.com/v1/reference-data/locations/ALHR" 5 | } 6 | }, 7 | "data": { 8 | "type": "location", 9 | "subType": "AIRPORT", 10 | "name": "HEATHROW", 11 | "detailedName": "LONDON/GB:HEATHROW", 12 | "id": "ALHR", 13 | "self": { 14 | "href": "http://test.api.amadeus.com/v1/reference-data/locations/ALHR", 15 | "methods": [ 16 | "GET" 17 | ] 18 | }, 19 | "timeZoneOffset": "+01:00", 20 | "iataCode": "LHR", 21 | "geoCode": { 22 | "latitude": 51.47294, 23 | "longitude": -0.45061 24 | }, 25 | "address": { 26 | "cityName": "LONDON", 27 | "cityCode": "LON", 28 | "countryName": "UNITED KINGDOM", 29 | "countryCode": "GB", 30 | "regionCode": "EUROP" 31 | }, 32 | "analytics": { 33 | "travelers": { 34 | "score": 45 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_by_square/Android SDK/PointsOfInterest.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.bySquare.get( 21 | north = 41.397158, 22 | west = 2.160873, 23 | south = 41.394582, 24 | east = 2.177181)) { 25 | is ApiResult.Success -> { 26 | Log.d("Result", "${result.data}") 27 | } 28 | is ApiResult.Error -> { 29 | // Handle your error 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /trip_purpose_prediction/v2/get/Android SDK/TripPurposePrediction.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val tripPurpose = amadeus.travel.predictions.tripPurpose.get( 21 | originLocationCode = "NYC", 22 | destinationLocationCode = "MAD", 23 | departureDate = "2022-12-01", 24 | returnDate = "2022-12-12") { 25 | is ApiResult.Success -> { 26 | Log.d("Result", "${result.data}") 27 | } 28 | is ApiResult.Error -> { 29 | // Handle your error 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_retrieve/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "self": "https://test.api.amadeus.com/v1/shopping/activities/3216547684" 4 | }, 5 | "data": { 6 | "type": "activity", 7 | "id": "3216547684", 8 | "self": { 9 | "href": "https://test.api.amadeus.com/v1/shopping/activities/3216547684", 10 | "methods": [ 11 | "GET" 12 | ] 13 | }, 14 | "name": "Madrid:\nPrado Museum Direct Entrance Ticket", 15 | "shortDescription": "Discover\nmasterpieces of art with a full-day entrance ticket to Madrid’s Prado Museum\nand see works by Velázquez, Goya, El Greco and many more. Covering the full\nrange of Spanish art, the collection includes 7,600 paintings and 1,000\nsculptures.", 16 | "geoCode": { 17 | "latitude": "40.41436995", 18 | "longitude": "-3.69170868" 19 | }, 20 | "rating": "4.3", 21 | "pictures": [ 22 | "https://cdn.getyourguide.com/img/tour_img-478731-145.jpg" 23 | ], 24 | "bookingLink": "https://b2c.mla.cloud/c/WAfQop1R2Q?ctx=5dc3d546d7cbb50001f51a33", 25 | "price": { 26 | "currencyCode": "EUR", 27 | "amount": "16" 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /hotel_name_autocomplete/v1/get/Java SDK/HotelNameAutocomplete.java: -------------------------------------------------------------------------------- 1 | 2 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.TripDetail; 6 | 7 | // Hotel name autocomplete for keyword 'PARI' using HOTEL_GDS category of search 8 | public class HotelNameAutocomplete { 9 | public static void main(String[] args) throws ResponseException { 10 | 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY", "YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | // Set query parameters 16 | Params params = Params 17 | .with("keyword", "PARI") 18 | .and("subType", "HOTEL_GDS"); 19 | 20 | // Run the query 21 | Hotel[] hotels = amadeus.referenceData.locations.hotel.get(params); 22 | 23 | if (hotels.getResponse().getStatusCode() != 200) { 24 | System.out.println("Wrong status code: " + hotels.getResponse().getStatusCode()); 25 | System.exit(-1); 26 | } 27 | 28 | Arrays.stream(hotels) 29 | .map(Hotel::getName) 30 | .forEach(System.out::println); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /branded_fares_upsell/v1/post/Node SDK/branded_fares_upsell.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | 3 | const amadeus = new Amadeus({ 4 | clientId: "YOUR_AMADEUS_API_KEY", 5 | clientSecret: "YOUR_AMADEUS_API_SECRET", 6 | }); 7 | 8 | async function main() { 9 | try { 10 | // Search flights from LON to DEL 11 | const flightOffersResponse = await amadeus.shopping.flightOffersSearch.get({ 12 | originLocationCode: "LON", 13 | destinationLocationCode: "DEL", 14 | departureDate: "2023-06-01", 15 | returnDate: "2023-06-30", 16 | adults: "1", 17 | }); 18 | 19 | //then Get branded fares available from the first offer 20 | const response = await amadeus.shopping.flightOffers.upselling.post({ 21 | data: { 22 | type: "flight-offers-upselling", 23 | flightOffers: [flightOffersResponse.data[0]], 24 | payments: [ 25 | { 26 | brand: "VISA_IXARIS", 27 | binNumber: 123456, 28 | flightOfferIds: [1], 29 | }, 30 | ], 31 | }, 32 | }); 33 | console.log(response); 34 | } catch (error) { 35 | console.error(error); 36 | } 37 | } 38 | 39 | main(); 40 | -------------------------------------------------------------------------------- /points_of_interest/v1/get/pois_by_square/Java SDK/PointsOfInterest.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.PointOfInterest; 7 | 8 | public class PointsOfInterest { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | // What are the popular places in Barcelona? (based on a square) 17 | PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInterest.bySquare.get(Params 18 | .with("north", "41.397158") 19 | .and("west", "2.160873") 20 | .and("south", "41.394582") 21 | .and("east", "2.177181")); 22 | 23 | if (pointsOfInterest[0].getResponse().getStatusCode() != 200) { 24 | System.out.println("Wrong status code: " + pointsOfInterest[0].getResponse().getStatusCode()); 25 | System.exit(-1); 26 | } 27 | 28 | System.out.println(pointsOfInterest[0]); 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /flight_availabilities_search/v1/post/cURL/flight_availabilities_search.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \ 9 | -H "Content-Type: application/json" \ 10 | https://test.api.amadeus.com/v1/shopping/availability/flight-availabilities \ 11 | -d '{ 12 | "originDestinations": [ 13 | { 14 | "id": "1", 15 | "originLocationCode": "MIA", 16 | "destinationLocationCode": "ATL", 17 | "departureDateTime": { 18 | "date": "2022-11-01" 19 | } 20 | } 21 | ], 22 | "travelers": [ 23 | { 24 | "id": "1", 25 | "travelerType": "ADULT" 26 | } 27 | ], 28 | "sources": [ 29 | "GDS" 30 | ] 31 | }' -------------------------------------------------------------------------------- /flight_price_analysis/v1/get/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "count": 1, 4 | "links": { 5 | "self": "https://test.api.amadeus.com/v1/analytics/itinerary-price-metrics?originIataCode=MAD&destinationIataCode=CDG&departureDate=2021-03-21¤cyCode=EUR&oneWay=false" 6 | } 7 | }, 8 | "data": [ 9 | { 10 | "type": "itinerary-price-metric", 11 | "origin": { 12 | "iataCode": "MAD" 13 | }, 14 | "destination": { 15 | "iataCode": "CDG" 16 | }, 17 | "departureDate": "2021-03-21", 18 | "transportType": "FLIGHT", 19 | "currencyCode": "EUR", 20 | "oneWay": false, 21 | "priceMetrics": [ 22 | { 23 | "amount": "43.27", 24 | "quartileRanking": "MINIMUM" 25 | }, 26 | { 27 | "amount": "228.65", 28 | "quartileRanking": "FIRST" 29 | }, 30 | { 31 | "amount": "231.03", 32 | "quartileRanking": "MEDIUM" 33 | }, 34 | { 35 | "amount": "234.48", 36 | "quartileRanking": "THIRD" 37 | }, 38 | { 39 | "amount": "442.62", 40 | "quartileRanking": "MAXIMUM" 41 | } 42 | ] 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /travel_redommendations/v1/get/Java SDK/TravelRecommendations.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Location; 7 | 8 | public class TravelRecommendations { 9 | public static void main(String[] args) throws ResponseException { 10 | Amadeus amadeus = Amadeus 11 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 12 | .build(); 13 | 14 | Location[] destinations = amadeus.referenceData.recommendedLocations.get(Params 15 | .with("cityCodes", "PAR") 16 | .and("travelerCountryCode", "FR")); 17 | 18 | if (destinations.length != 0) { 19 | if (destinations[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + destinations[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | System.out.println(destinations[0]); 24 | } 25 | else { 26 | System.out.println("No recommendations found"); 27 | System.exit(-1); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flight_availabilities_search/v1/post/Java SDK/FlightAvailabilities.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Response; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightAvailability; 7 | 8 | public class FlightAvailabilities { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | String body = "{\"originDestinations\":[{\"id\":\"1\",\"originLocationCode\":\"ATH\",\"destinationLocationCode\":\"SKG\",\"departureDateTime\":{\"date\":\"2023-08-14\",\"time\":\"21:15:00\"}}],\"travelers\":[{\"id\":\"1\",\"travelerType\":\"ADULT\"}],\"sources\":[\"GDS\"]}"; 17 | 18 | FlightAvailability[] flightAvailabilities = amadeus.shopping.availability.flightAvailabilities.post(body); 19 | 20 | if (flightAvailabilities[0].getResponse().getStatusCode() != 200) { 21 | System.out.println("Wrong status code: " + flightAvailabilities[0].getResponse().getStatusCode()); 22 | System.exit(-1); 23 | } 24 | 25 | System.out.println(flightAvailabilities[0]); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /flight_offers_search/v2/get/Android SDK/FlightOffersSearch.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val flightOffersSearches = amadeus.shopping.flightOffersSearch.get( 21 | originLocationCode = "SYD", 22 | destinationLocationCode = "BKK", 23 | departureDate = "2022-11-01", 24 | returnDate ="2022-11-08", 25 | adults = 2, 26 | max = 3)) { 27 | is ApiResult.Success -> { 28 | Log.d("Result", "${result.data}") 29 | } 30 | is ApiResult.Error -> { 31 | // Handle your error 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "count": "1", 4 | "self": "https://test.api.amadeus.com/v1/shopping/activities/longitude=-3.69170868&latitude=40.41436995&radius=1" 5 | }, 6 | "data": [ 7 | { 8 | "type": "activity", 9 | "id": "3216547684", 10 | "self": { 11 | "href": "https://test.api.amadeus.com/v1/shopping/activities/3216547684", 12 | "methods": [ 13 | "GET" 14 | ] 15 | }, 16 | "name": "Madrid:\nPrado Museum Direct Entrance Ticket", 17 | "shortDescription": "Discover\nmasterpieces of art with a full-day entrance ticket to Madrid’s Prado Museum\nand see works by Velázquez, Goya, El Greco and many more. Covering the full\nrange of Spanish art, the collection includes 7,600 paintings and 1,000\nsculptures.", 18 | "geoCode": { 19 | "latitude": "40.41436995", 20 | "longitude": "-3.69170868" 21 | }, 22 | "rating": "4.3", 23 | "pictures": [ 24 | "https://cdn.getyourguide.com/img/tour_img-478731-145.jpg" 25 | ], 26 | "bookingLink": "https://b2c.mla.cloud/c/WAfQop1R2Q?ctx=5dc3d546d7cbb50001f51a33", 27 | "price": { 28 | "currencyCode": "EUR", 29 | "amount": "16" 30 | } 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /flight_checkin_links/v2/get/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "warnings": [ 3 | { 4 | "status": 200, 5 | "code": 10151, 6 | "title": "DEFAULT LANGUAGE USED", 7 | "detail": "Language not available for this airline, default language applied", 8 | "source": { 9 | "parameter": "language" 10 | } 11 | } 12 | ], 13 | "meta": { 14 | "count": 1, 15 | "links": { 16 | "self": "http://test.api.amadeus.com/v2/reference-data/urls/checkin-links?airlineCode=BA" 17 | } 18 | }, 19 | "data": [ 20 | { 21 | "type": "checkin-link", 22 | "id": "BAEN-GBAll", 23 | "href": "https://www.britishairways.com/travel/managebooking/public/en_ch?&bookingRef={PNR}&lastname={LAST}", 24 | "channel": "All", 25 | "parameters": { 26 | "LAST": { 27 | "description": "Passenger Last Name", 28 | "type": "string" 29 | }, 30 | "PNR": { 31 | "description": "Record Locator", 32 | "type": "string", 33 | "format": "([a-zA-Z]|[0-9]){6}" 34 | } 35 | } 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /flight_offers_search/v2/get/Java SDK/FlightOffersSearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightOfferSearch; 7 | 8 | public class FlightOffersSearch { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get( 17 | Params.with("originLocationCode", "SYD") 18 | .and("destinationLocationCode", "BKK") 19 | .and("departureDate", "2022-11-01") 20 | .and("returnDate", "2022-11-08") 21 | .and("adults", 2) 22 | .and("max", 3)); 23 | 24 | if (flightOffersSearches[0].getResponse().getStatusCode() != 200) { 25 | System.out.println("Wrong status code: " + flightOffersSearches[0].getResponse().getStatusCode()); 26 | System.exit(-1); 27 | } 28 | 29 | System.out.println(flightOffersSearches[0]); 30 | } 31 | } -------------------------------------------------------------------------------- /tours_and_activities/v1/get/tours_and_activities_by_square/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta": { 3 | "count": "1", 4 | "self": "https://test.api.amadeus.com/v1/shopping/activities/longitude=-3.69170868&latitude=40.41436995&radius=1" 5 | }, 6 | "data": [ 7 | { 8 | "type": "activity", 9 | "id": "3216547684", 10 | "self": { 11 | "href": "https://test.api.amadeus.com/v1/shopping/activities/3216547684", 12 | "methods": [ 13 | "GET" 14 | ] 15 | }, 16 | "name": "Madrid:\nPrado Museum Direct Entrance Ticket", 17 | "shortDescription": "Discover\nmasterpieces of art with a full-day entrance ticket to Madrid’s Prado Museum\nand see works by Velázquez, Goya, El Greco and many more. Covering the full\nrange of Spanish art, the collection includes 7,600 paintings and 1,000\nsculptures.", 18 | "geoCode": { 19 | "latitude": "40.41436995", 20 | "longitude": "-3.69170868" 21 | }, 22 | "rating": "4.3", 23 | "pictures": [ 24 | "https://cdn.getyourguide.com/img/tour_img-478731-145.jpg" 25 | ], 26 | "bookingLink": "https://b2c.mla.cloud/c/WAfQop1R2Q?ctx=5dc3d546d7cbb50001f51a33", 27 | "price": { 28 | "currencyCode": "EUR", 29 | "amount": "16" 30 | } 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/Java SDK/FlightDelayPrediction.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.Delay; 7 | 8 | public class FlightDelayPrediction { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | Delay[] flightDelay = amadeus.travel.predictions.flightDelay.get(Params 17 | .with("originLocationCode", "NCE") 18 | .and("destinationLocationCode", "IST") 19 | .and("departureDate", "2022-08-01") 20 | .and("departureTime", "18:20:00") 21 | .and("arrivalDate", "2022-08-01") 22 | .and("arrivalTime", "22:15:00") 23 | .and("aircraftCode", "321") 24 | .and("carrierCode", "TK") 25 | .and("flightNumber", "1816") 26 | .and("duration", "PT31H10M")); 27 | 28 | if (flightDelay[0].getResponse().getStatusCode() != 200) { 29 | System.out.println("Wrong status code: " + flightDelay[0].getResponse().getStatusCode()); 30 | System.exit(-1); 31 | } 32 | 33 | System.out.println(flightDelay[0]); 34 | } 35 | } -------------------------------------------------------------------------------- /location_score/v1/get/Java SDK/LocationScore.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | import com.amadeus.Amadeus; 3 | import com.amadeus.Params; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.ScoredLocation; 6 | import java.util.Arrays; 7 | 8 | //Get the score for a given location using its coordinates 9 | public class LocationScore { 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | //Set query parameters 17 | Params params = Params.with("latitude", 41.397158).and("longitude", 2.160873); 18 | 19 | //What are the location scores for the given coordinates? 20 | ScoredLocation[] scoredLocations = amadeus.location.analytics.categoryRatedAreas.get(params); 21 | 22 | if (scoredLocations[0] && scoredLocations[0].getResponse().getStatusCode() != 200) { 23 | System.out.println("Wrong status code: " + scoredLocations[0].getResponse().getStatusCode()); 24 | System.exit(-1); 25 | } 26 | 27 | Arrays.stream(scoredLocations) 28 | .map(ScoredLocation::getCategoryScores) 29 | .forEach(System.out::println); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /hotel_booking/v1/post/Python SDK/hotel_booking.py: -------------------------------------------------------------------------------- 1 | # Install the Python library from https://pypi.org/project/amadeus 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | try: 10 | # Hotel List API to get list of Hotels by city code 11 | hotels_by_city = amadeus.reference_data.locations.hotels.by_city.get(cityCode='DEL') 12 | hotelIds = [hotel.get('hotelId') for hotel in hotels_by_city.data[:5]] 13 | 14 | # Hotel Search API to get list of offers for a specific hotel 15 | hotel_offers = amadeus.shopping.hotel_offers_search.get( 16 | hotelIds=hotelIds, adults='2', checkInDate='2023-10-01', checkOutDate='2023-10-04') 17 | offerId = hotel_offers.data[0]['offers'][0]['id'] 18 | 19 | guests = [{'id': 1, 'name': {'title': 'MR', 'firstName': 'BOB', 'lastName': 'SMITH'}, 20 | 'contact': {'phone': '+33679278416', 'email': 'bob.smith@email.com'}}] 21 | payments = {'id': 1, 'method': 'creditCard', 'card': { 22 | 'vendorCode': 'VI', 'cardNumber': '4151289722471370', 'expiryDate': '2027-08'}} 23 | 24 | # Hotel booking API to book the offer 25 | hotel_booking = amadeus.booking.hotel_bookings.post( 26 | offerId, guests, payments) 27 | print(hotel_booking.data) 28 | except ResponseError as error: 29 | raise error 30 | -------------------------------------------------------------------------------- /hotel_booking/v1/post/Java SDK/HotelBookings.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.HotelBooking; 6 | 7 | public class HotelBookings { 8 | 9 | public static void main(String[] args) throws ResponseException { 10 | 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMAEUS_API_SECRET") 13 | .build(); 14 | 15 | String body = "{\"data\"" 16 | + ":{\"offerId\":\"2F5B1C3B215FA11FD5A44BE210315B18FF91BDA2FEDDD879907A3798F41D1C28\"" 17 | + ",\"guests\":[{\"id\":1,\"name\":{\"title\":\"MR\",\"firstName\":\"BOB\"," 18 | + "\"lastName\" :\"SMITH\"},\"contact\":{\"phone\":\"+33679278416\",\"" 19 | + "email\":\"bob.smith@email.com\"}}],\"" 20 | + "payments\":[{\"id\":1,\"method\":\"creditCard\",\"" 21 | + "card\":{\"vendorCode\":\"VI\",\"cardNumber\"" 22 | + ":\"4151289722471370\",\"expiryDate\":\"2022-08\"}}]}}"; 23 | 24 | HotelBooking[] hotel = amadeus.booking.hotelBookings.post(body); 25 | 26 | if (hotel[0].getResponse().getStatusCode() != 200) { 27 | System.out.println("Wrong status code: " + hotel[0].getResponse().getStatusCode()); 28 | 29 | System.exit(-1); 30 | } 31 | 32 | System.out.println(hotel[0]); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /flight_offers_price/v1/post/Java SDK/FlightOffersPrice.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightOfferSearch; 7 | import com.amadeus.resources.FlightPrice; 8 | 9 | public class FlightOffersPrice { 10 | 11 | public static void main(String[] args) throws ResponseException { 12 | 13 | Amadeus amadeus = Amadeus 14 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 15 | .build(); 16 | 17 | FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get( 18 | Params.with("originLocationCode", "SYD") 19 | .and("destinationLocationCode", "BKK") 20 | .and("departureDate", "2022-11-01") 21 | .and("returnDate", "2022-11-08") 22 | .and("adults", 1) 23 | .and("max", 2)); 24 | 25 | // We price the 2nd flight of the list to confirm the price and the availability 26 | FlightPrice flightPricing = amadeus.shopping.flightOffersSearch.pricing.post( 27 | flightOffersSearches[1], 28 | Params.with("include", "detailed-fare-rules") 29 | .and("forceClass", "false") 30 | ); 31 | 32 | System.out.println(flightPricing.getResponse()); 33 | } 34 | } -------------------------------------------------------------------------------- /transfer_search/v1/post/Python SDK/transfer_search.py: -------------------------------------------------------------------------------- 1 | import json 2 | from amadeus import Client, ResponseError 3 | 4 | amadeus = Client( 5 | client_id='YOUR_AMADEUS_API_KEY', 6 | client_secret='YOUR_AMADEUS_API_SECRET' 7 | ) 8 | 9 | json_string = '{ "startLocationCode": "CDG", "endAddressLine": "Avenue Anatole France, 5", "endCityName": "Paris", "endZipCode": "75007", "endCountryCode": "FR", \ 10 | "endName": "Souvenirs De La Tour", "endGeoCode": "48.859466,2.2976965", "transferType": "PRIVATE", "startDateTime": "2023-11-10T10:30:00", "providerCodes": "TXO", \ 11 | "passengers": 2, "stopOvers": [ { "duration": "PT2H30M", "sequenceNumber": 1, "addressLine": "Avenue de la Bourdonnais, 19", "countryCode": "FR", "cityName": "Paris", \ 12 | "zipCode": "75007", "name": "De La Tours", "geoCode": "48.859477,2.2976985", "stateCode": "FR" } ], "startConnectedSegment": \ 13 | { "transportationType": "FLIGHT", "transportationNumber": "AF380", "departure": { "localDateTime": "2023-11-10T09:00:00", "iataCode": "NCE" }, \ 14 | "arrival": { "localDateTime": "2023-11-10T10:00:00", "iataCode": "CDG" } }, "passengerCharacteristics": [ { "passengerTypeCode": "ADT", "age": 20 }, \ 15 | { "passengerTypeCode": "CHD", "age": 10 } ] }' 16 | 17 | body = json.loads(json_string) 18 | try: 19 | response = amadeus.shopping.transfer_offers.post(body) 20 | print(response.data) 21 | except ResponseError as error: 22 | raise error 23 | -------------------------------------------------------------------------------- /branded_fares_upsell/v1/post/Java SDK/BrandedFaresUpsell.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightOfferSearch; 7 | 8 | public class BrandedFaresUpsell { 9 | 10 | public static void main(String[] args) throws ResponseException { 11 | 12 | Amadeus amadeus = Amadeus 13 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 14 | .build(); 15 | 16 | FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.get( 17 | Params.with("originLocationCode", "SYD") 18 | .and("destinationLocationCode", "BKK") 19 | .and("departureDate", "2023-11-01") 20 | .and("returnDate", "2023-11-08") 21 | .and("adults", 1) 22 | .and("max", 2)); 23 | 24 | FlightOfferSearch[] upsellFlightOffers = amadeus.shopping.flightOffers.upselling.post(flightOffersSearches[0]); 25 | 26 | if (upsellFlightOffers[0].getResponse().getStatusCode() != 200) { 27 | System.out.println("Wrong status code: " + upsellFlightOffers[0].getResponse().getStatusCode()); 28 | System.exit(-1); 29 | } 30 | 31 | System.out.println(upsellFlightOffers[0]); 32 | } 33 | } -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/Android SDK/FlightDelayPrediction.kt: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-android 2 | 3 | import com.amadeus.android.Amadeus 4 | import com.amadeus.android.ApiResult 5 | import kotlinx.coroutines.CoroutineScope 6 | import kotlinx.coroutines.Dispatchers 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.launch 9 | import android.util.Log; 10 | 11 | val job = SupervisorJob() 12 | val scope = CoroutineScope(Dispatchers.Main + job) 13 | 14 | val amadeus = Amadeus.Builder(context) 15 | .setClientId("REPLACE_BY_YOUR_API_KEY") 16 | .setClientSecret("REPLACE_BY_YOUR_API_SECRET") 17 | .build() 18 | 19 | scope.launch { 20 | when (val flightDelay = amadeus.travel.predictions.flightDelay.get( 21 | originLocationCode = "NCE", 22 | destinationLocationCode = "IST", 23 | departureDate = "2022-11-01", 24 | departureTime = "18:20:00", 25 | arrivalDate = "2022-11-01", 26 | arrivalTime = "22:15:00", 27 | aircraftCode = "321", 28 | carrierCode = "TK", 29 | flightNumber = "1816", 30 | duration = "PT31H10M")) { 31 | is ApiResult.Success -> { 32 | Log.d("Result", "${result.data}") 33 | } 34 | is ApiResult.Error -> { 35 | // Handle your error 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Discord](https://img.shields.io/discord/696822960023011329?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/cVrFBqx) 2 | 3 | # Amadeus Code Examples 4 | 5 | ## Introduction 6 | This repository contains code examples to show you how to call the [Amadeus for Developers](https://developers.amadeus.com) Self-Service APIs. 7 | 8 | The examples are written in the following languages: 9 | - [Node](https://github.com/amadeus4dev/amadeus-node) 10 | - [Java](https://github.com/amadeus4dev/amadeus-java) 11 | - [Python](https://github.com/amadeus4dev/amadeus-python) 12 | - [Swift](https://github.com/amadeus4dev/amadeus-ios) 13 | - [cURL](https://curl.se/) 14 | 15 | All the languages - apart from cURL - utilise our open-source Amadeus SDKs. 16 | 17 | ## Authorization 18 | In order to execute the examples you have to use your own Amadeus API key and secret. Your credentials can be found on the [Amadeus dashboard](https://developers.amadeus.com/my-apps). 19 | 20 | ## Dependencies 21 | Depending on the language of your choice you have to install it's SDK. The installation steps are described in the documentation of each supported language mentioned above. 22 | 23 | ## License 24 | This code is released under the [MIT License](LICENSE). 25 | 26 | ## Help 27 | You can find us on 28 | [StackOverflow](https://stackoverflow.com/questions/tagged/amadeus) or join our developer community on 29 | [Discord](https://discord.gg/cVrFBqx). 30 | -------------------------------------------------------------------------------- /flight_delay_prediction/v1/get/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "TK1816NCEIST20200801", 5 | "probability": "0.13336977", 6 | "result": "LESS_THAN_30_MINUTES", 7 | "subType": "flight-delay", 8 | "type": "prediction" 9 | }, 10 | { 11 | "id": "TK1816NCEIST20200801", 12 | "probability": "0.42023364", 13 | "result": "BETWEEN_30_AND_60_MINUTES", 14 | "subType": "flight-delay", 15 | "type": "prediction" 16 | }, 17 | { 18 | "id": "TK1816NCEIST20200801", 19 | "probability": "0.34671372", 20 | "result": "BETWEEN_60_AND_120_MINUTES", 21 | "subType": "flight-delay", 22 | "type": "prediction" 23 | }, 24 | { 25 | "id": "TK1816NCEIST20200801", 26 | "probability": "0.09968289", 27 | "result": "OVER_120_MINUTES_OR_CANCELLED", 28 | "subType": "flight-delay", 29 | "type": "prediction" 30 | } 31 | ], 32 | "meta": { 33 | "count": 4, 34 | "links": { 35 | "self": "https://test.api.amadeus.com/v1/travel/predictions/flight-delay?originLocationCode=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" 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /flight_choice_prediction/v2/post/Java SDK/FlightChoicePrediction.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightOfferSearch; 7 | import com.google.gson.JsonObject; 8 | 9 | public class FlightChoicePrediction { 10 | 11 | public static void main(String[] args) throws ResponseException { 12 | 13 | Amadeus amadeus = Amadeus 14 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 15 | .build(); 16 | 17 | FlightOfferSearch[] flightOffers = amadeus.shopping.flightOffersSearch.get( 18 | Params.with("originLocationCode", "MAD") 19 | .and("destinationLocationCode", "NYC") 20 | .and("departureDate", "2022-11-01") 21 | .and("returnDate", "2022-11-09") 22 | .and("adults", 1)); 23 | 24 | JsonObject body = flightOffers[0].getResponse().getResult(); 25 | FlightOfferSearch[] flightOffersPrediction = amadeus.shopping.flightOffers.prediction.post(body); 26 | 27 | if (flightOffersPrediction[0].getResponse().getStatusCode() != 200) { 28 | System.out.println("Wrong status code: " + flightOffersPrediction[0].getResponse().getStatusCode()); 29 | System.exit(-1); 30 | } 31 | 32 | System.out.println(flightOffersPrediction[0]); 33 | } 34 | } -------------------------------------------------------------------------------- /hotel_ratings/v2/get/response.json: -------------------------------------------------------------------------------- 1 | { "data": [ { 2 | "type": "hotelSentiment", 3 | "numberOfReviews": 218, 4 | "numberOfRatings": 278, 5 | "hotelId": "ADNYCCTB", 6 | "overallRating": 93, 7 | "sentiments": { 8 | "sleepQuality": 87, 9 | "service": 98, 10 | "facilities": 90, 11 | "roomComforts": 92, 12 | "valueForMoney": 87, 13 | "catering": 89, 14 | "location": 98, 15 | "pointsOfInterest": 91, 16 | "staff": 100 17 | } 18 | }, 19 | { 20 | "type": "hotelSentiment", 21 | "numberOfReviews": 2667, 22 | "numberOfRatings": 2666, 23 | "hotelId": "TELONMFS", 24 | "overallRating": 81, 25 | "sentiments": { 26 | "sleepQuality": 78, 27 | "service": 80, 28 | "facilities": 75, 29 | "roomComforts": 87, 30 | "valueForMoney": 75, 31 | "catering": 81, 32 | "location": 89, 33 | "internet": 72, 34 | "pointsOfInterest": 81, 35 | "staff": 89 36 | } 37 | } 38 | ], 39 | "meta": { "count": 1, 40 | "links": { 41 | "self": "https://test.api.amadeus.com/v2/e-reputation/hotel-sentiments?hotelIds=ADNYCCTB,TELONMFS,XXXYYY01" 42 | } 43 | }, 44 | "warnings": [ { 45 | "code": 913, 46 | "title": "PROPERTIES NOT FOUND", 47 | "detail": "Some of the requested properties were not found in our database.", 48 | "source": { 49 | "parameter": "hotelIds", 50 | "pointer": "XXXYYY01" 51 | } 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /seatmaps/v1/post/Java SDK/SeatMaps.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.Params; 5 | import com.amadeus.exceptions.ResponseException; 6 | import com.amadeus.resources.FlightOfferSearch; 7 | import com.amadeus.resources.SeatMap; 8 | import com.google.gson.JsonObject; 9 | 10 | public class SeatMaps { 11 | public static void main(String[] args) throws ResponseException { 12 | 13 | Amadeus amadeus = Amadeus 14 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 15 | .build(); 16 | 17 | FlightOfferSearch[] flightOffers = amadeus.shopping.flightOffersSearch.get( 18 | Params.with("originLocationCode", "NYC") 19 | .and("destinationLocationCode", "MAD") 20 | .and("departureDate", "2022-11-01") 21 | .and("returnDate", "2022-11-09") 22 | .and("max", "1") 23 | .and("adults", 1)); 24 | 25 | JsonObject body = flightOffers[0].getResponse().getResult(); 26 | SeatMap[] seatmap = amadeus.shopping.seatMaps.post(body); 27 | 28 | if (seatmap[0].getResponse().getStatusCode() != 200) { 29 | System.out.println("Wrong status code: " + seatmap[0].getResponse().getStatusCode()); 30 | System.exit(-1); 31 | } 32 | 33 | System.out.println(seatmap[0]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /flight_choice_prediction/v2/post/iOS SDK/FlightChoicePrediction.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | 3 | var amadeus: Amadeus = Amadeus( 4 | client_id: "YOUR_API_ID", 5 | client_secret: "YOUR_API_SECRET" 6 | ) 7 | 8 | 9 | amadeus.shopping.flightOffersSearch.get(params: 10 | ["originLocationCode": "MAD", 11 | "destinationLocationCode": "BER", 12 | "departureDate": "2022-05-16", 13 | "returnDate": "2022-05-30", 14 | "adults": "2"], 15 | onCompletion: { result in 16 | 17 | switch result { 18 | case let .success(response): 19 | self.amadeus.shopping.flightOffers.prediction.post(body: response.result, onCompletion: { 20 | predictionResult in 21 | 22 | switch predictionResult { 23 | case let .success(response): 24 | print(response.data) 25 | case let .failure(error): 26 | fatalError(error.localizedDescription) 27 | } 28 | }) 29 | case let .failure(error): 30 | fatalError(error.localizedDescription) 31 | } 32 | }) 33 | -------------------------------------------------------------------------------- /hotel_booking/v1/post/iOS SDK/HotelBookings.swift: -------------------------------------------------------------------------------- 1 | import Amadeus 2 | import Foundation 3 | import SwiftyJSON 4 | 5 | var amadeus: Amadeus = Amadeus( 6 | client_id: "YOUR_API_ID", 7 | client_secret: "YOUR_API_SECRET" 8 | ) 9 | 10 | let jsonString: String = """ 11 | { 12 | "data": { 13 | "offerId": "9AFAD70AF0E4E520F41E1AC743EADB9A1D83EF921A63013CA4E65FA9E8465F4F", 14 | "guests": [ 15 | { 16 | "name": { 17 | "title": "MR", 18 | "firstName": "BOB", 19 | "lastName": "SMITH" 20 | }, 21 | "contact": { 22 | "phone": "+33679278416", 23 | "email": "bob.smith@email.com" 24 | } 25 | } 26 | ], 27 | "payments": [ 28 | { 29 | "method": "creditCard", 30 | "card": { 31 | "vendorCode": "VI", 32 | "cardNumber": "4111111111111111", 33 | "expiryDate": "2023-01" 34 | } 35 | } 36 | ] 37 | } 38 | } 39 | """ 40 | 41 | let dataFromString = jsonString.data(using: .utf8, allowLossyConversion: false) 42 | 43 | do { 44 | let body: JSON = try JSON(data: dataFromString!) 45 | 46 | amadeus.booking.hotelBookings.post(body: body, 47 | onCompletion: { result in 48 | switch result { 49 | case let .success(response): 50 | print(response.data) 51 | case let .failure(error): 52 | fatalError(error.localizedDescription) 53 | } 54 | }) 55 | } catch _ as NSError { 56 | assertionFailure("JSON not valid") 57 | } 58 | -------------------------------------------------------------------------------- /hotel_booking/v1/post/curl/hotel_booking.sh: -------------------------------------------------------------------------------- 1 | # Authentication: $AMADEUS_CLIENT_ID & $AMADEUS_CLIENT_SECRET can be defined 2 | # in your environmental variables or directly in your script 3 | ACCESS_TOKEN=$(curl -H "Content-Type: application/x-www-form-urlencoded" \ 4 | https://test.api.amadeus.com/v1/security/oauth2/token \ 5 | -d "grant_type=client_credentials&client_id=$AMADEUS_CLIENT_ID&client_secret=$AMADEUS_CLIENT_SECRET" \ 6 | | grep access_token | sed 's/"access_token": "\(.*\)"\,/\1/' | tr -d '[:space:]') 7 | 8 | curl -X POST -H "Authorization: Bearer $ACCESS_TOKEN" \ 9 | -H "Content-Type: application/json" \ 10 | https://test.api.amadeus.com/v1/booking/hotel-bookings \ 11 | -d '{ 12 | "data": { 13 | "offerId": "FBBA8AF0721F59AA19C68FDA7FEBEA8AD6B781236BD7DCB8009325FBAE96006B", 14 | "guests": [ 15 | { 16 | "id": 1, 17 | "name": { 18 | "title": "MR", 19 | "firstName": "BOB", 20 | "lastName": "SMITH" 21 | }, 22 | "contact": { 23 | "phone": "+33679278416", 24 | "email": "bob.smith@email.com" 25 | } 26 | } 27 | ], 28 | "payments": [ 29 | { 30 | "id": 1, 31 | "method": "creditCard", 32 | "card": { 33 | "vendorCode": "VI", 34 | "cardNumber": "4151289722471370", 35 | "expiryDate": "2022-08" 36 | } 37 | } 38 | ], 39 | "rooms": [ 40 | { 41 | "guestIds": [ 42 | 1 43 | ], 44 | "paymentId": 1, 45 | "specialRequest": "I will arrive at midnight" 46 | } 47 | ] 48 | } 49 | }' -------------------------------------------------------------------------------- /flight_offers_search/v2/post/Java SDK/FlightOffersSearch.java: -------------------------------------------------------------------------------- 1 | // How to install the library at https://github.com/amadeus4dev/amadeus-java 2 | 3 | import com.amadeus.Amadeus; 4 | import com.amadeus.exceptions.ResponseException; 5 | import com.amadeus.resources.FlightOfferSearch; 6 | 7 | public class FlightOffersSearch { 8 | 9 | public static void main(String[] args) throws ResponseException { 10 | 11 | Amadeus amadeus = Amadeus 12 | .builder("YOUR_AMADEUS_API_KEY","YOUR_AMADEUS_API_SECRET") 13 | .build(); 14 | 15 | String body = "{\"currencyCode\":\"USD\",\"originDestinations\":[{\"id\":\"1\",\"originLocationCode\":\"RIO\",\"destinationLocationCode\":\"MAD\",\"departureDateTimeRange\":{\"date\":\"2022-08-01\",\"time\":\"10:00:00\"}},{\"id\":\"2\",\"originLocationCode\":\"MAD\",\"destinationLocationCode\":\"RIO\",\"departureDateTimeRange\":{\"date\":\"2022-08-05\",\"time\":\"17:00:00\"}}],\"travelers\":[{\"id\":\"1\",\"travelerType\":\"ADULT\",\"fareOptions\":[\"STANDARD\"]},{\"id\":\"2\",\"travelerType\":\"CHILD\",\"fareOptions\":[\"STANDARD\"]}],\"sources\":[\"GDS\"],\"searchCriteria\":{\"maxFlightOffers\":2,\"flightFilters\":{\"cabinRestrictions\":[{\"cabin\":\"BUSINESS\",\"coverage\":\"MOST_SEGMENTS\",\"originDestinationIds\":[\"1\"]}],\"carrierRestrictions\":{\"excludedCarrierCodes\":[\"AA\",\"TP\",\"AZ\"]}}}}"; 16 | 17 | FlightOfferSearch[] flightOffersSearches = amadeus.shopping.flightOffersSearch.post(body); 18 | 19 | if (flightOffersSearches[0].getResponse().getStatusCode() != 200) { 20 | System.out.println("Wrong status code: " + flightOffersSearches[0].getResponse().getStatusCode()); 21 | System.exit(-1); 22 | } 23 | 24 | System.out.println(flightOffersSearches[0]); 25 | } 26 | } -------------------------------------------------------------------------------- /hotel_booking/v1/post/Node SDK/hotel_booking.js: -------------------------------------------------------------------------------- 1 | const Amadeus = require("amadeus"); 2 | const amadeus = new Amadeus({ 3 | clientId: "YOUR_API_KEY", 4 | clientSecret: "YOUR_API_SECRET", 5 | }); 6 | 7 | async function main() { 8 | try { 9 | // Book a hotel in DEL for 2023-10-10 to 2023-10-12 10 | 11 | // 1. Hotel List API to get the list of hotels 12 | const hotelsList = await amadeus.referenceData.locations.hotels.byCity.get({ 13 | cityCode: "LON", 14 | }); 15 | 16 | // 2. Hotel Search API to get the price and offer id 17 | const pricingResponse = await amadeus.shopping.hotelOffersSearch.get({ 18 | hotelIds: hotelsList.data[0].hotelId, 19 | adults: 1, 20 | checkInDate: "2023-10-10", 21 | checkOutDate: "2023-10-12", 22 | }); 23 | 24 | // Finally, Hotel Booking API to book the offer 25 | const response = await amadeus.booking.hotelBookings.post({ 26 | data: { 27 | offerId: pricingResponse.data[0].offers[0].id, 28 | guests: [ 29 | { 30 | id: 1, 31 | name: { 32 | title: "MR", 33 | firstName: "BOB", 34 | lastName: "SMITH", 35 | }, 36 | contact: { 37 | phone: "+33679278416", 38 | email: "bob.smith@email.com", 39 | }, 40 | }, 41 | ], 42 | payments: [ 43 | { 44 | id: 1, 45 | method: "creditCard", 46 | card: { 47 | vendorCode: "VI", 48 | cardNumber: "4151289722471370", 49 | expiryDate: "2022-08", 50 | }, 51 | }, 52 | ], 53 | }, 54 | }); 55 | console.log(response); 56 | } catch (error) { 57 | console.error(error); 58 | } 59 | } 60 | 61 | main(); 62 | --------------------------------------------------------------------------------