search_flights
Find flight fares between two cities for a date or month, returning prices and booking links, with filters for direct flights, one-way, passengers, and departure times.
Instructions
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 comes from a cache of recent searches and is always PER ADULT in economy. The adults/children/infants/trip_class parameters are encoded into each ticket's booking_link, so the link opens Aviasales with the full party pre-filled and shows the real total price.
Durations: each ticket reports duration_total (full door-to-door travel time), duration_to/duration_back (pure flight time per direction) and layover_minutes (combined ground time between connecting flights; 0 for direct flights). All values are in minutes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max number of results (1-100, default 10). | |
| adults | No | Number of adult passengers, 1-9 (default 1). | |
| direct | No | If True, show only non-stop flights. | |
| market | No | 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's configured market. | |
| origin | Yes | Origin city IATA code (e.g. "MOW", "LED"). | |
| infants | No | Number of infants under 2, 0-8 (default 0). Cannot exceed the number of adults; the excess is trimmed. | |
| one_way | No | If True, search one-way tickets only. | |
| children | No | Number of children 2-11 years, 0-8 (default 0). Adults plus children cannot exceed 9; the excess is trimmed. | |
| currency | No | Price currency code (3 letters, e.g. "rub", "usd"). Defaults to the server's configured currency. | |
| return_at | No | Return date or month (YYYY-MM-DD or YYYY-MM). Optional. | |
| trip_class | No | "economy", "comfort", "business" or "first" (default "economy"). | economy |
| destination | Yes | Destination city IATA code (e.g. "IST", "BCN"). | |
| depart_after | No | Keep only flights departing at or after this local time ("HH:MM", 24-hour). Optional. | |
| departure_at | No | Departure date or month (YYYY-MM-DD or YYYY-MM). Optional; a month searches every day in it. | |
| depart_before | No | 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). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||