Search Flights
flights_searchFull Description
Searches for flights between airports or cities and displays the results as an interactive carousel widget. Use this whenever the user wants flight options.
Not for flight status, price tracking, visa information, bookings, or reservation management. Returns results from a Wego metasearch in a single call.
Parameters:
- newSearch: Route (from/to as IATA codes), dates (fromDate, toDate in YYYY-MM-DD), passengers, and cabin class. Omit toDate for one-way trips.
- Defaults when not specified: 1 adult, 0 children, 0 infants, economy cabin.
- filters: Include only when the user mentions specific preferences (airlines, stops, times, price range, etc.).
- sorting: A single string value. Options: score_desc (recommended, default), price_asc (cheapest), duration_asc (fastest), leg1_departure_time_asc/desc (outbound departure), leg2_departure_time_asc/desc (return departure, round-trip only).
- locale: BCP-47 language tag (e.g., "en", "ar", "fr"). Affects widget i18n strings. Defaults to caller's locale.
- currencyCode: ISO-4217 currency (e.g., "USD", "AED"). Affects widget price display. Defaults to caller's currency.
Time filtering (time ranges in minutes from midnight, 0-1440):
- Format: {min: minutesFromMidnight, max: minutesFromMidnight}
- Example: "flights after 10pm" → outboundDepartureTimeRange: {min: 1320, max: 1440}
- Example: "depart 8am-1pm" → outboundDepartureTimeRange: {min: 480, max: 780}
- Supports wraparound: {min: 1380, max: 60} = 11pm-1am (crosses midnight)
Refinement: Provide the searchId from a previous response with updated filters or sorting. Refinement replaces all previous filters and sorting entirely — include existing values alongside new ones to preserve them.
Example — changing return to after 10pm while keeping existing airlines ["SQ", "KE"], outbound 6am-8am, and price_asc sorting: { "searchId": "abc", "filters": { "airlines": ["SQ", "KE"], "outboundDepartureTimeRange": { "min": 360, "max": 480 }, "inboundArrivalTimeRange": { "min": 1320, "max": 1440 } }, "sorting": "price_asc" }
Default behavior:
- One date provided → one-way trip
- Return date mentioned → round-trip
- No preferences stated → omit filters
- City name without specific airport → use the city IATA code (e.g., "London" → LON, "New York" → NYC, "Tokyo" → TYO). City codes automatically search all airports in that city.
The widget handles flight result display. Format URLs as markdown links: [text](url).
Parameters (0 required, 6 optional)
currencyCodestringCurrency code for pricing (e.g., 'USD', 'EUR', 'AED'). When refining or starting a new search, reuse the currency from any previous flight/hotel search in this conversation. Supports ISO 4217 3-letter currency codes.
filtersobjectFlight filters. On refinement, filters replace all previous filters — re-include existing ones to preserve them.
localestringLocale for results (e.g., 'en', 'ar', 'zh'). If not provided, uses the locale from the user's settings. Supports BCP 47 format (e.g., 'ar-SA' resolves to 'ar').
newSearchobjectNew flight search parameters. Include route, dates, and passengers. Omit when refining via searchId.
searchIdstringReuse the searchId from a previous search when refining, filtering, or sorting.
sortingstringSort order for results. Pass a single string value. Options: score_desc (recommended, default), price_asc (cheapest), duration_asc (fastest), leg1_departure_time_asc/desc (outbound departure), leg2_departure_time_asc/desc (return departure, round-trip only).
score_descprice_ascduration_ascleg1_departure_time_ascleg1_departure_time_descleg2_departure_time_ascleg2_departure_time_descscore_desc