How Do I allow users to search for destination cities using Amadeus Hotel API?

601 Views Asked by At

I'm using Amadeus APIs for both Airlines and Hotels. I want to let travelers enter in a search form the cities and airports they either want to go or travel from. I see in the test APIs that Amadeus has its own code names for all cities (if I'm not wrong) in the world. I tried in the test API for Hotels. Code Name for London is LON. I entered the name LONDON and the API said it was a bad request. So if I have a search form for Hotels using Amadeus Hotel API, how can a user enter the name of a city ,eg Beijing and not PEK (which is the city code for Beijing) and still get search results? I'm cofused. I need explanation.

1

There are 1 best solutions below

4
On

You are right, our APIs use IATA codes (airport and/or city codes) which is the standard way in the travel industry, this helps to have a standardized way to identify cities and airports all over the world.

It is obviously not the way you want your users to enter it. For this, we have an API: Airport & City Search. This API is an auto-complete API, allowing to retrieve the IATA code (and other information) from the name. For example, if you call the API with "LONDON" you will get information about the city and/or the airports of London.

We have different guides (depending of your programming language/framework) on how to implement this API and enable the auto-complete feature (showing the different cities/airports when the user starts typing):