This post presents the supported destinations and prices in the price map API.
Note! The methods provided in the article will be deprecated starting May 30, 2022. We recommend that you replace them with the alternative options in advance.
Use GraphQL query prices_one_way (documentation) instead of /supported_directions.json. Example:
{
prices_one_way(
params: {
origin: "LON"
}
grouping: DIRECTIONS
paging: {
offset: 0
limit: 30
}
) {
destination_city_iata
}
}
Please note that our GQL responses do not contain country and coordinates fields, but you can get this data using cities.json (documentation). The maximum value of limit in the query is 30, use offset to collect all the data.
Use /aviasales/v3/grouped_prices (documentation) instead of /prices.json. To get the distance values, use GraphQL-query with distance field added to the query. Example:
{
prices_one_way(
params: {
origin: "LON"
}
grouping: DIRECTIONS
paging: {
offset: 0
limit: 30
}
) {
destination_city_iata
distance
}
}
Price Map: supported routes
Query
Method: GET.
URL: http://map.aviasales.com/supported_directions.json?origin_iata=LON&one_way=false&locale=en
Query parameters
- origin_iata — IATA code of the airport/city from which tickets are searched for. The IATA code is shown in uppercase letters, for example, MOW.
- one_way — "true" for one-way tickets, "false" for round trips.
- locale — search language.
Response
{ "origin":{ "iata":"LON", "name":"London", "country":"GB", "coordinates":[ 0.06, 51.51 ] }, "directions":[ { "direct":false, "iata":"USM", "name":"Koh Samui", "country":"TH", "coordinates":[ 100.0628, 9.555315 ] } }
Response parameters
- iata — IATA code of the departure city.
- name — name of the departure city.
- country — country letter code.
- coordinates — coordinates of the departure city.
- directions — route information.
- direct — whether non-stop flights are available.
- name — name of destination city.
- country — destination country.
- coordinates — coordinates.
Price Map: prices
Query
Method: GET.
Query parameters
- origin_iata — IATA code for the point of departure. The IATA code is shown in uppercase letters, for example, LON
- period — period of dates to search for (season, year, month)
- direct — whether non-stop flights are available
- one_way — "true" for one-way tickets, "false" for round trips
- schengen — you need schengen visa
- locale — search language
- min_trip_duration_in_days — shortest trip duration (in days)
- max_trip_duration_in_days — longest trip duration (in days)
Response
[{ "show_to_affiliates":false, "trip_class":0, "destination":"PSA", "depart_date":"2022-05-30", "return_date":"2022-06-12", "number_of_changes":0, "value":43785, "created_at": 1407716354, "ttl": 1407889154, "distance":2247, "actual":false }]
Response parameters
- show_to_affiliates — true: prices available to affiliates, false: price not available to affiliates
- trip_class — trip class (1 — business class, 0 — standard)
- destination — IATA code for the destination
- depart_date — departure date
- return_date — return date
- number_of_changes — number of stops
- value — flight cost
- created_at — time and date of query creating (in unix timestamp format)
- ttl (time-to-live) — time and date at which the offer is arriving (in unix timestamp format)
- distance — distance between the departure and arrival points
- actual — equals 0 or 1. 0 — price was found long ago and may be out of date. 1 — price was found recently and is current