API for defining IATA code

Using the autocomplete API, it is possible to get the IATA code for a city, country, or airport, as well as additional information about them (coordinates, case inflection of the name).

But sometimes it is required to determine the IATA code of the city of departure and destination at once, or to determine the IATA code of the capital city by the name of the country.

To solve these tasks, use the following request:

https://www.travelpayouts.com/widgets_suggest_params?q=search

where the search parameter is the desired searching phrase.

For example, to determine the IATA code of the cities of departure and destination, use the following request:

https://www.travelpayouts.com/widgets_suggest_params?q=From%20Moscow%20to%20London

The following information is received in response to the request:

{
    "origin": {
        "iata": "MOW",
        "name": "Moscow"
    },
    "destination": {
        "iata": "LON",
        "name": "London"
    }
}
  • origin
    • iata — IATA departure city code;
    • name — name of departure city.
  • destination
    • iata — IATA destination city code;
    • name — name of destination city.

To determine the IATA code of the country's capital, send the following request:

https://www.travelpayouts.com/widgets_suggest_params?q=Russia

The response will contain the following:

{
    "capital": {
        "iata": "MOW",
        "name": "Moscow"
    }
}

Was this article helpful?

Have more questions? Submit a request