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
  • Hotels data API
  • Hotels statistical data
  • Hotels search API
  • Hotels API request errors
  • 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 network.

    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.

    You can find more helpfull informaion in the Help center.

    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

    Request example

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2019-11&return_date=2019-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=2019-11&return_date=2019-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=2019-11&return_date=2019-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":"2019-11","return_date":"2019-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

    Request example

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2019-11&return_date=2019-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=2019-11&return_date=2019-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=2019-11&return_date=2019-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":"2019-11","return_date":"2019-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

    Request example

    curl --request GET \
      --url 'https://api.travelpayouts.com/v1/prices/calendar?depart_date=2019-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=2019-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=2019-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":"2019-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).

    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.

    HTTP Request

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

    Request parameters

    Example of request:

    curl --request GET \
      --url 'http://api.travelpayouts.com/v1/prices/monthly?currency=USD&origin=MOW&destination=HKT' \
      --header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
    
    require 'uri'
    require 'net/http'
    
    url = URI("http://api.travelpayouts.com/v1/prices/monthly?currency=USD&origin=MOW&destination=HKT")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    request["x-access-token"] = '321d6a221f8926b5ec41ae89a3b2ae7b'
    
    response = http.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://api.travelpayouts.com/v1/prices/monthly?currency=USD&origin=MOW&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 = "http://api.travelpayouts.com/v1/prices/monthly"
    
    querystring = {"origin":"MOW","destination":"BCN","currency":"USD"}
    
    headers = {'x-access-token': '321d6a221f8926b5ec41ae89a3b2ae7b'}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    
    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.
    currency RUB Currency of prices.
    token - Individual affiliate token.

    Response

    The above command returns JSON structured like this:

    {  
       "success":true,
       "data":{  
          "2019-07":{  
             "origin":"MOW",
             "destination":"LON",
             "price":166,
             "transfers":1,
             "airline":"W6",
             "flight_number":7898,
             "departure_at":"2019-07-31T14:10:00Z",
             "return_at":"2019-08-31T19:15:00Z",
             "expires_at":"2019-07-27T03:07:40Z"
          }
       },
       "error":null,
       "currency":"USD"
    }
    

    Response parameters

    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).
    currency - Currency of prices.

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

    Run in Postman

    Request example

    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

    Request example

    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

    Request example

    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

    Request example

    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

    Request example

    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

    Request example

    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.

    Request example

    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

    Request example

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/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/planes.json", headers
    puts response
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/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/planes.json", headers=headers)
    response_body = urlopen(request).read()
    print response_body
    

    Request

    GET https://api.travelpayouts.com/data/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

    Request example

    curl --request GET \
      --url 'https://api.travelpayouts.com/data/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/routes.json", headers
    puts response
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://api.travelpayouts.com/data/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/routes.json", headers=headers)
    response_body = urlopen(request).read()
    print response_body
    

    Request

    GET https://api.travelpayouts.com/data/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

    Requirements for Search API

    How to get access

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

    Roundtrip

    Run in Postman

    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"
        }
        ]
    } 
    

    Request parameters

    Parameter Type Description
    marker string the unique identifier of the affiliate. You can find your marker in the affiliate personal account
    host string host's request (must be replaced by the address of your website where the API will be used)
    user_ip string user's IP address
    locale string 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 string flight class (Y – Economy, C – Business)
    passengers passenger Information
    adults integer the number of adult passengers (from 1 to 9)
    children integer the number of children (from 0 to 6)
    infants integer the number of infants (from 0 to 6)
    segments a list of the trip components:
  • origin (string) — origin IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Paris, France (PAR)")
  • destination (string) — destination IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Berlin, Germany (BER)")
  • date (date) — departure date yyyy-mm-dd (for example, "2021-09-08")
  • know_english string an parameter responsible for the presence of English-speaking gates in the output. Accepted values: true (if it is necessary to display English-language gates to the user) and false (false by default)
    currency string 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 string 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":"2021-05-25"},{"origin":"LON","destination":"MOW","date":"2021-06-18"}]}' -H 'Content-type:application/json' https://api.travelpayouts.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": "2021-06-24",
          "destination_country": "IT",
          "original_destination": "ROM"
        },
        {
          "origin": "ROM",
          "original_origin": "ROM",
          "origin_country": "IT",
          "destination": "CPH",
          "date": "2021-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": "2021-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": "2021-06-18"
            }
        ]
    }
    

    Request parameters

    Parameter Type Description
    marker string the unique identifier of the affiliate. You can find your marker in the affiliate personal account
    host string host's request (must be replaced by the address of your website where the API will be used)
    user_ip string user's IP address
    locale string 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 string flight class (Y – Economy, C – Business)
    passengers passenger Information
    adults integer the number of adult passengers (from 1 to 9)
    children integer the number of children (from 0 to 6)
    infants integer the number of infants (from 0 to 6)
    segments a list of the trip components:
  • origin (string) — origin IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Paris, France (PAR)");
  • destination (string) — destination IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Berlin, Germany (BER)");
  • date (date) — departure date yyyy-mm-dd (for example, "2021-09-08");
  • know_english string an parameter responsible for the presence of English-speaking gates in the output. Accepted values: true (if it is necessary to display English-language gates to the user) and false (false by default)
    currency string 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 string 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 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":"2021-06-18"}]}' -H 'Content-type:application/json' https://api.travelpayouts.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": "2021-02-18"
            },
            {
                "origin": "LED",
                "destination": "BER",
                "date": "2021-02-25"
            },
            {
                "origin": "BER",
                "destination": "LON",
                "date": "2021-03-05"
            }
        ]
    }
    

    Request parameters

    Parameter Type Description
    marker string the unique identifier of the affiliate. You can find your marker in the affiliate personal account
    host string host's request (must be replaced by the address of your website where the API will be used)
    user_ip string user's IP address
    locale string 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 string flight class (Y – Economy, C – Business)
    passengers passenger Information
    adults integer the number of adult passengers (from 1 to 9)
    children integer the number of children (from 0 to 6)
    infants integer the number of infants (from 0 to 6)
    segments a list of the trip components:
  • origin (string) — origin IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Paris, France (PAR)");
  • destination (string) — destination IATA or string "City, Country (IATA)". The IATA code is shown in uppercase letters (for example, "Berlin, Germany (BER)");
  • date (date) — departure date yyyy-mm-dd (for example, "2021-09-08");
  • know_english string an parameter responsible for the presence of English-speaking gates in the output. Accepted values: true (if it is necessary to display English-language gates to the user) and false (false by default)
    currency string 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 string 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 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":"2021-06-25"},{"origin":"BER","destination":"LON","date":"2021-07-05"}]}' -H 'Content-type:application/json' https://api.travelpayouts.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.travelpayouts.com/v1/flight_search_results?uuid=%search_id%

    Then send the request to the server for search results:

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

    Request example

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

    Request example

    Response example

    [{
        "segments":[
        {
            "destination_country":"RU",
            "original_destination":"LED",
            "origin":"MOW",
            "origin_country":"RU",
            "original_origin":"MOW",
            "date":"2021-05-25",
            "destination":"LED"
        },
        {
            "destination_country":"RU",
            "original_destination":"MOW",
            "origin":"LED",
            "origin_country":"RU",
            "original_origin":"LED",
            "date":"2021-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":{
                                      "currency":"rub",
                                      "price":18418,
                                      "unified_price":18418,
                                      "url":18000000,
                                      "multiplier":1e-06,
                                      "proposal_multiplier":1,
                                      "flights_baggage":[
                                         [
                                            false
                                         ],
                                         [
                                            false
                                         ]
                                      ],
                                      "flights_handbags":[
                                         [
                                            "1PC10"
                                         ],
                                         [
                                            "1PC10"
                                         ]
                                      ],
                                      "baggage_source":[
                                         [
                                            3
                                         ],
                                         [
                                            3
                                         ]
                                      ],
                                      "handbags_source":[
                                         [
                                            3
                                         ],
                                         [
                                            3
                                         ]
                                      ]
                                }},
                                "xterms":{
                                   "180":{
                                      "Y_0PC;Y_0PC":{
                                         "currency":"rub",
                                         "price":18418,
                                         "unified_price":18418,
                                         "url":18000000,
                                         "multiplier":1e-06,
                                         "proposal_multiplier":1,
                                         "flights_baggage":[
                                            [
                                               false
                                            ],
                                            [
                                               false
                                            ]
                                         ],
                                         "flights_handbags":[
                                            [
                                               "1PC10"
                                            ],
                                            [
                                               "1PC10"
                                            ]
                                         ],
                                         "baggage_source":[
                                            [
                                               3
                                            ],
                                            [
                                               3
                                            ]
                                         ],
                                         "handbags_source":[
                                            [
                                               3
                                            ],
                                            [
                                               3
                                            ]
                                         ]
                                      }
                                   }
                                },
                                "sign":"7573ea707c2ff84b243241961412ed34",
                                "segment":[
                                {
                                    "flight":[
                                    {
                                        "arrival":"LED",
                                        "aircraft":"AIRBUS A320",
                                        "local_departure_timestamp":1434588600,
                                        "operating_carrier":"UT",
                                        "duration":85,
                                        "local_arrival_timestamp":1432549200,
                                        "departure_date":"2021-05-25",
                                        "departure_time":"11:00",
                                        "arrival_date":"2021-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":"2021-06-18",
                                    "departure_time":"10:05",
                                    "arrival_date":"2021-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 Description
    search_id unique identifier for the search query
    flight_numbers umbers 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
    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;
  • marketing_carrier — IATA code of the airline that sells the ticket. Use it to generate a flight number. If this field is empty, use operating_carrier
  • 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;
  • technical_stops — information about technical stops ;
  • arrival — IATA code of arrival.
  • rating internal information about flight rating
    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).
  • stops_airports IATA codes of departure airports, destination and transfers;
    airports information about airports;
    xterms  contains information similar to terms, plus may contain additional data on tariffs (if it is transmitted from agencies / airlines)
    is_direct  true if the flight is non-stop
    segments_airports  IATA codes of the main departure and destination airports
    is_charter  flight is charter or not (false or true)
    segment_durations  total flights duration (for example, there and back)
    total_duration  total flight time with stops time
    max_stops maximum number of stops
    segments_rating, flight_weight, popularity, tags system parameters
    market market of routes (deprecated);
    initiated_at date and time of search (deprecated);
    open_jaw true if it is part of open jaw (deprecated);
    clean_marker affiliate marker (deprecated);
    currency currency type (deprecated);
    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 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.

    Request example

    curl -v -H 'Accept-Encoding:gzip,deflate,sdch' https://api.travelpayouts.com/v1/flight_searches/%search_id%/clicks/%terms.url%.json 
    --compressed
    

    To get a link to the site of the ticket booking agencies send a request to the following address:

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

    You will receive a response like in the example.

    Response example

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

    Hotels data API

    Authorization

    The authorization is based on affilliate token.

    Hotel search by name or location

    Search for a specific location or name places of a hotel (city, island).

    Attention! If you send a request without a token, the number of queries will be limited. The values of restrictions are passed in the response header:

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/lookup.json?query=moscow&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/lookup.json?query=moscow&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/lookup.json?query=moscow&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/lookup.json"
    
    querystring = {"query":"moscow","lang":"ru","lookFor":"both","limit":"1","token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/lookup.json?query=moscow&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere

    Request parameters

    Required parameters are highlighted in bold.

    Response

    Sample response

    {
        "results": {
            "locations": [
                {
                    "cityName": "Москва",
                    "fullName": "Москва, Россия",
                    "countryCode": "RU",
                    "countryName": "Россия",
                    "iata": [
                        "BKA",
                        "DME",
                        "SVO",
                        "VKO",
                        "MOW"
                    ],
                    "id": "12153",
                    "hotelsCount": "930",
                    "location": {
                        "lat": "55.752222200",
                        "lon": "37.615555600"
                    },
                    "_score": 3.2695
                }
            ],
            "hotels": [
                {
                    "label": "Отель Novotel Moscow City",
                    "locationName": "Москва, Россия",
                    "locationId": "12153",
                    "id": "1074388",
                    "fullName": "Отель Novotel Moscow City, Москва, Россия",
                    "location": {
                        "lat": "55.747160",
                        "lon": "37.539302"
                    }
                }
            ]
        },
        "status": "ok"
    }
    

    The block "locations" includes:

    The block "hotels" includes:

    Searching a hotel or location by coordinates

    Search for a specific location or hotel (city, island) by coordinates.

    Attention! If you send a request without a token, the number of queries will be limited. The values of restrictions are passed in the response header:

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/lookup.json?query=55.0291,82.9059&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/lookup.json?query=55.0291,82.9059&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/lookup.json?query=55.0291,82.9059&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/lookup.json"
    
    querystring = {"query":"55.0291,82.9059","lang":"ru","lookFor":"both","limit":"1","token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/lookup.json?query=55.0291,82.9059&lang=ru&lookFor=both&limit=1&token=PasteYourTokenHere

    Request parameters

    Required parameters are highlighted in bold.

    Response

    Sample response

    {
        "results": {
            "locations": [
                {
                    "id": "12167",
                    "type": "City",
                    "countryIso": "RU",
                    "name": "Новосибирск",
                    "state": "",
                    "fullname": "Новосибирск, Россия",
                    "geo": {
                        "lat": "55.028705000",
                        "lon": "82.906898000"
                    }
                }
            ],
            "hotels": [
                {
                    "id": "380923",
                    "name": "AZIMUT Отель Сибирь",
                    "locationId": "12167",
                    "location": {
                        "lat": "55.029140",
                        "lon": "82.905990"
                    }
                }
            ]
        },
        "status": "ok"
    }
    

    The block "locations" includes:

    The block "hotels" includes:

    Displays the cost of living in hotels

    The request is used to get the price of hotel rooms from the cache for the period. It doesn't contain information about room availability.

    Attention! If you send a request without a token, the number of queries will be limited. The values of restrictions are passed in the response header:

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/cache.json?location=Saint-Petersburg&hotelId=277083&checkIn=2019-09-13&checkOut=2019-09-18&currency=rub&limit=1&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/cache.json?location=Saint-Petersburg&hotelId=277083&checkIn=2019-09-13&checkOut=2019-09-18&currency=rub&limit=1&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/cache.json?location=Saint-Petersburg&hotelId=277083&checkIn=2019-09-13&checkOut=2019-09-18&currency=rub&limit=1&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/cache.json"
    
    querystring = {"location":"Saint-Petersburg","hotelId":"277083","checkIn":"2019-09-13","checkOut":"2019-09-18","currency": "rub", "limit": "1", "token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/cache.json?location=Saint-Petersburg&hotelId=277083&checkIn=2019-09-13&checkOut=2019-09-18&currency=rub&limit=1&token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    {
        "location": {
            "country": "Russia",
            "geo": {
                "lon": 37.617508,
                "lat": 55.752041
            },
            "state": null,
            "name": "Moscow"
        },
        "priceAvg": 60897.74,
        "pricePercentile": {
            "3": 28863.56,
            "10": 28863.56,
            "35": 47805.27,
            "50": 59531.09,
            "75": 65435,
            "99": 120128.17
        },
        "hotelName": "Mercure Arbat Moscow",
        "stars": 4,
        "locationId": 12153,
        "hotelId": 333561,
        "priceFrom": 28863.56
    }
    

    List of hotels in the archive

    This request return the file with a list of all hotels for the specified locale.

    Sample request

    curl --request GET \
      --url 'http://yasen.hotellook.com/tp/v1/hotels?language=en' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://yasen.hotellook.com/tp/v1/hotels?language=en")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://yasen.hotellook.com/tp/v1/hotels?language=en",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://yasen.hotellook.com/tp/v1/hotels"
    
    querystring = {"language":"en"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://yasen.hotellook.com/tp/v1/hotels?language=en

    Request parameters

    The language parameter can take the values:

    Response

    The file with a list of hotels includes the following data:

    The hotels file is updated once a week in the morning (GMT) on Saturday.

    Note! To download the list of hotels you do not need access to the search hotels API.

    Hotels Selections

    The request recovers the list of specific hotels according to the ID of a location. A collection is formed according to the specified period. If the period is not specified, a collection shall be formed from the hotels found for the last three days.

    Sample request

    curl --request GET \
      --url 'http://yasen.hotellook.com/tp/public/widget_location_dump.json?currency=rub&language=ru&limit=5&id=12209&type=popularity&check_in=2019-02-02&check_out=2019-02-17&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://yasen.hotellook.com/tp/public/widget_location_dump.json?currency=rub&language=ru&limit=5&id=12209&type=popularity&check_in=2019-02-02&check_out=2019-02-17&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://yasen.hotellook.com/tp/public/widget_location_dump.json?currency=rub&language=ru&limit=5&id=12209&type=popularity&check_in=2019-02-02&check_out=2019-02-17&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://yasen.hotellook.com/tp/public/widget_location_dump.json"
    
    querystring = {"currency":"rub", "language":"ru", "limit":"5", "id":"12209", "type":"popularity", "check_in":"2019-02-02", "check_out":"2019-02-17", "token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://yasen.hotellook.com/tp/public/widget_location_dump.json?currency=rub&language=ru&limit=5&id=12209&type=popularity&check_in=2019-02-02&check_out=2019-02-17&token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    {
        "popularity": [
            {
                "hotel_id": 713859,
                "distance": 6.68,
                "name": "President Hotel",
                "stars": 4,
                "rating": 87,
                "property_type": "hotel",
                "hotel_type": [
                    "Solo Hotel"
                ],
                "last_price_info": {
                    "price": 39707,
                    "old_price": 42761,
                    "discount": 7,
                    "insertion_time": 1485464441,
                    "nights": 15,
                    "search_params": {
                        "adults": 2,
                        "children": {},
                        "checkIn": "2019-02-02",
                        "checkOut": "2019-02-17"
                    },
                    "price_pn": 2647,
                    "old_price_pn": 2851
                },
                "has_wifi": true
            }
        ]
    }
    

    The types of hotel collections

    The request recovers the list of all available separate collections. This type is used to search for hotels with a discount.

    Sample request

    curl --request GET \
      --url 'http://yasen.hotellook.com/tp/public/available_selections.json?id=12209&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://yasen.hotellook.com/tp/public/available_selections.json?id=12209&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://yasen.hotellook.com/tp/public/available_selections.json?id=12209&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://yasen.hotellook.com/tp/public/available_selections.json"
    
    querystring = {"id":"12209", "token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://yasen.hotellook.com/tp/public/available_selections.json?id=12209&token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    [
        "center",
        "tophotels",
        "highprice",
        "3-stars",
        "4-stars",
        "5-stars",
        "restaurant",
        "pets",
        "pool",
        "cheaphotel_ufa",
        "luxury_ufa",
        "price",
        "rating",
        "distance",
        "popularity",
        "2stars",
        "3stars",
        "4stars",
        "5stars"
    ]
    

    Hotels statistical data

    Requests as a result of which the partner receives information about the countries, cities and hotels.

    Attention! The default number of requests is limited to 60 per minute. If you need to process more requests, send a letter to support@travelpayouts.com.

    Request "Country"

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

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/static/countries.json?token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/static/countries.json?token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/static/countries.json?token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/static/countries.json"
    
    querystring = {"token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/static/countries.json?token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    [
        {
            "id": "9",
            "code": "DZ",
            "name": {
                "EN": [
                    {
                        "isVariation": "0",
                        "name": "Algeria"
                    }
                ],
                "RU": [
                    {
                        "isVariation": "0",
                        "name": "Алжир"
                    }
                ]
            }
        },
        {
            "id": "10",
            "code": "AO",
            "name": {
                "EN": [
                    {
                        "isVariation": "0",
                        "name": "Angola"
                    }
                ],
                "RU": [
                    {
                        "isVariation": "0",
                        "name": "Ангола"
                    }
                ]
            }
        }
    ]
    

    The response contains:

    Request "Cities"

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

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/static/locations.json?token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/static/locations.json?token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/static/locations.json?token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/static/locations.json"
    
    querystring = {"token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/static/locations.json?token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    [
        {
            "id": "373",
            "code": "",
            "countryId": "77",
            "latitude": "15.501950000",
            "longitude": "73.910090000",
            "name": {
                "EN": [
                    {
                        "isVariation": "0",
                        "name": "Goa"
                    }
                ],
                "RU": [
                    {
                        "isVariation": "0",
                        "name": "Гоа"
                    }
                ]
            }
        }
    ]
    

    Request "Amenities"

    The request returns a file with a list of amenities from the database.

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/static/amenities/en.json?token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/static/amenities/en.json?token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/static/amenities/en.json?token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/static/amenities/en.json"
    
    querystring = {"token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/static/amenities/en.json?token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    [
        {
            "id": "2",
            "name": "Hairdryer",
            "groupName": "Room"
        },
        {
            "id": "3",
            "name": "Safe",
            "groupName": "Room"
        },
        {
            "id": "4",
            "name": "TV",
            "groupName": "Room"
        }
    ]
    

    Request 'Hotels list'

    The request returns a file with a list of hotels from the database.

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/static/hotels.json?locationId=895&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/static/hotels.json?locationId=895&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/static/hotels.json?locationId=895&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/static/hotels.json"
    
    querystring = {"locationId":"895", "token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/static/hotels.json?locationId=895&token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    {
        "gen_timestamp": 1510729858.8067338,
        "pois": [
            {
                "id": 70643,
                "rating": 0,
                "category": "airport",
                "name": "Koggala Airport",
                "location": {
                    "lat": 5.983056,
                    "lon": 80.33305
                },
                "geom": {
                    "type": "Point",
                    "coordinates": [
                        80.33305,
                        5.983056
                    ]
                },
                "confirmed": true
            }
        ],
        "hotels": [
            {
                "id": 1399511245,
                "cityId": 895,
                "stars": 0,
                "pricefrom": 30,
                "rating": 0,
                "popularity": 900,
                "propertyType": 6,
                "checkIn": "14:00",
                "checkOut": "12:00",
                "distance": 6,
                "photoCount": 9,
                "photos": [
                    {
                        "url": "http://photo.hotellook.com/image_v2/limit/h1399511245_8/320/240.auto",
                        "width": 320,
                        "height": 240
                    }
                ],
                "photosByRoomType": {},
                "yearOpened": null,
                "yearRenovated": null,
                "cntRooms": null,
                "cntSuites": null,
                "cntFloors": null,
                "facilities": [
                    7
                ],
                "shortFacilities": [],
                "location": {
                    "lon": 81.201033,
                    "lat": 6.208641
                },
                "name": {
                    "en": "Sayonara Resorts"
                },
                "address": {
                    "ru": "Sayonara Resorts - Pallemalala , Weligatta , Hambantota., Тиссамахарама",
                    "en": "Sayonara Resorts - Pallemalala , Weligatta , Hambantota."
                },
                "link": "/lk/weerawila-895/sayonara_resorts-1399511245.html",
                "poi_distance": {
                    "70642": 96987,
                    "70643": 99193,
                    "70650": 57116
                }
            }
        ]
    }
    

    Response parameters

    The response contains:

    Request "Types of rooms"

    The request returns a file with a list of rooms type from the database.

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/static/roomTypes.json?language=en&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/static/roomTypes.json?language=en&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/static/roomTypes.json?language=en&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/static/roomTypes.json"
    
    querystring = {"language":"en", "token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/static/roomTypes.json?language=en&token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    {
       "8":"Apartment",
       "18":"Bungalow",
       "15":"Business",
       "73":"Business apartment",
       "86":"Business deluxe"
    }
    

    Request "Types of hotels"

    The request returns a file with a list of hotels type from the database.

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/static/hotelTypes.json?language=en&token=PasteYourTokenHere' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/static/hotelTypes.json?language=en&token=PasteYourTokenHere")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/static/hotelTypes.json?language=en&token=PasteYourTokenHere",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/static/hotelTypes.json"
    
    querystring = {"language":"en", "token":"PasteYourTokenHere"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET http://engine.hotellook.com/api/v2/static/hotelTypes.json?language=en&token=PasteYourTokenHere

    Request parameters

    Response

    Sample response

    {
        "0": "Other",
        "1": "Hotel",
        "2": "Apartment Hotel",
        "3": "Bed & Breakfast",
        "4": "Apartment / Condominium",
        "5": "Motel",
        "6": "Guest House",
        "7": "Hostel",
        "8": "Resort",
        "9": "Agriturismo / Farm Stay",
        "10": "Vacation Rental",
        "11": "Lodge",
        "12": "Villa"
    }
    

    Request "Hotel photos". Old method

    The request returns a hotel photos from the database.

    Sample request

    https://photo.hotellook.com/image_v2/limit/hId_photoId/photosize.jpg

    Examples of links to the hotel's photos with Id 503387 size 48*48, 640*480 and .auto format:

    https://photo.hotellook.com/image_v2/limit/h503387_1/48.jpg

    https://photo.hotellook.com/image_v2/limit/h503387_1/640/480.jpg

    https://photo.hotellook.com/image_v2/limit/h503387_1/800/520.auto

    curl --request GET \
      --url 'https://photo.hotellook.com/image_v2/limit/hId_photoId/photosize.jpg' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://photo.hotellook.com/image_v2/limit/hId_photoId/photosize.jpg")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://photo.hotellook.com/image_v2/limit/hId_photoId/photosize.jpg",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://photo.hotellook.com/image_v2/limit/hId_photoId/photosize.jpg"
    
    querystring = {}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET https://photo.hotellook.com/image_v2/limit/hId_photoId/photosize.jpg

    Request parameters

    Request for hotel photos. New method

    The request returns a hotel photos from the database.

    Example request

    curl --request GET \
      --url 'https://yasen.hotellook.com/photos/hotel_photos?id=27926056,4' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://yasen.hotellook.com/photos/hotel_photos?id=27926056,4")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://yasen.hotellook.com/photos/hotel_photos?id=27926056,4",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://yasen.hotellook.com/photos/hotel_photos"
    
    querystring = {"id":"27926056,4"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    First request

    GET https://yasen.hotellook.com/photos/hotel_photos?id=27926056,4

    where id is the id of the hotels indicated through a comma.

    Response

    In response, there will be an array of photos id for each hotel:

    Sample response

    {
       "4": [5162091534,5162091993], "27926056": [7505789398,7505803908]
    }
    

    Second request

    Sample request

    curl --request GET \
      --url 'https://photo.hotellook.com/image_v2/limit/photo_id/800/520.auto' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://photo.hotellook.com/image_v2/limit/photo_id/800/520.auto")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://photo.hotellook.com/image_v2/limit/photo_id/800/520.auto",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://photo.hotellook.com/image_v2/limit/photo_id/800/520.auto"
    
    querystring = {}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    After that, send a request to the address https://photo.hotellook.com/image_v2/limit/photo_id/800/520.auto

    where instead of photo_id substitute id photos.

    Request "Hotel's room photos (in a sprite)"

    The request returns a hotel's rooms photos from the database.

    Use this request to get a sprite with photos of rooms.

    Sample request

    curl --request GET \
      --url 'https://photo.hotellook.com/rooms/sprite/h4_1/100/3/50.auto' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://photo.hotellook.com/rooms/sprite/h4_1/100/3/50.auto")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://photo.hotellook.com/rooms/sprite/h4_1/100/3/50.auto",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://photo.hotellook.com/rooms/sprite/h4_1/100/3/50.auto"
    
    querystring = {}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    To get a sprite with rectangular photographs, along with the need to specify the width of the height of the photos:

    https://photo.hotellook.com/rooms/sprite/h4_12/100x50/3/50x25.auto

    Request

    GET https://photo.hotellook.com/rooms/sprite/hhotel-id_group-id/first_width/photos_count-1/rest_photos_width.auto

    Request parameters

    Additional information

    To get a picture of the room, given the size, use code like:

    https://photo.hotellook.com/rooms/crop/h<hotel_id>_<group_id>_<photo_idx>/<width>/<height>.auto

    This photo will be scaled and cropped to the specified size.

    To get a photo that is no longer a given size or type, use the code:

    https://photo.hotellook.com/rooms/limit/h<hotel_id>_<group_id>_<photo_idx>/<widt*>/<height>.auto

    Parameters similar to those described in the request above, except for photo_idx - an index image in the list (first index pictures - 0).

    https://photo.hotellook.com/rooms/limit/h4_12_1/200/200.auto

    Request 'City photo'

    The request returns a city photos from the database.

    Sample request

    curl --request GET \
      --url 'https://photo.hotellook.com/static/cities/960x720/LED.jpg' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("https://photo.hotellook.com/static/cities/960x720/LED.jpg")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://photo.hotellook.com/static/cities/960x720/LED.jpg",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "https://photo.hotellook.com/static/cities/960x720/LED.jpg"
    
    querystring = {}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    Request

    GET https://photo.hotellook.com/static/cities/960x720/LED.jpg

    Request parameters

    Hotels search API

    Requirements for Hotels API access

    1. Each search query must be initiated by the user and the results must be shown to the user in full. The results for each query must contain a “buy” button next to each flight option.
    2. 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%.
    3. We'll also need to see the URL of your project, your design prototypes, a description of your project and how our API will be used.

    Hotels search API description

    With hotels API, a partner can create his or her own search of hotels. Access to the hotel search API is free, limited, and available on an individual basis on request from the partner.

    To access the search API hotels, submit your request to support@travelpayouts.com with the following information:

    Attention, please! Data about Booking.com is missing in the API of hotels. The reason for this is the policy of the company to work through the API and White Label.

    Search management

    Search by hotel IATA-code or cityId (ID location), or hotelId (ID hotel). All options or just one can be specified. If you specify hotelId and cityId, only hotelId will be used. If you specify iata and cityId, iata will be used.

    When using this search, it is possible to access its results not immediately, but after a period of time not exceeding 15 minutes. Handling is on the request ID searchId.

    Attention! The default number of requests is limited to 200 requests per hour for one IP address. If you need to process more requests, send a note to support@travelpayouts.com.

    Sample request

    curl --request GET \
      --url 'http://engine.hotellook.com/api/v2/search/start.json?iata=HKT&checkIn=2018-08-10&checkOut=2018-08-13&adultsCount=2&customerIP=100.168.1.1&childrenCount=1&childAge1=8&lang=ru&currency=USD&waitForResult=0&marker=УкажитеВашМаркер&signature=a475100374414df97a9c6c7d7731b3c6' \
    
    require 'uri'
    require 'net/https'
    
    url = URI("http://engine.hotellook.com/api/v2/search/start.json?iata=HKT&checkIn=2018-08-10&checkOut=2018-08-13&adultsCount=2&customerIP=100.168.1.1&childrenCount=1&childAge1=8&lang=ru&currency=USD&waitForResult=0&marker=УкажитеВашМаркер&signature=a475100374414df97a9c6c7d7731b3c6")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
    
    <?php
    
    $curl = curl_init();
    
    curl_setopt_array($curl, array(
      CURLOPT_URL => "http://engine.hotellook.com/api/v2/search/start.json?iata=HKT&checkIn=2018-08-10&checkOut=2018-08-13&adultsCount=2&customerIP=100.168.1.1&childrenCount=1&childAge1=8&lang=ru&currency=USD&waitForResult=0&marker=УкажитеВашМаркер&signature=a475100374414df97a9c6c7d7731b3c6",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "GET",
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);
    
    curl_close($curl);
    
    if ($err) {
      echo "cURL Error #:" . $err;
    } else {
      echo $response;
    }
    
    import requests
    
    url = "http://engine.hotellook.com/api/v2/search/start.json"
    
    querystring = {"iata":"HKT", "checkIn":"2018-08-10", "checkOut":"2018-08-13", "adultsCount":"2", "customerIP":"100.168.1.1", "childrenCount":"1", "childAge1":"8", "lang":"ru", "currency":"USD", "waitForResult":"0", "marker":"УкажитеВашМаркер", "signature":"a475100374414df97a9c6c7d7731b3c6"}
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

    where signature is md5 of the string: "YourToken:YourMarker:adultsCount:checkIn:checkOut:childAge1:childrenCount:currency:customerIP:iata:lang:waitForResult".

    More information about the signature is available here.

    First request

    GET http://engine.hotellook.com/api/v2/search/start.json?iata=HKT&checkIn=2018-08-10&checkOut=2018-08-13&adultsCount=2&customerIP=100.168.1.1&childrenCount=1&childAge1=8&lang=ru&currency=USD&waitForResult=0&marker=УкажитеВашМаркер&signature=a475100374414df97a9c6c7d7731b3c6

    Request parameters

    Required parameters are highlighted in bold.

    Response

    Sample response

    {
        "searchId": "5201179",
        "status": "ok"
    }
    

    Second request

    Sample request

    http://engine.hotellook.com/api/v2/search/getResult.json?searchId=4034914&limit=10&sortBy=price&sortAsc=1&roomsCount=0&offset=0&marker=PasteYourMarkerHere&signature=364c38baee5cf11b382297bfd4338ce6
    

    where signature is md5 of the string: "YourToken:YourMarker:limit:offset:roomsCount:searchId:sortAsc:sortBy".

    Request parameters

    Response

    Sample response

    When you are trying to get a search result, at the end of search you get the error "errorCode: 4". This means the results are not yet ready. The search is not interrupted; you should repeat the request later.

    {
        "status": "ok",
        "result": [
            {
                "fullUrl": "http://search.hotellook.com/?language=ru&marker=16886&hotelId=362691",
                "maxPricePerNight": 46,
                "maxPrice": 138,
                "photoCount": 50,
                "guestScore": 63,
                "address": "23/8 Soi Hub-Aik, Phuket Road, Muang District",
                "minPriceTotal": 40,
                "id": 362691,
                "price": 13,
                "name": "Rome Place Hotel",
                "url": "/search/?marker=16886&hotelId=362691",
                "popularity": 47,
                "location": {
                    "lon": 98.39146,
                    "lat": 7.878922
                },
                "stars": 3,
                "distance": 10.6,
                "amenities": [],
                "rooms": [
                    {
                        "bookingURL": "/r/?language=ru&checkIn=2015-06-10¤cy=USD&children=5&host=v2%3A16886&marker=16886&transparent=1&roomId=0&adults=2&locationId=30553&checkOut=2015-06-13&gateId=43&hotelId=362691",
                        "options": {
                            "available": 5,
                            "deposit": true,
                            "refundable": false,
                            "breakfast": false
                        },
                        "type": "",
                        "tax": 0,
                        "desc": "Double or Twin STANDARD",
                        "fullBookingURL": "http://search.hotellook.com/r?language=ru&checkIn=2015-06-10&cy=USD&children=5&host=v2%3A16886&marker=16886&transparent=1&roomId=0&adults=2&locationId=30553&checkOut=2015-06-13&gateId=43&hotelId=362691",
                        "agencyName": "Travel.ru",
                        "agencyId": "43",
                        "total": 40,
                        "price": 13,
                        "internalTypeId": "1"
                    }
                ],
                "rating": 63
            }
        ]
    }
    

    Block "result" contains:

    Block "rooms" contains:

    You can get photos and other information about hotel with help of Hotel Data API.

    Attention! The reference to the agency's website must be received only when the user clicks the "Buy" button. Automatic collection of all links from the answer is prohibited. Violation of this rule will disable the API search for the partner.

    Hotels API request errors

    All input parameters are checked and errors are shown if they are wrong: