Autocomplete API for countries, cities and airports

To make the autocomplete of cities or airports in the search, use a query of the following form:

http://autocomplete.travelpayouts.com/places2?term=Mos&locale=en&types[]=country&callback=function

  • term - text for searching (the main parameter);
  • locale - the output language (the list of supported languages at the end of the article);
  • types[] - an array that specifies the type of autocomplete search(city, airport, country);
  • callback - is a parameter for backward compatibility of clients running on jsonp.

Example of response

[
{
"code": MOW,
"main_airport_name": null,
"country_cases": null,
"index_strings":[
maskava,
moscow
],
"weight": 1006321,
"cases": {
"da": "Москве",
"tv": "Москвой",
"vi": "в Москву",
"pr": "Москве",
"ro": "Москвы"
},
"country_name": "Россия",
"type": city,
"country_code": RU,
"coordinates": {
"lon": 37.617633,
"lat": 55.755786
},
"name": "Москва",
"state_code": null
}
]

Response parameters

  • code - IATA city/airport code;
  • main_airport_name - airport name (if available);
  • country_cases - service parameter;
  • index_strings - variants of queries in different languages ​​and in different layouts;
  • weight - service parameter;
  • cases - the name of the city in various cases (only for ru locale);
    country_name - name of the country;
  • type - type of object (city / airport / country);
  • country_code - IATA country code;
  • coordinates - object's coordinates;
  • name - the name of the city / airport;
  • state_code - state code (if available).

Supported Languages

  • de - German;
  • en - English;
  • es - Spanish;
  • fr - French;
  • id - Indonesian;
  • it - Italian;
  • ja - Japanese;
  • ko - Korean;
  • ms - Malaysian;
  • pl - Polish;
  • pt - Portuguese;
  • ru - Russian;
  • th - Thai;
  • tr - Turkish;
  • vi - Vietnamese;
  • zh-Hant - Chinese simplified;
  • zh-Hans - Chinese traditional;
  • tl - Filipino;
  • ar - Arabic;
  • lt - Italian;
  • uk - Ukrainian;
  • nl - Dutch;
  • da - Danish;
  • fi - Finnish;
  • sv - Swedish;
  • el - Greek;
  • no - Norwegian;
  • he - Israeli;
  • hi - Indian;
  • hr - Croatian;
  • cs - Czech;
  • sk - Slovak;
  • hu - Hungarian;
  • fa - Persian;
  • ro - Romanian;
  • bg - Bulgarian;
  • lv - Latvia;
  • sl - Slovenian;
  • sr - Serbian.

Was this article helpful?

Have more questions? Submit a request