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:
- success – true for a successful request, false in case of errors;
- data – a result of the request; in case of an error is equal to null;
- error – short description of the error that prevented request completion; for a successful request is equal to null.
Dates and times are given in UTC, formatted according to ISO 8601. Prices are given in rubles as of when the ticket is put in the search results. It is not recommended 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, 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.
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.
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.
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¤cy=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¤cy=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¤cy=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. |
Popular airline routes
Returns routes for which an airline operates flights, sorted by popularity.
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.
The popular directions from a city
Brings the most popular directions from a specified city back.
Request example
curl --request GET \
--url 'https://api.travelpayouts.com/v1/city-directions?origin=MOW¤cy=usd' \
--header 'x-access-token: 321d6a221f8926b5ec41ae89a3b2ae7b'
require 'uri'
require 'net/https'
url = URI("https://api.travelpayouts.com/v1/city-directions?origin=MOW¤cy=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¤cy=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¤cy=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:
- success – true for a successful request, false in case of errors;
- data – a result of the request; in case of an error is equal to null;
- error – short description of the error that prevented request completion; for a successful request is equal to null.
Dates 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
- 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.
- 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.
- It's forbidden to use our search API with the API of other metasearches of flights.
- It's forbidden to use requests with localhost IP addresses (127.0.0.1-127.255.255.255).
- It's forbidden to automatically collect data from search results using the search API.
- Page with found flights should be hidden from search engine bots using the robots.txt file. For example, if flights tickets are displayed on the page www.sitename.com/search, then robots.txt should contain the lines:
User-Agent: * Disallow: /search/ - 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%.
- Ajax requests to the API don’t work because the access token is passed unencrypted. You must make requests to the API from the server.
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:
- URL of your website;
- Design prototypes of a search result;
- Description of your project;
- How you will use the search API?
- Why aren’t the standard methods of integration (search forms, White Label, API access to data) suitable for you.
- Requirements for flights search API access.
Roundtrip
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: |
| 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: |
| 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: |
| 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: |
| 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 | |
| uuid | request ID; |
| city_distance | distance between the cities of origin and destination; |
| gates_info | information about the agent (Ticket Seller): |
| signature | signature of request |
| segments | array data of flights: |
| flight_numbers | flight numbers |
| airlines | information about the airlines: |
| proposals | an array of variants |
| sign | unique id of the ticket, to integrate information from different agencies in one ticket; |
| flight | flight details: |
| rating | internal information about flight rating |
| terms | information about the flight’s cost: |
| 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: |
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):
|
| 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:
|
How to get a link to the agency website
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