NAV Navbar
cURL Ruby PHP Python
  • About API
  • Flight Data Access API v1
  • Flight Data Access API v2
  • Some data in JSON format
  • Flights search API: Real-time and multi-city search
  • About API

    Travelpayouts Data API – the way to get travel insights for your site or blog. You can get flight price trends and find popular destinations for your customers.

    To access the API you should be registered in our travel affiliate program.

    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.

    Flight Data Access API v1

    Travelpayouts Flight Data API – the way to get travel insights for your site or blog. You can get flight price trends and find popular destinations for your customers.

    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/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 to use expired prices (the approximate expiration date is given in the value of the expires_at parameter).

    To obtain access to the API for searching for plane tickets and hotels, send a request.

    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.

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2017-11&return_date=2017-12' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2017-11&return_date=2017-12")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2017-11&return_date=2017-12",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v1/prices/cheap"
    
    querystring = {"origin":"MOW","destination":"HKT","depart_date":"2017-11","return_date":"2017-12"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2016-11&return_date=2016-12&token=PutHereYourToken

    Request parameters

    Parameter Default Description
    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.
    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).
    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 RUB Currency of prices

    Response

    The above command returns JSON structured like this:

    {
    "success": true,
    "data": {
        "HKT": {
            "0": {
                "price": 35443,
                "airline": "UN",
                "flight_number": 571,
                "departure_at": "2015-06-09T21:20:00Z",
                "return_at": "2015-07-15T12:40:00Z",
                "expires_at": "2015-01-08T18:30:40Z"
            }}
        }
    }
    
    Parameter Default Description
    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.

    Non-stop tickets

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2017-11&return_date=2017-12' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v1/prices/direct?origin=MOW&destination=LED&depart_date=2017-11&return_date=2017-12")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v1/prices/direct?origin=MOW&destination=LED&depart_date=2017-11&return_date=2017-12",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v1/prices/direct"
    
    querystring = {"origin":"MOW","destination":"LED","depart_date":"2017-11","return_date":"2017-12"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/v1/prices/direct?origin=MOW&destination=LED&depart_date=2016-11&return_date=2016-12&token=PutHereYourToken

    Request parameters

    Parameter Default Description
    origin - IATA code of departure city. IATA code is shown by uppercase letters, for example, MOW.
    destination - IATA code of destination city (for all routes, enter “-”). IATA code is shown by uppercase letters, for example, MOW.
    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.
    currency RUB Currency of prices

    Response

    The above command returns JSON structured like this:

    {
        "success": true,
        "data": {
            "LED": {
                "0": {
                    "price": 4363,
                    "airline": "UT",
                    "flight_number": 369,
                    "departure_at": "2015-06-27T11:35:00Z",
                    "return_at": "2015-07-04T16:00:00Z",
                    "expires_at": "2015-01-08T20:21:46Z"
                }
            }
        }
    }
    
    Parameter Default Description
    price - Ticket price (in specified currency).
    airline - IATA code of 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).

    Tickets for each day of a month

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/prices/calendar?depart_date=2017-11&origin=MOW&destination=BCN&calendar_type=departure_date&currency=USD' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v1/prices/calendar?depart_date=2017-11&origin=MOW&destination=BCN&calendar_type=departure_date&currency=USD")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v1/prices/calendar?depart_date=2017-11&origin=MOW&destination=BCN&calendar_type=departure_date&currency=USD",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v1/prices/calendar"
    
    querystring = {"depart_date":"2017-11","origin":"MOW","destination":"BCN","calendar_type":"departure_date","currency":"USD"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/v1/prices/calendar?depart_date=2016-11&origin=MOW&destination=BCN&calendar_type=departure_date&token=PutHereYourToken

    Request parameters

    Parameter Default Description
    origin - IATA code of departure city. IATA code is shown by uppercase letters, for example MOW.
    destination - IATA code of destination city. IATA code is shown by uppercase letters, for example MOW.
    departure_date - 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). Pay attention! If the return_date is not specified, you will get the "One way" flights.
    calendar_type - Field used to build the calendar. Equal to either: departure_date or return_date
    length (optional) - Length of stay in the destination city.
    token - Individual affiliate token.
    currency RUB Currency of prices

    Response

    The above command returns JSON structured like this:

    {
        "success": true,
        "data": {
            "2015-06-01": {
                "origin": "MOW",
                "destination": "BCN",
                "price": 12449,
                "transfers": 1,
                "airline": "PS",
                "flight_number": 576,
                "departure_at": "2015-06-01T06:35:00Z",
                "return_at": "2015-07-01T13:30:00Z",
                "expires_at": "2015-01-07T12:34:14Z"
            }
        }
    }
    
    Parameter Default Description
    origin - IATA code of departure city.
    destination - IATA code of 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).

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/airline-directions?airline_code=SU&limit=10' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v1/airline-directions?airline_code=SU&limit=10")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v1/airline-directions?airline_code=SU&limit=10",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v1/airline-directions"
    
    querystring = {"airline_code":"SU","limit":"10"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

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

    Request parameters

    Parameter Default Description
    airline_code - IATA code of airline.
    limit - Records limit per page. Default value is 100. Not less than 1000.
    token - Individual affiliate token.

    Response

    The above command returns JSON structured like this:

    {
        "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 the most popular directions from a specified city back.

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/city-directions?origin=MOW&currency=usd' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v1/city-directions?origin=MOW&currency=usd")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v1/city-directions?origin=MOW&currency=usd",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v1/city-directions"
    
    querystring = {"origin":"MOW","currency":"usd"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

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

    Request parameters

    Parameter Default Description
    currency RUB The airline tickets currency.
    origin - The point of departure. The IATA city code or the country code. The length - from 2 to 3 symbols.
    token - Individual affiliate token.

    Response

    The above command returns JSON structured like this:

    {
        "success":true,
        "data":{
            "AER":{
                "origin":"MOW",
                "destination":"AER",
                "price":3673,
                "transfers":0,
                "airline":"WZ",
                "flight_number":125,
                "departure_at":"2016-03-08T16:35:00Z",
                "return_at":"2016-03-17T16:05:00Z",
                "expires_at":"2016-02-22T09:32:44Z"
            }
        },
        "error":null,
        "currency":"rub"
    }
    
    Parameter Default Description
    origin - The point of departure.
    destination - The point of destination.
    departure_at - The date of departure.
    return_at - The date of return.
    expires_at - 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, for which a ticket was found.
    transfers - The number of directs.
    airline - IATA of an airline.
    flight_number - Flight number.
    currency - Currency of response.

    Flight Data Access API v2

    The server response is always sent in JSON format with the following structure:

    Dates are accepted in the formats YYYY-MM and YYYY-MM-DD.

    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 to use expired prices (the approximate expiration date is given in the value of the expires_at parameter).

    The prices for the airline tickets

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v2/prices/latest?currency=usd&period_type=year&page=1&limit=30&show_to_affiliates=true&sorting=price&trip_class=0' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v2/prices/latest?currency=usd&period_type=year&page=1&limit=30&show_to_affiliates=true&sorting=price&trip_class=0")
    
    https = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v2/prices/latest?currency=usd&period_type=year&page=1&limit=30&show_to_affiliates=true&sorting=price&trip_class=0",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v2/prices/latest"
    
    querystring = {"currency":"usd","period_type":"year","page":"1","limit":"30","show_to_affiliates":"true","sorting":"price","trip_class":"0"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET https://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

    Parameter Default Description
    currency RUB The airline ticket’s currency.
    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.
    beginning_of_period - The beginning of the period, within which the dates of departure fall (in the YYYY-MM-DD format, for example, 2016-05-01). Must be specified if period_type is equal to a 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 false true - one way, false - back-to-back.
    page 1 A page number.
    limit 30 The total number of records on a page. The maximum value - 1000.
    show_to_affiliates true false - all the prices, true - just the prices, found using the partner marker (recommended).
    sorting price The assorting of prices: price — by the price. 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 1 A page number.
    token - Individual affiliate token.

    Response

    The above command returns JSON structured like this:

    {
      "success": true,
      "data": [
        {
          "show_to_affiliates": true,
          "trip_class": 0,
          "origin": "BKK",
          "destination": "PHS",
          "depart_date": "2018-02-09",
          "return_date": "2018-02-11",
          "number_of_changes": 0,
          "value": 36.36,
          "found_at": "2017-07-24T06:33:32+04:00",
          "distance": 339,
          "actual": true
        }
      ]
    }
    
    Parameter Description
    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)
    trip_class The flight class: 0 — the economy class, 1 — the business class, 2 — the first 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, for 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 Individual affiliate token.

    The calendar of prices for a month

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v2/prices/month-matrix?currency=usd&show_to_affiliates=true&origin=LED&destination=HKT' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v2/prices/month-matrix?currency=usd&show_to_affiliates=true&origin=LED&destination=HKT")
    
    https = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v2/prices/month-matrix?currency=usd&show_to_affiliates=true&origin=LED&destination=HKT",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v2/prices/month-matrix"
    
    querystring = {"currency":"usd","show_to_affiliates":"true","origin":"LED","destination":"HKT"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

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

    Request parameters

    Parameter Default Description
    currency RUB The airline ticket’s currency
    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 true False - all the prices, true - just the prices, found using the partner marker (recommended).
    token - Individual affiliate token.

    Response

    The above command returns JSON structured like this:

    {
        "success":true,
        "data":[{
            "show_to_affiliates":true,
            "trip_class":0,
            "origin":"LED",
            "destination":"HKT",
            "depart_date":"2015-10-01",
            "return_date":"",
            "number_of_changes":1,
            "value":29127,
            "found_at":"2015-09-24T00:06:12+04:00",
            "distance":8015,
            "actual":true
        }]
    }
    
    Parameter Description
    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).
    trip_class The flight class: 0 — The economy class, 1 — The business class, 2 — The first 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, for 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

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v2/prices/nearest-places-matrix?currency=usd&show_to_affiliates=true&origin=LED&destination=HKT' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v2/prices/nearest-places-matrix?currency=usd&show_to_affiliates=true&origin=LED&destination=HKT")
    
    https = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v2/prices/nearest-places-matrix?currency=usd&show_to_affiliates=true&origin=LED&destination=HKT",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v2/prices/nearest-places-matrix"
    
    querystring = {"currency":"usd","show_to_affiliates":"true","origin":"LED","destination":"HKT"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

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

    Request parameters

    Parameter Default Description
    currency RUB The airline ticket’s currency
    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 true False - all the prices, true - just the prices, found using the partner marker (recommended).
    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).
    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, 7 – 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

    The above command returns JSON structured like this:

    {
    "prices":[{
        "value":26000.0,
        "trip_class":0,
        "show_to_affiliates":true,
        "return_date":"2016-09-18",
        "origin":"BAX",
        "number_of_changes":0,
        "gate":"AMADEUS",
        "found_at":"2016-07-28T04:57:47Z",
        "duration":null,
        "distance":3643,
        "destination":"SIP",
        "depart_date":"2016-09-09",
        "actual":true
        }],
    "origins":[
        "BAX"
        ],
    "errors":{
        "amadeus":{
        }},
    "destinations":[
        "SIP"
        ]
    }
    
    Parameter Description
    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).
    trip_class The flight class: 0 — the economy class, 1 — the business class, 2 — the first 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, for 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 Flight duration in minutes, taking into account direct and expectations.
    errors If the error "Some error occurred" is returned, so in this area do not have the data in the cache.
    gate The agents, which was found on the ticket.
    token Individual affiliate token.

    The calendar of prices for a week

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

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/v2/prices/week-matrix?currency=usd&origin=LED&destination=HKT&show_to_affiliates=true&depart_date=2017-11-04&return_date=2017-11-18' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/v2/prices/week-matrix?currency=usd&origin=LED&destination=HKT&show_to_affiliates=true&depart_date=2017-11-04&return_date=2017-11-18")
    
    https = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/v2/prices/week-matrix?currency=usd&origin=LED&destination=HKT&show_to_affiliates=true&depart_date=2017-11-04&return_date=2017-11-18",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/v2/prices/week-matrix"
    
    querystring = {"currency":"usd","origin":"LED","destination":"HKT","show_to_affiliates":"true","depart_date":"2017-11-04","return_date":"2017-11-18"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

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

    Request parameters

    Parameter Default Description
    currency RUB The airline tickets currency.
    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 true False - all the prices, true - just the prices, found using the partner marker (recommended).
    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

    The above command returns JSON structured like this:

    {
        "success":true,
        "data":[
        {
            "show_to_affiliates":true,
            "trip_class":0,
            "origin":"LED",
            "destination":"HKT",
            "depart_date":"2016-03-01",
            "return_date":"2016-03-15",
            "number_of_changes":1,
            "value":71725,
            "found_at":"2016-02-19T00:04:37+04:00",
            "distance":8015,
            "actual":true
        }]
    }
    
    Parameter Description
    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).
    trip_class The flight class: 0 — the economy class, 1 — the business class, 2 — the first 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, for 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 definition of a user's location by IP address

    The query is returned the IATA-code and the name of the nearest city from the user.

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://www.travelpayouts.com/whereami?locale=ru&callback=useriata&ip=62.105.128.0' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'rubygems' if RUBY_VERSION < '1.9'
    require 'rest_client'
    
    headers  = {:x_access_token => "YOUR_API_TOKEN_HERE"}
    response = RestClient.get "https://www.travelpayouts.com/whereami?locale=ru&callback=useriata&ip=62.105.128.0", headers
    puts response
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://www.travelpayouts.com/whereami?locale=ru&callback=useriata&ip=62.105.128.0",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    from urllib2 import Request, urlopen
    headers = {"X-Access-Token": "YOUR_API_TOKEN_HERE"}
    request = Request("https://www.travelpayouts.com/whereami?locale=ru&callback=useriata&ip=62.105.128.0", headers=headers)
    response_body = urlopen(request).read()
    print response_body
    

    Request

    GET https://www.travelpayouts.com/whereami?locale=ru&callback=useriata&ip=62.105.128.0

    Request parameters

    Parameter Default Description
    locale Russian The language in which returns the name of the city (available languages: en, ru, de, fr, it, pl, th.);
    callback - Specifies the name of the function, which contains a response to a query (mandatory);
    ip - Ip-addresses of the users (if the address is not passed, the system determines IP from the header of the request).

    Response

    The above command returns JSON structured like this:

    useriata ({"iata": "MOW", "name": "Moscow"})
    
    Parameter Description
    iata IATA code of the city where the user is located;
    name The name of the city.

    Special offers

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

    Run in Postman

    Request

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

    Some data in JSON format

    Data of countries in JSON format

    The query returns a file with a list of countries from the database.

    Run in Postman

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/countries.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = "https://api.travelpayouts.com/data/en/countries.json"
    https = Net::HTTPS.new(url.host, url.port)
    
    request = Net::HTTPS::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/countries.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/data/en/countries.json"
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/data/en/countries.json

    Response

    The above command returns JSON structured like this:

    [{
        "code":"NC",
        "name":"New Caledonia",
        "currency":"XPF",
        "name_translations":{
            "de":"Neukaledonien",
            "en":"New Caledonia",
            "tr":"Yeni Kaledonya",
            "ru":"Новая Каледония",
            "fr":"Nouvelle-Caledonie",
            "es":"Nueva Caledonia",
            "it":"Nuova Caledonia"
        }}
    ]
    
    Parameter Default Description
    code - IATA-code of country.
    name - Country name.
    currency - Currency country.
    name_translations - Translation of country name.

    City data in JSON format

    The query returns a file with a list of cities from the database.

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/cities.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/data/en/cities.json")
    
    https = Net::HTTPS.new(url.host, url.port)
    
    request = Net::HTTPS::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/cities.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/data/en/cities.json"
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/data/en/cities.json

    Response

    The above command returns JSON structured like this:

    [{
        "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"
    }]
    
    Parameter Default Description
    code - City IATA-code.
    name - City name.
    coordinates - City coordinates.
    time_zone - Timezone relative to GMT.
    name_translations - Translation of city name.
    country_code - Country IATA-code.

    Airport data in json format

    The query returns a file with a list of airports from the database.

    Run in Postman

    Example of request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/airports.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/data/en/airports.json")
    
    https = Net::HTTPS.new(url.host, url.port)
    
    request = Net::HTTPS::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/airports.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/data/en/airports.json"
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/data/en/airports.json

    Response

    The above command returns JSON structured like this:

    [{
        "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"
    }]
    
    Parameter Default Description
    code - Airport IATA code.
    name - Airport name.
    lon - Airport longitude.
    lat - Airport latitude.
    time_zone - Time zone relative to GMT.
    name_translations - The name of the airport in different languages.
    country_code - Country IATA code.
    city_code - City IATA code.

    Airline data in JSON format

    The query returns a file with a list of airlines from the database.

    Run in Postman

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/airlines.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://api.travelpayouts.com/data/en/airlines.json")
    
    https = Net::HTTPS.new(url.host, url.port)
    
    request = Net::HTTPS::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/airlines.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://api.travelpayouts.com/data/en/airlines.json"
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers)
    
    print(response.text)
    

    Request

    GET https://api.travelpayouts.com/data/en/airlines.json

    Response

    The above command returns JSON structured like this:

    [{
        "name":"Private flight",
        "alias":null,
        "iata":null,
        "icao":null,
        "callsign":null,
        "country":null,
        "is_active":true
    }]
    
    Parameter Default Description
    name - Airline name.
    alias - Alliance name (if the airline is an alliance member).
    iata - Airline IATA code.
    icao - Airline ICAO code.
    callsign - Airline call sign.
    country - Airline country of registration.
    is_active - True: company is active, false: company is not active.

    Alliance data in JSON format

    The query returns a file with a list of alliances from the database.

    Example of a request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/airlines_alliances.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'rubygems' if RUBY_VERSION < '1.9'
    require 'rest_client'
    
    headers  = {:x_access_token => "YOUR_API_TOKEN_HERE"}
    response = RestClient.get "https://api.travelpayouts.com/data/en/airlines_alliances.json", headers
    puts response
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/airlines_alliances.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    from urllib2 import Request, urlopen
    headers = {"X-Access-Token": "YOUR_API_TOKEN_HERE"}
    request = Request("https://api.travelpayouts.com/data/en/airlines_alliances.json", headers=headers)
    response_body = urlopen(request).read()
    print response_body
    

    Request

    GET https://api.travelpayouts.com/data/en/airlines_alliances.json

    Response

    The above command returns JSON structured like this:

    [{
        "name":"oneworld",
        "airlines":["4M","AA","AB","BA"]
    }]
    
    Parameter Default Description
    name - Alliance name.
    airlines - Codes for alliance member companies.

    Airplane data in json format

    The query returns a file with a list of airplanes from the database.

    Run in Postman

    Example of request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/planes.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'rubygems' if RUBY_VERSION < '1.9'
    require 'rest_client'
    
    headers  = {:x_access_token => "YOUR_API_TOKEN_HERE"}
    response = RestClient.get "https://api.travelpayouts.com/data/en/planes.json", headers
    puts response
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/planes.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    from urllib2 import Request, urlopen
    headers = {"X-Access-Token": "YOUR_API_TOKEN_HERE"}
    request = Request("https://api.travelpayouts.com/data/en/planes.json", headers=headers)
    response_body = urlopen(request).read()
    print response_body
    

    Request

    GET https://api.travelpayouts.com/data/en/planes.json

    Response

    The above command returns JSON structured like this:

    [{
        "code":"100",
        "name":"Fokker 100"
    }]
    
    Parameter Default Description
    code - Plane IATA code.
    name - Plane name.

    Routes list in json format

    The query returns a file with a list of routes from the database.

    Run in Postman

    Example of request:

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/en/routes.json' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'rubygems' if RUBY_VERSION < '1.9'
    require 'rest_client'
    
    headers  = {:x_access_token => "YOUR_API_TOKEN_HERE"}
    response = RestClient.get "https://api.travelpayouts.com/data/en/routes.json", headers
    puts response
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/en/routes.json",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
      CURLOPT_HTTPHEADER => array(
        "x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b"
      ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    from urllib2 import Request, urlopen
    headers = {"X-Access-Token": "YOUR_API_TOKEN_HERE"}
    request = Request("https://api.travelpayouts.com/data/en/routes.json", headers=headers)
    response_body = urlopen(request).read()
    print response_body
    

    Request

    GET https://api.travelpayouts.com/data/en/routes.json

    Response

    The above command returns JSON structured like this:

    [{
        "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"
        ]
    }]
    
    Parameter Default Description
    airline_iata - IATA of an airline.
    airline_icao - ICAO of an airline.
    departure_airport_iata - IATA of an airport of departure.
    departure_airport_icao - ICAO of an airport of departure.
    arrival_airport_iata - IATA of an airport of arrival.
    arrival_airport_icao - ICAO of an airport of arrival.
    codeshare - It shows whether the flight performs the same company that sells the ticket.
    transfers - The number of directs.
    planes - IATA of an airplane.

    Flights search API: Real-time and multi-city search

    With the help of API, you can get the results of requests in real time and create a Multi-City search.

    By default, one partner may send no more than 200 queries per hour for one IP, using the airline tickets search API. This restriction may be changed if a situation so requires.

    Аccess to the flights search API

    To access the flights search API you should be registered in our travel affiliate program and submit your request on with the following information:

    The conversion rate for searches via the Buy link must be 9% or more. The conversion rate from the Buy button to actual purchases must be at least 5%. We'll also need to see the URL of your project, design prototypes, a description of your project, and how our API will be used.

    Roundtrip

    Run in Postman

    Request parameters

    Body example

    {
        "signature": "MD5_signature",
        "marker": "Put_Your_Marker_Here",
        "host": your_server_host,
        "user_ip": user_ip_address,
        "locale": "en",
        "trip_class": "Y",
        "passengers": {
            "adults": "1",
            "children": "0",
            "infants": "0"
        },
        "segments": [
        {
            "origin": "MOW",
            "destination": "LON",
            "date": "2018-05-25"
        },
        {
            "origin": "LON",
            "destination": "MOW",
            "date": "2018-06-18"
        }
        ]
    } 
    
    Parameter Default Description
    marker - the unique identifier of the affiliate. You can find your marker in the affiliate personal account
    host - host's request (must be replaced by the address of your website where the API will be used)
    user_ip - user's IP address
    locale - language of the search result (en-us, en-gb, ru, de, es, fr, pl). Аrom the locale depends on the set of agencies on which the search is performed
    trip_class - flight class (Y – Economy, C – Business)
    passengers - passenger Information
    adults - the number of adult passengers (from 1 to 9)
    children - the number of children (from 0 to 6)
    infants - the number of infants (from 0 to 6)
    segments - a list of the trip components:
  • origin - origin IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Paris, France (PAR)");
  • destination - destination IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Berlin, Germany (BER)");
  • date - departure date yyyy-mm-dd (for example, "2015-09-08");
  • currency - the currency in which the price of the ticket is displayed, after switching to the agency's website (provided that the agency supports this currency);
    signature - the request signature is constructed from token, marker, and all the values of the query parameters sorted alphabetically and separated by a colon. Learn how to create a signature look here.

    To get "Round trip" tickets, add a JSON to the body of the request:

    Request example

    curl -v -X POST -d '{"signature":"%MD5_signature%","marker":"%Put_Your_Marker_Here%","host":"beta.as.ru","user_ip":"127.0.0.1","locale":"ru","trip_class":"Y","passengers":{"adults":1,"children":0,"infants":0},"segments":[{"origin":"MOW","destination":"LON","date":"2018-05-25"},{"origin":"LON","destination":"MOW","date":"2018-06-18"}]}' -H 'Content-type:application/json' https://api.tp.com/v1/flight_search
    

    Response

    The answer comes in JSON format. The response contains the parameters:

    {
      "chain_name": "jetradar_rt_search_native_format",
      "locale": "en",
      "user_env": {
      },
      "meta": {
        "uuid": "d9266de5-7578-418f-9ddc-6b176ae45923"
      },
      "host": "beta.aviasales.ru",
      "segments": [
        {
          "origin": "CPH",
          "original_origin": "CPH",
          "origin_country": "DK",
          "destination": "ROM",
          "date": "2018-06-24",
          "destination_country": "IT",
          "original_destination": "ROM"
        },
        {
          "origin": "ROM",
          "original_origin": "ROM",
          "origin_country": "IT",
          "destination": "CPH",
          "date": "2018-06-25",
          "destination_country": "DK",
          "original_destination": "CPH"
        }
      ],
      "affiliate_has_sales": true,
      "show_ads": true,
      "destination_country": "IT",
      "passengers": {
        "children": 0,
        "adults": 1,
        "infants": 0
      },
      "currency_rates": {
        "lak": 0.0075,
        "czk": 2.95961
      },
      "travelpayouts_api_request": true,
      "auid": null,
      "server_name": "zoo39.int.avs.io.yasen.bee.13",
      "know_english": "false",
      "currency": "usd",
      "range": "false",
      "geoip_city": "Unknown",
      "metropoly_airports": {
        "CPH": [
          "CPH",
          "CPH",
          "ZGH",
          "RKE"
        ],
        "ROM": [
          "ROM",
          "IRR",
          "FCO",
          "ROM",
          "XRJ",
          "IRT",
          "CIA"
        ]
      },
      "search_depth": 60,
      "signature": "fb7ded0ddd86270a262d832322f46093",
      "trip_class": "Y",
      "affiliate": true,
      "initiated_at": "2018-04-26 05:09:42.031853",
      "user_id": null,
      "start_search_timestamp": 1524719382.03045,
      "gates_count": 0,
      "market": "dk",
      "user_ip": null,
      "internal": false,
      "_ga": null,
      "clean_marker": "xxxxx",
      "open_jaw": false,
      "origin_country": "DK",
      "marker": "xxxxx",
      "search_id": "d9266de5-7578-418f-9ddc-6b176ae45923",
      "geoip_country": "Unknown"
    }
    
    Parameter Description
    locale the language of the search result
    search_id the unique identifier for the search query used to search results
    geoip_city the geoip of the city where the request was made
    trip_class the class of trip
    affiliate the affiliate ID
    marker the unique identifier of the affiliate;
    user_ip the user's IP address
    gates_count the total number of agencies
    segments a list of the trip components:
  • date - departure date;
  • origin - origin IATA;
  • destination - destination IATA;
  • meta - technical information;
  • uuid - unique identifier of the request;
  • passengers - passenger information;
  • adults - the number of adult passengers;
  • children- the number of children;
  • infants - the number of infants;
  • host - host's request;
  • currency_rates - exchange rate;
  • geoip_country - the geoip of the country where the request was made
  • One way

    Request initialization

    To get "One-way" tickets, add a JSON into the body of the request.

    Body example

    {
        "signature": "%MD5_signature%",
        "marker": "%Put_Your_Marker_Here%",
        "host": "beta.as.ru",
        "user_ip": "127.0.0.1",
        "locale": "ru",
        "trip_class": "Y",
        "passengers": {
            "adults": 1,
            "children": 0,
            "infants": 0
        },
        "segments": [
            {
                "origin": "MOW",
                "destination": "LED",
                "date": "2017-06-18"
            }
        ]
    }
    

    To get data, use the initialization code of the search:

    Request example

    curl -v -X POST -d '{"signature":"%MD5_signature%","marker":"%Put_Your_Marker_Here%","host":"beta.as.ru","user_ip":"127.0.0.1","locale":"ru","trip_class":"Y","passengers":{"adults":1,"children":0,"infants":0},"segments":[{"origin":"MOW","destination":"LED","date":"2017-06-18"}]}' -H 'Content-type:application/json' https://api.tp.com/v1/flight_search
    

    Open jaw

    Request initialization

    Open jaw is a round-trip ticket in which the traveller does not arrive in the same city of departure and/or does not depart from the same city where he/she first landed. For example, London - Paris - Berlin - London.

    To get "Open jaw" tickets, add a JSON into the body of the request:

    Body example

    {
        "signature": "%MD5_signature%",
        "marker": "%Put_Your_Marker_Here%",
        "host": "beta.as.ru",
        "user_ip": "127.0.0.1",
        "locale": "ru",
        "trip_class": "Y",
        "passengers": {
            "adults": 1,
            "children": 0,
            "infants": 0
        },
        "segments": [
            {
                "origin": "MOW",
                "destination": "LED",
                "date": "2017-06-18"
            }
        ]
    }
    

    Request parameters

    Parameter Default Description
    marker - the unique identifier of the affiliate. You can find your marker in the affiliate personal account
    host - host's request (must be replaced by the address of your website where the API will be used)
    user_ip - user's IP address
    locale - language of the search result (en-us, en-gb, ru, de, es, fr, pl). Аrom the locale depends on the set of agencies on which the search is performed
    trip_class - flight class (Y – Economy, C – Business)
    passengers - passenger Information
    adults - the number of adult passengers (from 1 to 9)
    children - the number of children (from 0 to 6)
    infants - the number of infants (from 0 to 6)
    segments - a list of the trip components:
  • origin - origin IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Paris, France (PAR)");
  • destination - destination IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Berlin, Germany (BER)");
  • date - departure date yyyy-mm-dd (for example, "2015-09-08");
  • currency - the currency in which the price of the ticket is displayed, after switching to the agency's website (provided that the agency supports this currency);
    signature - the request signature is constructed from token, marker, and all the values of the query parameters sorted alphabetically and separated by a colon. Learn how to create a signature look here.

    Body example

    {
        "signature": "%MD5_signature%",
        "marker": "%Put_Your_Marker_Here%",
        "host": "beta.as.ru",
        "user_ip": "127.0.0.1",
        "locale": "ru",
        "trip_class": "Y",
        "passengers": {
            "adults": 1,
            "children": 0,
            "infants": 0
        },
        "segments": [
            {
                "origin": "MOW",
                "destination": "LED",
                "date": "2017-02-18"
            },
            {
                "origin": "LED",
                "destination": "BER",
                "date": "2017-02-25"
            },
            {
                "origin": "BER",
                "destination": "LON",
                "date": "2017-03-05"
            }
        ]
    }
    

    To get data, use the initialization code of the search:

    Request example

    curl -v -X POST -d '{"signature":"%MD5_signature%","marker":"%Put_Your_Marker_Here%","host":"beta.as.ru","user_ip":"127.0.0.1","locale":"ru","trip_class":"Y","passengers":{"adults":1,"children":0,"infants":0},"segments":[{"origin":"MOW","destination":"LED","date":"2017-06-18"},{"origin":"LED","destination":"BER","date":"2017-06-25"},{"origin":"BER","destination":"LON","date":"2017-07-05"}]}' -H 'Content-type:application/json' https://api.tp.com/v1/flight_search
    

    Getting search results

    In the body of the response is the parameter search_id; insert it into the URL:

    https://api.tp.com/v1/flight_search_results?uuid=%search_id%

    Then send the request to the server for search results:

    Request example

    curl -v -H 'Accept-Encoding:gzip,deflate,sdch' https://api.tp.com/v1/flight_search_results?uuid=%search_id% 
    --compressed
    

    Example of answer

    Response example

    [{
        "segments":[
        {
            "destination_country":"RU",
            "original_destination":"LED",
            "origin":"MOW",
            "origin_country":"RU",
            "original_origin":"MOW",
            "date":"2017-05-25",
            "destination":"LED"
        },
        {
            "destination_country":"RU",
            "original_destination":"MOW",
            "origin":"LED",
            "origin_country":"RU",
            "original_origin":"LED",
            "date":"2017-06-18",
            "destination":"MOW"
        }],
        "banner_info":{
        },
            "internal":false,
            "airports":{
                "LED":{
                    "name":"Пулково",
                    "time_zone":"Europe/Moscow",
                    "country":"Россия",
                    "rates":"259",
                    "city":"Санкт-Петербург"
                },
                "DME":{
                    "name":"Домодедово",
                    "time_zone":"Europe/Moscow",
                    "country":"Россия",
                    "rates":"392",
                    "city":"Москва"
                },
                "SVO":{
                    "rates":"307",
                    "country":"Россия",
                    "name":"Шереметьево",
                    "average_rate":"3.63",
                    "city":"Москва",
                    "time_zone":"Europe/Moscow"
                },
                "VKO":{
                    "name":"Внуково",
                    "time_zone":"Europe/Moscow",
                    "country":"Россия",
                    "rates":"211",
                    "city":"Москва"
                }},
                "gates_info":{
                    "20":{
                        "average_rate":4.43,
                        "rates":2967,
                        "currency_code":"rub",
                        "is_airline":false,
                        "productivity":16.9991,
                        "label":"OneTwoTrip",
                        "airline_iatas":{
                        },
                        "payment_methods":[
                            "card"
                        ],
                        "mobile_version":false
                        }},
                        "city_distance":634,
                        "meta":{
                            "uuid":"c9c6de8c-3fb4-404e-b88c-e9e0a605f183",
                            "gates":[
                            {
                                "duration":22.402996063232422,
                                "id":20,
                                "count":1456,
                                "good_count":1456
                            }]},
                        "airlines":{
                            "SU":{
                                "average_rate":"4.01",
                                "rates":"2362",
                                "alliance_name":"SkyTeam",
                                "name":"Аэрофлот",
                                "id":10
                            },
                            "UN":{
                                "average_rate":"3.98",
                                "rates":"2639",
                                "alliance_name":null,
                                "name":"Трансаэро",
                                "id":492
                            },
                            "S7":{
                                "average_rate":"3.95",
                                "rates":"2430",
                                "alliance_name":"OneWorld",
                                "name":"S7",
                                "id":444
                            },
                            "UT":{
                                "rates":"1843",
                                "alliance_name":null,
                                "name":"ЮТэйр",
                                "id":507
                            },
                            "U6":{
                                "average_rate":"3.62",
                                "rates":"1158",
                                "alliance_name":null,
                                "name":"Уральские авиалинии",
                                "id":503
                            }},
                        "filters_boundary":{
                            "arrival_datetime_0":{
                                "min":1418869200,
                                "max":1418950500
                            },
                            "arrival_datetime_1":{
                                "min":1419486600,
                                "max":1419554400
                            },
                            "flights_duration":{
                                "min":70,
                                "max":120
                            },
                            "stops_count":{
                                "0":4431
                            },
                            "departure_time_1":{
                                "min":"04:30",
                                "max":"22:55"
                            },
                            "departure_time_0":{
                                "min":"00:50",
                                "max":"23:30"
                            },
                            "departure_minutes_0":{
                                "min":50,
                                "max":1410
                            },
                            "departure_minutes_1":{
                                "min":270,
                                "max":1375
                            },
                            "price":{
                                "min":4431,
                                "max":8689
                            }},
                        "flight_numbers":[
                        [
                            "SU30",
                            "SU32"
                        ],
                        [
                            "SU31",
                            "SU33"
                        ]],
                        "affiliate_has_sales":false,
                        "proposals":[
                            {
                                "terms":{
                                    "20":{
                                        "url":2000000,
                                        "unified_price":5867,
                                        "price":5867,
                                        "currency":"rub"
                                }},
                                "sign":"7573ea707c2ff84b243241961412ed34",
                                "segment":[
                                {
                                    "flight":[
                                    {
                                        "arrival":"LED",
                                        "aircraft":"AIRBUS A320",
                                        "local_departure_timestamp":1434588600,
                                        "operating_carrier":"UT",
                                        "duration":85,
                                        "local_arrival_timestamp":1432549200,
                                        "departure_date":"2015-05-25",
                                        "departure_time":"11:00",
                                        "arrival_date":"2015-05-25",
                                        "arrival_time":"12:25",
                                        "delay":0,
                                        "departure":"VKO",
                                        "number":369
                                }]},
                            {
                                "flight":[
                                {
                                    "arrival":"DME",
                                    "aircraft":"AIRBUS A320",
                                    "local_departure_timestamp":1434588600,
                                    "operating_carrier":"SU",
                                    "duration":90,
                                    "local_arrival_timestamp":1432549200,
                                    "departure_date":"2015-06-18",
                                    "departure_time":"10:05",
                                    "arrival_date":"2015-06-18",
                                    "arrival_time":"11:35",
                                    "delay":0,
                                    "departure":"LED",
                                    "number":6131
                            }]}]},
                       ]}],
                "validating_carrier": "SU"
            }],
        "_ga":null,
        "signature":"4bb635b9353a1e933907d41841e23414",
        "search_id":"c9c6de8c-3fb4-404e-b88c-e9e0a605f183"
        },
        {
        "search_id":"c9c6de8c-3fb4-404e-b88c-e9e0a605f183"
    }]
    

    The response includes the data:

    Parameter Default Description
    search_id - unique identifier for the search query
    flight_numbers - numbers of the flight
    meta -
  • gates - information about phases of gates in the search process;
  • good_count - number of relevant tickets (if the agency has returned the ticket for the wrong dates or they are misspelled, they are filtered out by the system);
  • count - number of tickets uploaded from the agency;
  • duration - processing time of request;
  • id - ID agency;
  • error - error information;
  • tos -content of error.
  • uuid - request ID;
    city_distance - distance between the cities of origin and destination;
    gates_info - information about the agent (Ticket Seller):
  • currency_code - payment currency code;
  • is_airline - is an airline;
  • average_rate - average rating of agencies;
  • rates - rating agency (count voters);
  • mobile_version - having a mobile version of the site;
  • productivity - productivity;
  • airline_iatas - IATA airline code, if the gate sells tickets;
  • payment_methods - payment methods;
  • label - agency name.
  • signature - signature of request
    segments - array data of flights:
  • destination_country - code of the country of destination;
  • original_destination - code of the city of destination;
  • origin - origin IATA;
  • destination - destination IATA;
  • origin_country - the origin country;
  • date - departure date.
  • flight_numbers - flight numbers
    airlines - information about the airlines:
  • deeplink_site_name - address of the airline's website;
  • id - identification number of the airline;
  • site_name - name of the airline's website;
  • alliance_name - alliance of the airline;
  • average_rate - average rating;
  • rates - number of ratings;
  • deeplink_id - ID links to airline's website;
  • name - name of airline.
  • proposals - an array of variants
    segment
    sign - unique id of the ticket, to integrate information from different agencies in one ticket;
    flight - flight details:
  • departure - departure IATA code;
  • duration - flight duration in minutes;
  • departure_date - departure date (UNIX-time);
  • departure_time - departure time (UNIX-time);
  • local_departure_timestamp - local departure time in UNIX format;
  • arrival_time - arrival time (UNIX-time);
  • local_arrival_timestamp - local arrival time in UNIX format;
  • number - flight number. To generate a full flight number, use the number and operating_carrier parameters;
  • delay - duration of stop between flights (in minutes);
  • operating_carrier - IATA code of airline that performs the carriage;
  • arrival_date - arrival date;
  • aircraft - type of aircraft;
  • rating_summary - some rating information about agency or airline (can be blank);
  • is_bus, is_train — true, if in this segment they do not travel by plane, but by bus or train;
  • arrival - IATA code of arrival.
  • terms - information about the flight’s cost:
  • price - trip price in original currency (type listed in the field currency);
  • currency - currency type;
  • flights_baggage - the number of pieces of baggage and its weight. "" - there is no information about baggage; false - baggage is not included in a price; {int}PC{int} - number of bags by %somevalue% kilogram. For example, 2PC23 - means two baggage pieces of 23 kg. {int} - number of bags does not matter, the total weight is limited.
  • unified_price - price of flight in basic currency (Russian ruble);
  • url - code to generate links for buyers (as forming the link; see below).
  • airports - information about airports;
    market - market of routes;
    initiated_at - date and time of search;
    open_jaw - true if it is part of open jaw;
    clean_marker - affiliate marker;
    currency - currency type;
    flight_info - information about routes: {RouteNumber}
  • ontime_percent - delay persant; min - min number of delay; max - max number of delay; mean - average number of delay.
  • IATA - IATA code;
  • city - city where airport is located;
  • average_rate - average rating of airport;
  • rates - number of ratings;
  • country - country where airport is located;
  • name - airport name;
  • time_zone - time zone of airport.
  • filters_boundary - array data for filtering:
  • stops_duration - time between flights (maximum and minimum);
  • flights_duration - flights duration (maximum and minimum);
  • arrival_datetime_0 - arrival datetime (maximum and minimum);
  • price - price of flights (maximum and minimum);
  • departure_time_0 - departure time (maximum and minimum);
  • stops_count - stops count.
  • Additional Information in the response

    Some airline companies and agencies provide additional information about flights, aircraft, and onboard services. These fields and their content are described below. You may use this information on your websites or ignore it — the main information about the tickets is given above.

    Parameter Default Description
    banner_info - service information provided by an airline company
    airlines/AF/ - information from a specific airline company (where AF is the IATA designator code):
  • jets — information about the airline company’s aircraft:
    • seatType — seat type in an aircraft (Angle Lie Flat, Flat Bed — special seat, can be transformed into a bed, etc.; Standard — standard seat);
    • typeClass — class type (Business class, Economy class);
    • seatWidth — seat width (inches);
    • aircraft — aircraft type; seatPitch — distance between the seats (inches);
    • videoType — video type (Overhead TV — on a seat, located in front, On-Demand TV — common TV, headphones are given on demand, None — unavailable);
    • wifi — Wi-Fi on-board;
    • id — unique aircraft ID (service parameter);
    • powerType — availability of an AV receptacle in a seat;
    • airline — IATA designator code;
    • laptopPower — availability of a notebook receptacle.
  • ageOfPlanes — average age of an airline company’s aircraft;
  • alliance — alliance joined by an airline company;
  • economyLegroom — average distance between the seats in economy class (inches);
  • freeStandardCarryOn — availability of free space for hand luggage;
  • infantsLapCost — age from which a child is not considered an infant;
  • minorsNotTravelAloneFrom — opportunity for minors to travel alone;
  • iata — IATA designator code;
  • checkedBaggagePrice1st — luggage registration cost;
  • baggage — information about the luggage on a flight;
  • excess — text information about restrictions for luggage transportation;
  • checked — text information about the prepaid luggage weight and size, and the necessity to make an additional payment if the size exceeds the standard;
  • carryOn — text information about hand-luggage transportation rules;
  • airline — IATA designator code;
  • sportMusical — rules for transporting large musical instruments and sport equipment.
  • frequentFlyerPrograms - loyalty program for clients
    aircrafts - the number of aircraft owned by an airline company
    carryOnStandard - presence of a hand-luggage transportation standard
    lowcost - is/not a low-cost airline company
    freeCheckedBag - opportunity for luggage transportation for free within the extent permissible
    meals - airline company’s on-board types of menus
    checkin - ways to register provided by an airline company:
  • mobileCheckIn — opportunity of registration using a mobile app;
  • seatOnlineCheckIn — seat selection at registration;
  • onlineCheckInwithBag — online luggage registration;
  • airline — IATA designator code;
  • onlineCheckIn — rules for online registration;
  • requirementOnlineCheckIn — rules for online registration;
  • airportCheckIn — rules for registration in an airport;
  • timeBoardingGate — time for boarding before departure;
  • minorsNotTravelAloneTo — age from which minors may travel without grown-ups;
  • pet — information about transportation of animals by an airline company:
    • cargo — transportation in luggage;
    • baggage — rules for transportation in luggage;
    • restriction — restrictions;
    • documentation — required documents;
    • book — booking;
    • airline — IATA designator code;
    • method — type of transportation;
    • cabin — information about transportation in a cabin;
    • kennel — additional requirements;
    • fee — information about the fee for transportation of animals;
  • minor— information about the fee for minors:
    • age — age from which this tariff may be applied;
    • airline — IATA designator code;
    • booking — information about the booking;
    • aboutService — information about the servicing;
    • flightRestriction — information about restrictions;
    • fee — tariff fee.
  • infant - information about the tariff for infants:
    • payInternational — information about the tariff; exitRow — restrictions for selection of a seat near the emergency door;
    • childTurnTwo — tariff rules for transfer flights;
    • reserveSeat — information about seats for infants;
    • payInfant — payment information;
    • airline — IATA designator code;
    • baggage — luggage in a ticket for an infant;
    • childRestraintDevices — information about transportation of luggage required for an infant (baby carriage, carrying bag, etc.);
    • infantAmenitites — information about additional services rendered on-board for an infant;
    • payDomestic — additional fee.

    To get a link to the site of the ticket booking agencies:

    1. Send a request to the following address: https://api.tp.com/v1/flight_searches/%search_id%/clicks/%terms.url%.json

    where search_id is the ID from the answer of the request, terms.url - URL parameter from the response.

    1. You will receive a response like this:

    Response example json { "params": {}, "method": "GET", "url": "https://www.svyaznoy.travel/?utm_source=as.ru&utm_medium=cpa&utm_campaign=meta_avia#MOW0906/BKK1506/A1/C0/I0/S0/22316/EK-132;EK-374/EK-373;EK-131&marker=7uh46i0v2", "gate_id": 62, "click_id": 22135952358110 } To move on to the booking, give your visitors a link from the parameter "url".

    The “lifetime” of such links is 15 minutes, after which you will need to search again for the current prices and generate a new reference to the transition.

    In our example, this is a link of the form:

    https://www.svyaznoy.travel/?utm_source=as.ru&utm_medium=cpa&utm_campaign=meta_avia#MOW0906/BKK1506/A1/C0/I0/S0/22316/EK-132;EK-374/EK-373;EK-131&marker=7uh46i0v2