We’ve gathered information about API to use in mobile apps.
With the mobile API, affiliates can build the Aviasales search into their own apps. The main API features:
- Search for airports and cities by string
- Getting airline logos
- Price calendar
- Price Map: supported routes
- Price Map: price
- Convert the price
Search for cities/airports by string
To search cities or airports by string, use a GET request of the following form:
http://autocomplete.travelpayouts.com/places2?term=Lon&locale=en&types[]=city&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 — A parameter for backward compatibility of clients running on jsonp
Example of response
{
name: "London",
weight: 102113,
country_code: "GB",
index_strings: [
"londen",
"london",
"londona",
"londonas",
"londra",
"londres",
"londyn",
"londýn",
"lontoo",
"luân đôn",
"λονδίνο",
"лондон",
"լոնդոն",
"לונדון",
"لندن",
"लंदन",
"ลอนดอน",
"ლონდონი",
"ロンドン",
"伦敦",
"倫敦",
"런던",
],
main_airport_name: null,
state_code: null,
coordinates: {
lon: 0.06,
lat: 51.51,
},
country_name: "United Kingdom",
country_cases: null,
type: "city",
code: "LON",
cases: 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 — An object’s coordinates
- name — The name of the city / airport
- state_code — State code (if available)
Supported languages
- ar — Arabic
- bg — Bulgarian
- cs — Czech
- da — Danish
- de — German
- el — Greek
- en — English
- es — Spanish
- fa — Persian
- fi — Finnish
- fr — French
- he — Israeli
- hi — Indian
- hr — Croatian
- hu — Hungarian
- id — Indonesian
- it — Italian
- ja — Japanese
- ka — Georgian
- ko — Korean
- lt — Italian
- lv — Latvia
- ms — Malaysian
- nl — Dutch
- no — Norwegian
- pl — Polish
- pt — Portuguese
- ro — Romanian
- ru — Russian
- sk — Slovak
- sl — Slovenian
- sr — Serbian
- sv — Swedish
- th — Thai
- tl — Filipino
- tr — Turkish
- uk — Ukrainian
- vi — Vietnamese
- zh-Hans — Chinese traditional
- zh-Hant — Chinese simplified
Airline logos
Get airline logos as a PNG file of the necessary size.
Query
Method: GET.
URL: http://ios.aviasales.com/logos/density/IATA.png
where Density — size of logo (the parentheses contain the corresponding maximum image sizes in pixels); the sizes do not need to be specified in queries and can be:
- nonretina (66×22)
- mdpi (88×29)
- hdpi (132×44)
- xhdpi (176×59)
- xxhdpi (264×87)
and IATA — the airline’s IATA code.
For example: http://ios.aviasales.com/logos/nonretina/AB.png
Logos for iPhone retina displays are in the hdpi folder.
Note: Not all airlines have a logo.
Logos of airlines are available at: http://pics.avs.io/width/height/iata.png
where, width — the width of the logo, height — the height of the logo, iata — the IATA code of the airline.
Example: https://pics.avs.io/340/100/AB.png.
Price Map: supported routes
Query
Method: GET.
URL: http://map.aviasales.com/supported_directions.json?origin_iata=LON&one_way=false&locale=en
Query parameters
- origin_iata — IATA code of the airport/city for which tickets are searched. The IATA code is shown in uppercase letters, for example, LON
- one_way — true for one-way tickets, false for round trips
- locale — search language
Response
{ "origin":{ "iata":"LON", "name":"London", "country":"GB", "coordinates":[ 0.06, 51.51
] }, "directions":[{ "direct":false, "iata":"EBA", "name":"Elba Island", "country":"IT", "coordinates":[ 10.283333, 42.766666 ] } }
Response parameters
- iata — IATA code of the departure city
- name — name of the departure city
- country — country letter code
- coordinates — coordinates of departure city
- directions — route information
- direct — whether non-stop flights are available
- name — name of destination city
- country — destination country
- coordinates — coordinates
Price Map: prices
Query
Method: GET.
URL: http://map.aviasales.com/prices.json?origin_iata=LON&period=2021-12-01:season&direct=true&one_way=false&price=50000&no_visa=true&schengen=true&need_visa=true&locale=ru&min_trip_duration_in_days=13&max_trip_duration_in_days=15
Query parameters
- origin_iata — IATA code for the point of departure. The IATA code is shown in uppercase letters, for example, LON
- period — period of dates for which to search
- direct — whether non-stop flights are available
- one_way — true for one-way tickets, false for round trips
- price — highest ticket price
- no_visa — payment not made with a Visa card
- schengen — can the ticket be changed
- need_visa — visa required (or not)
- locale — search language
- min_trip_duration_in_days — shortest trip duration (in days)
- max_trip_duration_in_days — longest trip duration (in days)
Response
[{ "show_to_affiliates":false, "trip_class":0, "destination":"PSA", "depart_date":"2021-05-30", "return_date":"2021-06-12", "number_of_changes":0, "value":43785, "created_at": 1407716354, "ttl": 1407889154, "distance":2247, "actual":false }, { "show_to_affiliates":false, "trip_class":0, "destination":"PRG", "depart_date":"2021-03-01", "return_date":"2021-03-15", "number_of_changes":0, "value":12060, "created_at": 1407716354, "ttl": 1407889154, "distance":1485, "actual":true }]
Response parameters
- show_to_affiliates — true: prices available to affiliates, false: price not available to affiliates
- trip_class — trip class (1 — business class, 0 — standard)
- destination — IATA code for the destination
- depart_date — departure date
- return_date — return date
- number_of_changes — number of stops
- value — flight cost
- created_at — time and date of query creating (in UNIX timestamp format)
- ttl (time-to-live) — time and date at which the offer is living (in UNIX timestamp format)
- distance — distance between the departure and arrival points
- actual — equals 0 or 1. 0 — price was found long ago and may be out of date. 1 — price was found recently and is current
Convert the price
To convert the price from rubles to other currencies, use the query:
http://yasen.aviasales.com/adaptors/currency.json
You will receive the closest value of all popular currencies to the ruble at the moment.
{ "cny":8.24394, "eur":57.1578, "mzn":1.49643, "nio":1.97342, "usd":51.1388, "hrk":7.48953 }