Travel insights with Travelpayouts Data API

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 https://www.travelpayouts.com/programs/100/tools/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:

  • success — true for a successful request, false in case of errors
  • data — a result of the request; in case of an error is equal to null
  • error — short description of the error that prevented request completion; for a successful request is equal to null

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.

Flight price history

Brings back the list of prices found by our users during the most recent 48 hours according to the filters used.

Request

http://api.travelpayouts.com/v2/prices/latest?currency=usd&period_type=year&page=1&limit=30&show_to_affiliates=true&sorting=price&trip_class=0&token=PutHereYourToken

Request parameters

  • currency — the airline ticket’s The default value — RUB
  • origin — the point of departure. The city or airline IATA code. The length — from 2 to 3 symbols
  • destination — the point of destination. The city or airline IATA code. The length — from 2 to 3 symbols. If origin and destination are not specified, origin = MOW will be returned by default.
  • beginning_of_period — the beginning of the period, within which the dates of departure fall (in the YYYY-MM-DD format, for example, 2021-05-01). Must be specified if period_type is equal to month
  • period_type — the period for which the tickets have been found (the required parameter):
    • year — for the whole time
    • month — for a month
  • one_way — true — one way, false — back-to-back. The default value — false
  • page — a page number. The default value — 1
  • limit — the total number of records on a page. The default value — 30. The maximum value — 1000.
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • sorting — the assorting of prices:
    • price — by the price (the default value). For the directions, only city — city assorting by the price is possible
    • route — by the popularity of a route
    • distance_unit_price — by the price for 1 km 
  • trip_duration — the length of stay in weeks or days (for period_type=day)
  • token — individual affiliate token
  • unique — returns only unique directions, if origin was specified, but destination was not specified

Response example

{
   "success":true,
   "data":[{
      "show_to_affiliates":true,
      "trip_class":0,
      "origin":"WMI",
      "destination":"WRO",
      "depart_date":"2021-12-07",
      "return_date":"2021-12-13",
      "number_of_changes":0,
      "value":1183,
      "found_at":"2021-09-22T14:08:45+04:00",
      "distance":298,
      "actual":true
   }]
} 

Response parameters

  • origin — the point of departure
  • destination — the point of destination
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • trip_class — the flight class (0 — Economy class)
  • depart_date — the date of departure
  • return_date — the date of return
  • number_of_changes — the number of transfers
  • value — the cost of a flight, in the currency specified
  • found_at — the time and the date at/on which a ticket was found
  • distance — the distance between the point of departure and the point of destination
  • actual — the actuality of an offer
  • token — the individual affiliate token

The calendar of prices for a month

Brings back the prices for each day of a month, grouped together by number of transfers.

Request

http://api.travelpayouts.com/v2/prices/month-matrix?currency=usd&origin=LED&destination=HKT&show_to_affiliates=true&token=PutHereYourToken

Request parameters

  • currency — the airline ticket’s The default value — RUB
  • origin — the point of departure. The IATA city code or the country code. The length — from 2 to 3 symbols
  • destination — the point of destination. The IATA city code or the country code. The length — from 2 to 3 symbols
  • month — the beginning of the month in the YYYY-MM-DD format
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • token — the individual affiliate token
  • trip_duration — the length of stay in weeks. If not specified, the result will be tickets to one-way
  • one_way — false — returns roundtrip tickets, true — just the one way tickets. The default value — true.

Response example

