Aviasales Flight Prices
v0.5.3Flight price search via Aviasales/Travelpayouts: fares by route, cheapest days, flexible dates.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
search_flights
Search flight prices between two cities on a date or across a month. Use when the user names both ends of a route and wants fares, a booking link, or only departures inside a time window. For the cheapest day in a month use `get_prices_calendar`; for the days around dates already chosen use `get_flexible_date_prices`; for a budget with no destination use `search_by_price_range`. Both codes must be IATA — call `lookup_cities` first if you only have a city name. For nearby airports use `get_alternative_directions`. A multi-city trip needs one call per leg. Note on passengers: the price data…
| Parameter | Type | Description |
|---|---|---|
destination * | string | Destination city IATA code (e.g. "IST", "BCN"). |
origin * | string | Origin city IATA code (e.g. "MOW", "LED"). |
adults | integer | Number of adult passengers, 1-9 (default 1). |
children | integer | Number of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed. |
currency | Price currency code (3 letters, e.g. "rub", "usd"). Defaults to the server's configured currency. | |
depart_after | Keep only flights departing at or after this local time ("HH:MM", 24-hour). Optional. | |
depart_before | Keep only flights departing at or before this local time ("HH:MM", 24-hour). Optional. Combined with depart_after and set earlier than it, the window wraps midnight (e.g. 22:00-06:00). | |
departure_at | Departure date or month (YYYY-MM-DD or YYYY-MM). Optional; a month searches every day in it. | |
direct | boolean | If True, show only non-stop flights. |
infants | integer | Number of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed. |
limit | integer | Max number of results (1-100, default 10). |
market | 2-letter market whose price cache to read (e.g. "us", "ru", "th"). The same route in the same currency is priced differently per market, so set this to the traveller's country. Defaults to the server'… | |
one_way | boolean | If True, search one-way tickets only. |
return_at | Return date or month (YYYY-MM-DD or YYYY-MM). Optional. | |
trip_class | string | "economy", "comfort", "business" or "first" (default "economy"). |
get_prices_calendar
Get grouped calendar prices for a route, one fare per day or per month. Use when the user asks which day or month is cheapest to fly a known route. For fares on one specific date use `search_flights`; for a few days either side of dates already chosen use `get_flexible_date_prices`. Codes are IATA; use `lookup_cities` to resolve a name first. Prices are per adult (cached); passenger parameters are encoded into each booking_link.
| Parameter | Type | Description |
|---|---|---|
destination * | string | Destination IATA code. |
origin * | string | Origin IATA code. |
adults | integer | Number of adult passengers, 1-9 (default 1). |
children | integer | Number of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed. |
currency | Price currency (3 letters). Defaults to the server's currency. | |
departure_at | Departure month (YYYY-MM). Optional. | |
group_by | string | Group results by "departure_at" or "month" (default "departure_at"). |
infants | integer | Number of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed. |
market | 2-letter market whose price cache to read (e.g. "us", "ru"). Defaults to the server's configured market. | |
return_at | Return month (YYYY-MM). Optional. | |
trip_class | string | "economy", "comfort", "business" or "first" (default "economy"). |
get_flexible_date_prices
Compare prices for the days around a departure and an optional return. Use when the user already has dates and asks whether shifting a day either way would be cheaper. For one exact date use `search_flights`; for the cheapest day across a whole month use `get_prices_calendar`. This covers roughly a week around both the outbound and the return.
| Parameter | Type | Description |
|---|---|---|
depart_date * | string | Intended departure date (YYYY-MM-DD). Required. |
destination * | string | Destination IATA code. |
origin * | string | Origin IATA code. |
adults | integer | Number of adult passengers, 1-9 (default 1). |
children | integer | Number of children 2-11 years, 0-8 (default 0). |
currency | Price currency (3 letters). Defaults to the server's currency. | |
infants | integer | Number of infants under 2, 0-8 (default 0). |
market | 2-letter market whose price cache to read. Defaults to the server's configured market. | |
return_date | Intended return date (YYYY-MM-DD). Omit for one-way. | |
trip_class | string | "economy", "comfort", "business" or "first" (default "economy"). |
get_latest_prices
Get the most recently found flight prices from other travellers' searches. Use when the user wants the latest fares that just appeared, on one route or across the whole cache. For a specific trip on chosen dates use `search_flights` instead. Prices are per adult (cached); passenger parameters are encoded into each booking_link. These rows come from the older v2 shape: they name the selling `agency` rather than an airline, carry no flight number, and their booking_link is reconstructed from the route and dates.
| Parameter | Type | Description |
|---|---|---|
adults | integer | Number of adult passengers, 1-9 (default 1). |
children | integer | Number of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed. |
currency | Price currency (3 letters). Defaults to the server's currency. | |
destination | Destination IATA code. Optional. | |
infants | integer | Number of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed. |
limit | integer | Max results (1-100, default 20). |
market | 2-letter market whose price cache to read. Defaults to the server's configured market. | |
one_way | boolean | One-way tickets only. |
origin | Origin IATA code. Optional. | |
trip_class | string | "economy", "comfort", "business" or "first" (default "economy"). |
get_popular_directions
List the cities people most often fly to a destination from, with a fare. Use when the user asks where travellers reach a city from and what that costs. The request is keyed on the destination. For where someone can fly from a city use `get_city_directions`; for prices on one known route use `search_flights`.
| Parameter | Type | Description |
|---|---|---|
destination * | string | Destination IATA code (e.g. "BKK"). Required — the API rejects a request without it. |
currency | Price currency (3 letters). Defaults to the server's currency. | |
locale | 2-letter locale for city names. Defaults to the server's locale. |
get_city_directions
List the cheapest destinations reachable from a city, with a fare and dates. Use when the user asks where they can fly from a city, or wants somewhere cheap without naming a destination. For who flies into a city use `get_popular_directions`; to price one chosen route afterwards use `search_flights` or `get_prices_calendar`.
| Parameter | Type | Description |
|---|---|---|
origin * | string | Origin city IATA code (e.g. "MOW"). Use `lookup_cities` to resolve a city name first. |
currency | Price currency (3 letters). Defaults to the server's currency. |
get_alternative_directions
Get prices for nearby airports and cities around a chosen route. Use when the traveller can fly from or into a different airport and wants those fares. To learn which airports are near a place, use `find_nearest_airports` first; for the named city pair only, use `search_flights`.
| Parameter | Type | Description |
|---|---|---|
destination * | string | Destination IATA code. |
origin * | string | Origin IATA code. |
currency | Price currency (3 letters). Defaults to the server's currency. | |
departure_at | Departure date (YYYY-MM-DD or YYYY-MM). Optional. | |
limit | integer | Max results (1-20, default 10). |
market | 2-letter market whose price cache to read. Defaults to the server's configured market. | |
return_at | Return date (YYYY-MM-DD or YYYY-MM). Optional. |
search_by_price_range
Find flights whose cached fare falls inside a minimum and maximum price. Use when the user has a budget, including anywhere under a price with no destination named. Leave `destination` unset to let the budget pick the city; prices are per adult in economy. For a named route on a date or a month use `search_flights` or `get_prices_calendar`. There is deliberately no date argument: this endpoint ignores one (verified — passing a December date returns the same July and September fares), and each result carries its own `departure_at`.
| Parameter | Type | Description |
|---|---|---|
origin * | string | Origin IATA code. |
value_max * | integer | Highest acceptable price, in `currency`. |
value_min * | integer | Lowest acceptable price, in `currency`. |
currency | Price currency (3 letters). Defaults to the server's currency. | |
destination | Destination IATA code. Optional — omit to search anywhere. | |
limit | integer | Max results (1-100, default 20). |
market | 2-letter market whose price cache to read. Defaults to the server's configured market. |
lookup_airlines
Look up airlines by name or IATA code. Use when the user asks which airline a code belongs to, or wants the IATA code for an airline name. For an airport, city, or country code use `lookup_airports`, `lookup_cities`, or `lookup_countries`; for fares use `search_flights`.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max results to return (1-500, default 50). |
locale | 2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale. | |
search | Airline name substring or exact IATA code (e.g. "aeroflot", "SU"). Omit to list airlines from the start of the dataset. |
lookup_airports
Look up airports by name, IATA code, or city code. Use when the user names an airport or a code and needs its city, country, or coordinates. For the closest airport to a town that does not share the airport's name, use `find_nearest_airports` instead of this tool. The full dataset is ~10k airports, so always pass `search` — an unfiltered call just returns the first `limit` entries in dataset order. Results are ranked: exact code, then exact city code, then name matches, with airports you cannot actually fly to last.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max results to return (1-500, default 50). |
locale | 2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale. | |
search | Airport name substring, exact IATA code, or city code (e.g. "heathrow", "LHR", "MOW"). |
lookup_cities
Look up cities by name or IATA code and return the code flight tools expect. Use when the user names a city and a flight search needs its IATA code. For an airport code use `lookup_airports`; for the nearest airport to a place that is not itself a city, use `find_nearest_airports`. Every flight tool takes IATA codes, so this is usually the first call when the user names a place. The full dataset is ~9.6k cities, so always pass `search`. Names are only available in the requested locale: searching "Мюнхен" needs locale="ru".
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max results to return (1-500, default 50). |
locale | 2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale. | |
search | City name substring or exact IATA code (e.g. "bangkok", "BKK"). |
lookup_countries
Look up countries by name or two-letter country code. Use when the user asks which country a code belongs to, or wants that country's code or currency. For a city or airport code use `lookup_cities` or `lookup_airports`; this tool does not search flight prices.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max results to return (1-500, default 50). |
locale | 2-letter locale for names (e.g. "en", "ru"). Defaults to the server's locale. | |
search | Country name substring or exact code (e.g. "thailand", "TH"). |
find_nearest_airports
Find the airports closest to a place name or to a latitude and longitude. Use when the user asks which airport to fly into for a town, a resort, or a point on the map. `lookup_airports` only matches a name, and the nearest airport is rarely named after the town, so call this tool for that question. Feed the returned city code, not the airport code, to `search_flights` for fares. Pass either `near` (resolved against the city and airport datasets) or an explicit `latitude`/`longitude` pair.
| Parameter | Type | Description |
|---|---|---|
flightable_only | boolean | Skip airports with no scheduled service (default True). |
latitude | Latitude in degrees, -90 to 90. Overrides `near`. | |
limit | integer | Max airports to return (1-50, default 5). |
locale | 2-letter locale for names. Defaults to the server's locale. | |
longitude | Longitude in degrees, -180 to 180. Overrides `near`. | |
max_distance_km | Ignore airports further away than this. Optional. | |
near | Place name or IATA code to search around (e.g. "Pattaya", "UTP"). |