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
- 1. Collect
dep, arr, and date. - Validate
dep and arr as three-letter IATA city codes and date as YYYY-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 != 0 as a failure and surface the returned msg. - Treat an empty
data.list as a valid "no flights found" result. - Use
--limit N when the user only wants a subset of results. - Use
--json only 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.py accepts:
-
--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.
Variflight 全球航班票价
概述
使用捆绑脚本查询Variflight机票API,返回单条航线及日期的单程航班选项。
工作流程
- 1. 收集dep、arr和date参数。
- 验证dep和arr为三位字母的IATA城市代码,date为YYYY-MM-DD格式。
- 若用户提供城市名称而非代码,仅在映射明确时进行推断;否则要求提供IATA代码。
- 运行python3 scripts/query_flights.py --dep BJS --arr SHA --date 2026-04-21。
- 汇总结果,包含出发机场、到达机场、时间、航程时长、价格、中转信息及航班标签文本。
输出规则
- - 将API返回的code != 0视为失败,并展示返回的msg。
- 将空的data.list视为有效的未找到航班结果。
- 当用户仅需部分结果时使用--limit N参数。
- 仅当用户要求原始数据时使用--json参数。
- 汇总时需将中转航班与直飞航班分开说明。
- 不得要求用户为此技能提供API密钥。
脚本
- - scripts/query_flights.py接受以下参数:
- --dep
- --arr
- --date
- --limit
- --json
- - 脚本发送固定请求参数flightNum=10。
示例
运行python3 scripts/query_flights.py --dep BJS --arr SHA --date 2026-04-21 --limit 5,获取2026年4月21日北京至上海的前五个显示结果。