{{
   "success":true,
   "data":[{
      "show_to_affiliates":true,
      "trip_class":0,
      "origin":"LED",
      "destination":"HKT",
      "depart_date":"2021-10-01",
      "return_date":"",
      "number_of_changes":1,
      "value":29127,
      "found_at":"2021-09-24T00:06:12+04:00",
      "distance":8015,
      "actual":true
   }]
}

Response parameters

  • origin — the point of departure
  • destination — the point of destination
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • trip_class — the flight class:
    • 0 — Economy class
    • 1 — Business class
    • 2 — First
  • depart_date — the date of departure
  • return_date — the date of return
  • number_of_changes — the number of transfers
  • value — the cost of a flight, in the currency specified
  • found_at — the time and the date at/on which a ticket was found
  • distance — the distance between the point of departure and the point of destination
  • actual — the actuality of an offer

The prices for the alternative directions (deprecated)

Brings back the prices for the directions between the nearest to the target cities.

Request

http://api.travelpayouts.com/v2/prices/nearest-places-matrix?currency=usd&origin=LED&destination=HKT&show_to_affiliates=true&token=PutHereYourToken

Request parameters

  • currency — the airline ticket’s The default value — RUB
  • origin — the point of departure. The IATA city code or the country code. The length — from 2 to 3 symbols
  • destination — the point of destination. The IATA city code or the country code. The length — from 2 to 3 symbols
  • limit — the number of variants entered, from 1 to 20, where 1 is just the variant with the specified points of departure and the points of destination
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • depart_date (optional) — month of departure (yyyy-mm)
  • return_date (optional) — month of return (yyyy-mm)
  • flexibility — expansion of the range of dates upward or downward. The value may vary from 0 to 7, where 0 shall show the variants for the dates specified and 7 shall show all the variants found for a week prior to the specified dates and a week after
  • distance — the number of variants entered, from 1 to 20, where 1 is just the variant with the specified points of departure and the points of destination
  • token — individual affiliate token

Response example

{
"prices":[
{
"value":26000.0,
"trip_class":0,
"show_to_affiliates":true,
"return_date":"2021-09-18",
"origin":"BAX",
"number_of_changes":0,
"gate":"AMADEUS",
"found_at":"2021-07-28T04:57:47Z",
"duration":null,
"distance":3643,
"destination":"SIP",
"depart_date":"2021-09-09",
"actual":true
}
],
"origins":[
"BAX"
],
"errors":{
"amadeus":{
}
},
"destinations":[
"SIP"
]
}

Response parameters

  • origin — the point of departure
  • destination — the point of destination
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • trip_class — the flight class:
    • 0 — Economy class
    • 1 — Business class
    • 2 — First
  • depart_date — the date of departure
  • return_date — the date of return
  • number_of_changes — the number of transfers
  • value — the cost of a flight, in the currency specified
  • found_at — the time and the date at/on which a ticket was found
  • distance — the distance between the point of departure and the point of destination.
  • actual — the actuality of an offer
  • duration — the flight duration in minutes, taking into account direct and expectations
  • errors — if the error «Some error occurred» is returned, this area does not have the data in the cache
  • gate — the agents, which was found on the ticket
  • token — the individual affiliate token

Cheapest tickets

Returns the cheapest non-stop tickets, as well as tickets with 1 or 2 stops, for the selected route with departure/return date filters.

Request

http://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2021–11&return_date=2021–12&token=PutHereYourToken

Important: Old dates may be specified in a query. No error will be generated, but no data will be returned.

Request parameters

  • origin — IATA code of the departure city. IATA code is shown by uppercase letters, for example, MOW
  • destination — IATA code of the destination city (for all routes send the empty field). IATA code is shown by uppercase letters, for example, MOW
  • depart_date (optional) — month of departure (yyyy-mm)
  • return_date (optional) — month of return (yyyy-mm)
  • page — optional parameter, is used to display the found data (by default the page displays 100 found prices. If the destination isn’t selected, there can be more data. In this case, use the page, to display the next set of data, for example, page=2)
  • token — individual affiliate token
  • currency — the currency of prices. The default value is RUB

Response example

{
   "success": true,
   "data": {
      "HKT": {
         "0": {
            "price": 35443,
            "airline": "UN",
            "flight_number": 571,
            "departure_at": "2021-06-09T21:20:00Z",
            "return_at": "2021-07-15T12:40:00Z",
            "expires_at": "2021-01-08T18:30:40Z"
         },
         "1": {
            "price": 27506,
            "airline": "CX",
            "flight_number": 204,
            "departure_at": "2021-06-05T16:40:00Z",
            "return_at": "2021-06-22T12:00:00Z",
            "expires_at": "2021-01-08T18:38:45Z"
         },
         "2": {
            "price": 31914,
            "airline": "AB",
            "flight_number": 8113,
            "departure_at": "2021-06-12T13:45:00Z",
            "return_at": "2021-06-24T20:30:00Z",
            "expires_at": "2021-01-08T15:17:42Z"
         }
      }
   }
}

Response parameters

  • 0, 1, 2 — sequence number in the search results
  • price — ticket price (in the currency specified in the currency parameter)
  • airline — IATA code of the airline operating the flight
  • flight_number — flight number
  • departure_at — departure Date
  • return_at — return Date
  • expires_at — date on which the found price expires (UTC+0)
  • token — individual affiliate token

Cheapest tickets grouped by month

Returns the cheapest non-stop tickets, as well as tickets with 1 or 2 stops, for the selected route grouped by month.

Request

http://api.travelpayouts.com/v1/prices/monthly?currency=USD&origin=MOW&destination=HKT&token=PutHereYourToken

Request parameters

  • origin — IATA code of the departure city. IATA code is shown by uppercase letters, for example, MOW
  • destination — IATA code of the destination city (for all routes, enter «-«). IATA code is shown by uppercase letters, for example, MOW
  • token — individual affiliate token
  • currency — the currency of prices. The default value is RUB

Response example

{
   "success": true,
   "data": {
      "2021-11":{
"origin": "MOW",
"destination": "HKT",
"price": 415,
"transfers": 2,
"airline": "MU",
"flight_number": 592,
"departure_at": "2021-11-30T19:10:00Z",
"return_at": "2021-12-26T03:00:00Z",
"expires_at": "2021-11-06T15:06:57Z"
      }    } }

Response parameters

  • 2021–11 — month of cheapest tickets
  • price — ticket price (in the currency specified in the currency parameter)
  • airline — IATA code of the airline operating the flight
  • flight_number — flight number
  • departure_at — departure date
  • return_at — return date
  • expires_at — date on which the found price expires (UTC+0)
  • origin — IATA code of the departure city
  • destination — IATA code of the destination city

Non-stop tickets

Returns the cheapest non-stop ticket for the selected route with departure/return date filters.

Request

http://api.travelpayouts.com/v1/prices/direct?origin=MOW&destination=LED&depart_date=2021–11&return_date=2021–12&token=PutHereYourToken

Request parameters

  • origin — IATA code of the departure city. The IATA code is shown in uppercase letters
  • destination — IATA code of the destination city (for all routes, enter «-«). The IATA code is shown in uppercase letters
  • depart_date (optional) — a month of departure (yyyy-mm)
  • return_date (optional) — a month of return (yyyy-mm)
  • token — individual affiliate token
  • currency — the currency of prices. The default value is RUB

Response example

{
   "success": true,
   "data": {
      "LED": {
         "0": {
            "price": 4363,
            "airline": "UT",
            "flight_number": 369,
            "departure_at": "2021-06-27T11:35:00Z",
            "return_at": "2021-07-04T16:00:00Z",
            "expires_at": "2021-01-08T20:21:46Z"
         }
      }
   }
}

Response parameters

  • price — ticket price (in specified currency)
  • airline — IATA code of airline operating the flight
  • flight_number — flight
  • departure_at — departure date
  • return_at — return date
  • expires_at — date on which the found price expires (UTC+0)

Flight price trends

Returns the cheapest non-stop, one-stop, and two-stop flights for the selected route for each day of the selected month.

Important: this method has a limit of 10 requests per second.

Request

http://api.travelpayouts.com/v1/prices/calendar?depart_date=2021–11&origin=MOW&destination=BCN&calendar_type=departure_date&token=PutHereYourToken

Request parameters

  • origin — IATA code of the departure city. The IATA code is shown in uppercase letters
  • destination — IATA code of the destination city. The IATA code is shown in uppercase letters
  • departure_date (optional) — a month of departure (yyyy-mm)
  • return_date (optional) — a month of return (yyyy-mm).
  • calendar_type — field used to build the calendar. Equal to either: departure_date or return_date
  • length (optional) — a length of stay in the destination city
  • token — individual affiliate token
  • currency — the currency of prices. The default value is RUB

Response example

{
   "success": true,
   "data": {
      "2021-06-01": {
         "origin": "MOW",
         "destination": "BCN",
         "price": 12449,
         "transfers": 1,
         "airline": "PS",
         "flight_number": 576,
         "departure_at": "2021-06-01T06:35:00Z",
         "return_at": "2021-07-01T13:30:00Z",
         "expires_at": "2021-01-07T12:34:14Z"
      },
      "2021-06-02": {
         "origin": "MOW",
         "destination": "BCN",
         "price": 13025,
         "transfers": 1,
         "airline": "PS",
         "flight_number": 578,
         "departure_at": "2021-06-02T17:00:00Z",
         "return_at": "2021-06-11T13:30:00Z",
         "expires_at": "2021-01-06T17:15:47Z"
      },
      ...
     "2021-06-30": {
         "origin": "MOW",
         "destination": "BCN",
         "price": 13025,
         "transfers": 1,
         "airline": "PS",
         "flight_number": 578,
         "departure_at": "2021-06-30T17:00:00Z",
         "return_at": "2021-07-23T13:30:00Z",
         "expires_at": "2021-01-07T20:15:34Z"
      }
   }
}

Response parameters

  • origin — IATA code of the departure city
  • destination — IATA code of the destination city
  • price — ticket price in the specified currency
  • transfers — number of stops
  • airline — IATA code of airline
  • flight_number — flight number
  • departure_at — departure date
  • return_at — return date
  • expires_at — when the found price expires (UTC+0)

Popular airline routes

Returns routes for which an airline operates flights, sorted by popularity.

Request

http://api.travelpayouts.com/v1/airline-directions?airline_code=SU&limit=10&token=PutHereYourToken

Request parameters

  • airline_code — IATA code of airline
  • limit — records limit per page. Default value is 100. Not less than 1000
  • token — individual affiliate token

Response example

{
   "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.

The calendar of prices for a week

Brings back the prices for the nearest dates to the target ones.

Request

http://api.travelpayouts.com/v2/prices/week-matrix?currency=usd&origin=LED&destination=HKT&show_to_affiliates=true&depart_date=2021-09-04&return_date=2021-09-18&token=PutHereYourToken

Request parameters

  • currency — the airline ticket’s The default value — RUB
  • origin — the point of departure. The IATA city code or the country code. The length — from 2 to 3 symbols
  • destination — the point of destination. The IATA city code or the country code. The length — from 2 to 3 symbols
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • depart_date (optional) — day or month of departure (yyyy-mm-dd or yyyy-mm)
  • return_date (optional) — day or month of return (yyyy-mm-dd or yyyy-mm)
  • token — individual affiliate token

Response example

{
  success:true,
  data:[
  {
    show_to_affiliates:true,
    trip_class:0,
    origin:LED,
    destination:HKT,
    depart_date:2021-03-01,
    return_date:2021-03-15,
    number_of_changes:1,
    value:71725,
    found_at:2021-02-19T00:04:37+04:00,
    distance:8015,
    actual:true
  }]
}

Response parameters

  • origin — the point of departure
  • destination — the point of destination
  • show_to_affiliates — false — all the prices, true — just the prices, found using the partner marker (recommended). The default value — true
  • trip_class — the flight class (0 — Economy class)
  • depart_date — the date of departure
  • return_date — the date of return
  • number_of_changes — the number of transfers
  • value — the cost of a flight, in the currency specified
  • found_at — the time and the date at/on which a ticket was found
  • distance — the distance between the point of departure and the point of destination
  • actual — the actuality of an offer

The popular destinations

Brings back the most popular directions from a specified city.

Request

http://api.travelpayouts.com/v1/city-directions?origin=MOW&currency=usd&token=PutHereYourToken

Request parameters

  • currency — the airline ticket’s The default value — RUB
  • origin — the point of departure. The IATA city code or the country code. The length — from 2 to 3 symbols
  • token — the individual affiliate token

Response example

{
  "success":true,
  "data":{
    "AER":{
      "origin":"MOW",
      "destination":"AER",
      "price":3673,
      "transfers":0,
      "airline":"WZ",
      "flight_number":125,
      "departure_at":"2021-03-08T16:35:00Z",
      "return_at":"2021-03-17T16:05:00Z",
      "expires_at":"2021-02-22T09:32:44Z"
    }
  },
  "error":null,
  "currency":"rub"
}

Response parameters

  • origin — the point of departure
  • destination — the point of destination
  • departure_at — the date of departure
  • return_at — the date of return
  • expires_at — the date on which the found price expires (UTC+0)
  • number_of_changes — the number of transfers
  • price — the cost of a flight, in the currency specified
  • found_at — the time and the date at/on which a ticket was found
  • transfers — the number of direct
  • airline — the IATA of the airline
  • flight_number— the flight number
  • currency — the currency of response

Logos of airlines

Flight logos are available here: http://pics.avs.io/width/height/iata.png

where, width — the width of the logo, height — the height of the logo, iata — IATA airline code. The size of the logo can be anything.

For example: http://pics.avs.io/200/200/UN.png.

Reduction of prices into the other currency

Brings back the current rate of all popular currencies to RUB.

Request

http://yasen.aviasales.ru/adaptors/currency.json

Example response

{
  "cny":8.24394,
  "eur":57.1578,
  "mzn":1.49643,
  "nio":1.97342,
  "usd":51.1388,
  "hrk":7.48953
}

Flights special offers

Brings back the recent special offers from the airline companies in. XML format.

Request

http://api.travelpayouts.com/v2/prices/special-offers?token=PutHereYourToken

http://www.jetradar.com/deals.atom/

Was this article helpful?

Have more questions? Submit a request