首页 交通出行 航班查询
航班查询

航班查询

  • 1553
  • 2111
两个城市之间的实时航班信息、票价查询。航班具体信息,支持城市等。
450.00/10000次
申请就送10次
接口已下架
https://api.jisuapi.com/flight/query
JSON
GET POST
https://api.jisuapi.com/flight/query?city=TYN&endcity=RMQ&flightno=&appkey=yourappkey

请求参数:

API在线测试
参数名称类型必填说明
city string 出发城市/三字码
endcity string 到达城市/三字码
date string 日期 默认当天

返回参数:

参数名称类型说明
city string 出发城市
endcity string 到达城市
flightno string 航班号
realflightno string 真实承运人
departportcode string 出发机场代号
arrivalportcode string 到达机场代号
departterminal string 出发机场航站楼
arrivalterminal string 到达机场航站楼
departdate string 计划起飞日期
arrivaldate string 计划到达日期
departtime string 预计到达时间
arrivaltime string 预计到达时间
departdateadd string 起飞日期修正(+1表示起飞日期是查询日期的下一天)
arrivaldateadd string 到达日期修正(+1表示到达日期是查询日期的下一天)
craft string 机型
stopnum string 经停次数
costtime string 用时
punctualrate string 准点率
pricelist string 价格表
cabinname string 舱位名称
cabincode string 舱位代码
price string 价格
discount string 折扣
minprice string 最低价
airporttax string 机建费
fueltax string 燃油费
food string 餐食标志
isasr string ASR支持标志
iseticket string 电子票标志
iscodeshare string 代码共享标志
airline string 航空公司

请求代码:

查看代码
<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$city = 'TYN';  //出发城市
$endcity = 'RMQ'; //到达城市
$flightno =''; //航班号
$url = "https://api.jisuapi.com/flight/query?city=$city&endcity=$endcity&flightno=$flightno&appkey=$appkey";

$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
echo $result['city'].' '.$result['endcity'].' '.$result['flightno'].'
'; foreach($result['list'] as $val) { echo $val['flightno'].' '.$val['realflightno'].' '.$val['departportcode'].' '.$val['arrivalportcode'].' '. $val['departterminal'].' '.$val['arrivalterminal'].' '.$val['departdate'].' '.$val['arrivaldate']. ' '. $val['departtime'].' '.$val['arrivaltime'].' '.$val['departdateadd'].' '.$val['arrivaldateadd']. ' '. $val['craft'].' '.$val['stopnum'].' '. $val['costtime'].' '.$val['punctualrate'].'
'; foreach($val['pricelist'] as $v) { echo $v['cabinname'].' '.$v['cabincode'].' '.$v['price'].' '.$v['discount'].'
'; } echo $val['minprice'].' '. $val['airporttax'].' '.$val['fueltax'].' '. $val['food'].' '.$val['isasr'].' '. $val['iseticket'].' '.$val['iscodeshare'].'
'; }

JSON返回示例 :

{
	"status": 0,
	"msg": "ok",
	"result": {
		"city": "SHA",
		"endcity": "CAN",
		"flightno": "",
		"list": [{
			"flightno": "BA2310",
			"realflightno": "MU2882",
			"departportcode": "PVG",
			"arrivalportcode": "NKG",
			"departterminal": "T1",
			"arrivalterminal": "T2",
			"departdate": "2018-06-05",
			"arrivaldate": "2018-06-05",
			"departtime": "22:50",
			"arrivaltime": "23:55",
			"departdateadd": "0",
			"arrivaldateadd": "0",
			"craft": "320",
			"stopnum": "0",
			"costtime": "1:05",
			"punctualrate": "95",
			"pricelist": [],
			"minprice": "1070",
			"airporttax": "50",
			"fueltax": "10",
			"food": "0",
			"isasr": "0",
			"iseticket": "1",
			"iscodeshare": "1"
		}, {
			"flightno": "MU2882",
			"realflightno": "",
			"departportcode": "PVG",
			"arrivalportcode": "NKG",
			"departterminal": "T1",
			"arrivalterminal": "T2",
			"departdate": "2018-06-05",
			"arrivaldate": "2018-06-05",
			"departtime": "22:50",
			"arrivaltime": "23:55",
			"departdateadd": "0",
			"arrivaldateadd": "0",
			"craft": "320",
			"stopnum": "0",
			"costtime": "1:05",
			"punctualrate": "95",
			"pricelist": [{
				"cabinname": "头等舱",
				"cabincode": "F",
				"price": "2350",
				"discount": "220"
			}, {
				"cabinname": "公务舱",
				"cabincode": "J",
				"price": "2030",
				"discount": "190"
			}, {
				"cabinname": "公务舱",
				"cabincode": "C",
				"price": "1280",
				"discount": "120"
			}, {
				"cabinname": "公务舱",
				"cabincode": "D",
				"price": "1180",
				"discount": "110"
			}, {
				"cabinname": "公务舱",
				"cabincode": "Q",
				"price": "1120",
				"discount": "105"
			}, {
				"cabinname": "公务舱",
				"cabincode": "I",
				"price": "910",
				"discount": "85"
			}, {
				"cabinname": "经济舱",
				"cabincode": "Y",
				"price": "1070",
				"discount": "100"
			}, {
				"cabinname": "经济舱",
				"cabincode": "B",
				"price": "1060",
				"discount": "99"
			}, {
				"cabinname": "经济舱",
				"cabincode": "M",
				"price": "970",
				"discount": "91"
			}, {
				"cabinname": "经济舱",
				"cabincode": "E",
				"price": "870",
				"discount": "81"
			}, {
				"cabinname": "经济舱",
				"cabincode": "K",
				"price": "760",
				"discount": "71"
			}, {
				"cabinname": "经济舱",
				"cabincode": "L",
				"price": "710",
				"discount": "66"
			}, {
				"cabinname": "经济舱",
				"cabincode": "N",
				"price": "650",
				"discount": "61"
			}, {
				"cabinname": "经济舱",
				"cabincode": "R",
				"price": "550",
				"discount": "51"
			}, {
				"cabinname": "经济舱",
				"cabincode": "S",
				"price": "500",
				"discount": "47"
			}, {
				"cabinname": "经济舱",
				"cabincode": "V",
				"price": "450",
				"discount": "42"
			}],
			"minprice": "1070",
			"airporttax": "50",
			"fueltax": "10",
			"food": "0",
			"isasr": "1",
			"iseticket": "1",
			"iscodeshare": "0"
		}]
	}
}
                    

API错误码:

代号说明
201 航班号和城市都为空
202 航班号为空
203 城市不存在或不支持
209 没有相关航班信息
210 未知错误

系统错误码:

代号说明
101 APPKEY为空或不存在
102 APPKEY已过期
103 APPKEY无请求此数据权限
104 请求超过次数限制
105 IP被禁止
106 IP请求超过限制
107 接口维护中
108 接口已停用
计次套餐套餐规格价格
免费套餐 10次 0.00 元  ≈0元/次
Level1 10000次 450.00 元  ≈0.045元/次
Level2 20000次 890.00 元  ≈0.0445元/次
Level3 50000次 2200.00 元  ≈0.044元/次
Level4 100000次 4300.00 元  ≈0.043元/次

2023-07-01

航班号查询将不再支持,下架子接口,并停止相关服务

活动推荐ACTIVITY 更多

  • orc活动

其它推荐RECOMMENDED DATA 更多