Variflight Global Flight Fares
Variflight Global Flight Fares searches one-way flight fares from the Variflight ticket API by departure IATA city code, arrival IATA city code, and departur...
Latest: v1.0.0
Initial release of Variflight Global Flight Fares.
- Search one-way flight fares using the Variflight ticket API with departure and arrival IATA codes and date.
- Validates input format for IATA codes and departure date (YYYY-MM-DD).
- Handles ambiguous city names by prompting for correct codes.
- Summarizes results including airports, times, duration, price, transfers, and flight tags.
- Surface API error messages and provide clear feedback for empty results.
- Script supports result limiting and raw JSON output on user request.
Variflight Global Flight Fares
Overview
Use the bundled script to query the Variflight ticket API and return one-way flight options for a single route and date.
Workflow
- Collect
dep,arr, anddate. - Validate
depandarras three-letter IATA city codes anddateasYYYY-MM-DD. - If the user gives city names instead of codes, infer only when the mapping is unambiguous; otherwise ask for the IATA codes.
- Run
python3 scripts/query_flights.py --dep BJS --arr SHA --date 2026-04-21. - Summarize the result with departure airport, arrival airport, times, duration, price, transfer info, and the flight tag text.
Output Rules
- Treat API
code != 0as a failure and surface the returnedmsg. - Treat an empty
data.listas a valid "no flights found" result. - Use
--limit Nwhen the user only wants a subset of results. - Use
--jsononly when the user asks for raw payload data. - Mention transfer flights separately from direct flights when summarizing.
- Do not ask the user to provide an API key for this skill.
Script
scripts/query_flights.pyaccepts:--dep--arr--date--limit--json
- The script sends the fixed request parameter
flightNum=10.
Example
Run python3 scripts/query_flights.py --dep BJS --arr SHA --date 2026-04-21 --limit 5 to fetch the first five displayed results for Beijing to Shanghai on April 21, 2026.
