Reputation: 11
I am not fluent in Python and do not understand clearly Amadeus API Python codes online. It is a work in progress. I want to find the code for the specific hotel and find its information with specific check-in and check-out dates. So, how do I get the hotel codes for the given city? I am using Google Colab.
!pip install amadeus
from amadeus import ResponseError, Client
amadeus = Client(
client_id='My ID',
client_secret='My secret'
)
try:
# Get list of Hotels by city code
hotels_by_city = amadeus.shopping.hotel_offers_search.get(
hotelIds='RTPAR001', adults='2')
except ResponseError as error:
raise error
print(hotels_by_city)
I used this but it's not working. Please help. Thanks.
I tried this code to find the hotel codes but it is not working.
Upvotes: 0
Views: 283
Reputation: 159
Hotels APIs flow in Amadeus Self-Service API is recently updated with a new version so you may have an outdated code example.
Hotel Booking engine flow is available in detail here : https://developers.amadeus.com/blog/build-hotel-booking-engine-amadeus-api
Each code examples are available in the documentation : https://amadeus4dev.github.io/developer-guides/examples/code-example/#hotel-list
Upvotes: 0