Travelpayouts Data API – the way to get travel insights for your site or blog. Get flight price trends and find popular destinations for your customers.
Data is transferred from the cache, which is formed on the basis of searches of users of sites Aviasales.ru and Jetradar.com for the last 48 hours. So it is recommended that you use them to generate static pages.
For developers documentation is available with examples of queries and answers in various programming languages, as well as a link to Postman: https://travelpayouts.github.io/slate/.
This documentation is for the public Aviasales API of the same name.
To access the API, you must pass your token in the X-Access-Token header or in the token parameter. To obtain a token for the Data Access API, go to http://www.travelpayouts.com/developers/api.
Dates are accepted in the formats YYYY-MM and YYYY-MM-DD.
The server response is always sent in JSON format with the following structure:
Dates and times are given in UTC, formatted according to ISO 8601. Prices are given in rubles as of when the ticket is put in the search results. It is not recommended that you use expired prices (the approximate expiration date is given in the value of the expires_at parameter).
Important. We strongly recommend receiving data in compressed GZIP format, which saves a significant amount of time in receiving the response. To get data in compressed format, send the header Accept-Encoding: gzip, deflate.
To obtain access to the API to search for plane tickets and hotels, send a request.
Brings back the list of prices found by our users during the most recent 48 hours according to the filters used.
Request parameters
Note! If the point of departure and the point of destination are not specified, the API shall bring back 30 of the cheapest tickets that have been found during the most recent 48 hours.
{
"success": true,
"data": [
{
"show_to_affiliates": true,
"trip_class": 0,
"origin": "WMI",
"destination": "WRO",
"depart_date": "2019-12-07",
"return_date": "2019-12-13",
"number_of_changes": 0,
"value": 1183,
"found_at": "2019-09-22T14:08:45+04:00",
"distance": 298,
"actual": true
}
]
}
Response parameters
Brings back the prices for each day of a month, grouped together by number of transfers.
Request parameters
Note! If the point of departure and the point of destination are not specified, the API shall bring back 30 of the cheapest tickets that have been found during the most recent 48 hours.
{{
"success":true,
"data":[{
"show_to_affiliates":true,
"trip_class":0,
"origin":"LED",
"destination":"HKT",
"depart_date":"2019-10-01",
"return_date":"",
"number_of_changes":1,
"value":29127,
"found_at":"2019-09-24T00:06:12+04:00",
"distance":8015,
"actual":true
}]
}
Response parameters
Brings back the prices for the directions between the nearest to the target cities.
Request parameters
{
"prices": [
{
"value": 26000,
"trip_class": 0,
"show_to_affiliates": true,
"return_date": "2019-09-18",
"origin": "BAX",
"number_of_changes": 0,
"gate": "AMADEUS",
"found_at": "2019-07-28T04:57:47Z",
"duration": null,
"distance": 3643,
"destination": "SIP",
"depart_date": "2019-09-09",
"actual": true
}
],
"origins": [
"BAX"
],
"errors": {
"amadeus": {}
},
"destinations": [
"SIP"
]
}
Response parameters
Returns the cheapest non-stop tickets, as well as tickets with 1 or 2 stops, for the selected route with departure/return date filters.
Important: Old dates may be specified in a query. No error will be generated, but no data will be returned.
Request parameters
{
"success": true,
"data": {
"HKT": {
"0": {
"price": 35443,
"airline": "UN",
"flight_number": 571,
"departure_at": "2019-06-09T21:20:00Z",
"return_at": "2019-07-15T12:40:00Z",
"expires_at": "2019-01-08T18:30:40Z"
},
"1": {
"price": 27506,
"airline": "CX",
"flight_number": 204,
"departure_at": "2019-06-05T16:40:00Z",
"return_at": "2019-06-22T12:00:00Z",
"expires_at": "2019-01-08T18:38:45Z"
},
"2": {
"price": 31914,
"airline": "AB",
"flight_number": 8113,
"departure_at": "2019-06-12T13:45:00Z",
"return_at": "2019-06-24T20:30:00Z",
"expires_at": "2019-01-08T15:17:42Z"
}
}
}
}
Response parameters
Returns the cheapest non-stop tickets, as well as tickets with 1 or 2 stops, for the selected route grouped by month.
Request parameters
{
"success": true,
"data": {
"2019-11": {
"origin": "MOW",
"destination": "HKT",
"price": 415,
"transfers": 2,
"airline": "MU",
"flight_number": 592,
"departure_at": "2019-11-30T19:10:00Z",
"return_at": "2019-12-26T03:00:00Z",
"expires_at": "2019-11-06T15:06:57Z"
}
}
}
Response parameters
Returns the cheapest non-stop ticket for the selected route with departure/return date filters.
Request parameters
Response example
{
"success": true,
"data": {
"LED": {
"0": {
"price": 4363,
"airline": "UT",
"flight_number": 369,
"departure_at": "2019-06-27T11:35:00Z",
"return_at": "2019-07-04T16:00:00Z",
"expires_at": "2019-01-08T20:21:46Z"
}
}
}
}
Response parameters
Returns the cheapest non-stop, one-stop, and two-stop flights for the selected route for each day of the selected month.
Request parameters
{
"success": true,
"data": {
"2019-06-01": {
"origin": "MOW",
"destination": "BCN",
"price": 12449,
"transfers": 1,
"airline": "PS",
"flight_number": 576,
"departure_at": "2019-06-01T06:35:00Z",
"return_at": "2019-07-01T13:30:00Z",
"expires_at": "2019-01-07T12:34:14Z"
},
"2019-06-02": {
"origin": "MOW",
"destination": "BCN",
"price": 13025,
"transfers": 1,
"airline": "PS",
"flight_number": 578,
"departure_at": "2019-06-02T17:00:00Z",
"return_at": "2019-06-11T13:30:00Z",
"expires_at": "2019-01-06T17:15:47Z"
},
...
"2019-06-30": {
"origin": "MOW",
"destination": "BCN",
"price": 13025,
"transfers": 1,
"airline": "PS",
"flight_number": 578,
"departure_at": "2019-06-30T17:00:00Z",
"return_at": "2019-07-23T13:30:00Z",
"expires_at": "2019-01-07T20:15:34Z"
}
}
}
Response parameters
Returns routes for which an airline operates flights, sorted by popularity.
http://api.travelpayouts.com/v1/airline-directions?airline_code=SU&limit=10&token=PutHereYourToken
Request parameters
{
"success": true,
"data": {
"MOW-BKK": 187491,
"MOW-BCN": 113764,
"MOW-PAR": 91889,
"MOW-NYC": 77417,
"MOW-PRG": 71449,
"MOW-ROM": 67190,
"MOW-TLV": 62132,
"MOW-HKT": 58549,
"MOW-GOI": 47341,
"MOW-IST": 45553
},
"error": null,
"currency": "rub"
}
Description of response
Returns a list of popular routes of an airline, sorted by popularity.
Brings back the prices for the nearest dates to the target ones.
Request parameters
{
«success»:true,
«data»:[
{
«show_to_affiliates»:true,
«trip_class»:0,
«origin»:«LED»,
«destination»:«HKT»,
«depart_date»:«2019-03-01»,
«return_date»:«2019-03-15»,
«number_of_changes»:1,
«value»:71725,
«found_at»:«2019-02-19T00:04:37+04:00»,
«distance»:8015,
«actual»:true
}]
}
Response parameters
Brings back the most popular directions from a specified city.
http://api.travelpayouts.com/v1/city-directions?origin=MOW¤cy=usd&token=PutHereYourToken
Request parameters
{
"success": true,
"data": {
"AER": {
"origin": "MOW",
"destination": "AER",
"price": 3673,
"transfers": 0,
"airline": "WZ",
"flight_number": 125,
"departure_at": "2019-03-08T16:35:00Z",
"return_at": "2019-03-17T16:05:00Z",
"expires_at": "2019-02-22T09:32:44Z"
}
},
"error": null,
"currency": "rub"
}
Response parameters
The query http://api.travelpayouts.com/data/en/countries.json?token=PutHereYourToken returns a file with a list of countries from the database.
Additionally created translations for different languages http://api.travelpayouts.com/data/
[
{
"code": "NC",
"name": "New Caledonia",
"currency": "XPF",
"name_translations": {
"de": "Neukaledonien",
"en": "New Caledonia",
"zh-CN": "新喀里多尼亚",
"tr": "Yeni Kaledonya",
"ru": "Новая Каледония",
"fr": "Nouvelle-Calédonie",
"es": "Nueva Caledonia",
"it": "Nuova Caledonia",
"th": "ประเทศนิวแคลิโดเนีย"
}
}
]
Response parameters
The query http://api.travelpayouts.com/data/en/cities.json?token=PutHereYourToken returns a file with a list of cities from the database.
Additionally created translations for different languages http://api.travelpayouts.com/data/
[
{
"code": "SCE",
"name": "State College",
"coordinates": {
"lon": -77.84823,
"lat": 40.85372
},
"time_zone": "America/New_York",
"name_translations": {
"de": "State College",
"en": "State College",
"zh-CN": "大学城",
"tr": "State College",
"ru": "Стейт Колледж",
"it": "State College",
"es": "State College",
"fr": "State College",
"th": "สเตทคอลเลจ"
},
"country_code": "US"
}
]
Response parameters
The query http://api.travelpayouts.com/data/en/airports.json?token=PutHereYourToken returns a file with a list of airports from the database.
Additionally created translations for different languages http://api.travelpayouts.com/data/
The file also contains the IATA codes of railway stations, bus stations and inactive airports. Pay attention to the name and flightable fields.
[
{
"code": "MQP",
"name": "Kruger Mpumalanga International Airport",
"coordinates": {
"lon": 31.098131,
"lat": -25.384947
},
"time_zone": "Africa/Johannesburg",
"name_translations": {
"de": "Nelspruit",
"en": "Kruger Mpumalanga International Airport",
"tr": "International Airport",
"it": "Kruger Mpumalanga",
"fr": "Kruger Mpumalanga",
"es": "Kruger Mpumalanga",
"th": "สนามบินเนลสปรุต"
},
"country_code": "ZA",
"city_code": "NLP"
}
]
Response parameters
The query http://api.travelpayouts.com/data/en/airlines.json?token=PutHereYourToken returns a file with a list of airlines from the database.
Additionally created translations for different languages http://api.travelpayouts.com/data/
[
{
"name": "Private flight",
"alias": null,
"iata": null,
"icao": null,
"callsign": null,
"country": null,
"is_active": true
}
]
Response parameters
The query http://api.travelpayouts.com/data/en/alliances.json?token=PutHereYourToken returns a file with a list of alliances from the database.
Additionally created translations for different languages http://api.travelpayouts.com/data/
[
{
"name": "oneworld",
"airlines": [
"4M",
"AA",
"AB",
"BA",
"CX",
"AY",
"HG",
"IB",
"JC",
"JL",
"JO",
"KA",
"LA",
"LP",
"MA",
"MN",
"MX",
"NU",
"QF",
"RJ",
"S7",
"XL"
]
}
]
Response parameters
The query http://api.travelpayouts.com/data/planes.json?token=PutHereYourToken returns a file with a list of airplanes from the database.
Additionally created translations for different languages http://api.travelpayouts.com/data/
[
{
"code": "100",
"name": "Fokker 100"
}
]
Response parameters
The query http://api.travelpayouts.com/data/routes.json?token=PutHereYourToken returns a file with a list of routes from the database.
[
{
"airline_iata": "2B",
"airline_icao": null,
"departure_airport_iata": "AER",
"departure_airport_icao": null,
"arrival_airport_iata": "DME",
"arrival_airport_icao": null,
"codeshare": false,
"transfers": 0,
"planes": [
"CR2"
]
}
]
Response parameters
Brings back the recent special offers from the airline companies in .XML format.
http://api.travelpayouts.com/v2/prices/special-offers?token=PutHereYourToken