航班查询接口不同城市航班动态查询

航班查询接口支持不同城市航班查询,下面将分享航班查询接口开发文档及调用实例。

接口名称:航班查询接口

接口平台:聚合数据

接口地址:http://apis.juhe.cn/plan/city

支持格式:JSON/XML

请求方式:GET

请求示例:http://apis.juhe.cn/plan/city?key=xxxxx

接口备注:spell可作为航线查询的参数 —— 北京 分为 北京(PEK),北京南苑(NAY)。上海 分为 上海(SHA),上海浦东(PVG

航班查询接口JSON返回示例:

{
"resultcode":"200",
"reason":"SUCCESSED!",
"result":[
        {
            "city":"北京",
            "spell":"PEK"
        }
    ]
}

航班查询接口XML返回示例:

  <?xml version="1.0" encoding="utf-8" ?> 
- <root>
  <resultcode>200</resultcode> 
  <reason>SUCCESSED!</reason> 
- <result>
- <item>
  <city>安庆</city> 
  <spell>AQG</spell> 
  </item>
- <item>
    <city>阿克苏</city> 
    <spell>AKU</spell> 
  </item>
- <item>
    <city>阿勒泰</city> 
    <spell>AAT</spell> 
  </item>
- <item>
    <city>阿尔山</city> 
    <spell>YIE</spell> 
  </item>
- <item>
    <city>保山</city> 
    <spell>BSD</spell> 
  </item>
- <item>
    <city>包头</city> 
    <spell>BAV</spell> 
  </item>
- <item>
    <city>北京</city> 
    <spell>PEK</spell> 
  </item>
- <item>
    <city>北京南苑</city> 
    <spell>NAY</spell> 
  </item>
- <item>
    <city>博乐</city> 
    <spell>BPL</spell> 
  </item>
- <item>
    <city>巴彦淖尔</city> 
    <spell>RLK</spell> 
  </item>
- <item>
    <city>百色</city> 
    <spell>AEB</spell> 
  </item>
- <item>
    <city>常州</city> 
    <spell>CZX</spell> 
  </item>
- <item>
    <city>常德</city> 
    <spell>CGD</spell> 
  </item>
- <item>
    <city>成都</city> 
    <spell>CTU</spell> 
  </item>
- <item>
    <city>昌都</city> 
    <spell>BPX</spell> 
  </item>
- <item>
    <city>赤峰</city> 
    <spell>CIF</spell> 
  </item>
- <item>
    <city>重庆</city> 
    <spell>CKG</spell> 
  </item>
- <item>
    <city>长春</city> 
    <spell>CGQ</spell> 
  </item>
- <item>
    <city>长沙</city> 
    <spell>CSX</spell> 
  </item>
  </result>
  </root>


转载于:https://my.oschina.net/u/2473144/blog/514596

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
飞猪API查询航班信息接口示例: 请求URL:https://api.fliggy.com/search/flight_search.htm 请求方式:POST 请求参数: | 参数名 | 参数类型 | 是否必填 | 参数说明 | | ---------- | -------- | -------- | ------------------------------------------------------------ | | searchType | string | 是 | 查询类型,固定值为flight | | tripType | int | 是 | 行程类型,1为单程,2为往返 | | depCity | string | 是 | 出发城市的IATA代码,如BJS | | arrCity | string | 是 | 到达城市的IATA代码,如SHA | | depDate | string | 是 | 出发日期,格式为yyyy-mm-dd,如2021-10-01 | | arrDate | string | 否 | 返程日期,格式为yyyy-mm-dd,仅在行程类型为往返时必填 | | adultNum | int | 是 | 成人人数,取值范围为1-9 | | childNum | int | 否 | 儿童人数,取值范围为0-9 | | infantNum | int | 否 | 婴儿人数,取值范围为0-9 | | cabinClass | string | 否 | 舱位等级,可选值为ECONOMY(经济舱)、PREMIUM_ECONOMY(高端经济舱)、BUSINESS(商务舱)、FIRST(头等舱) | | maxPrice | int | 否 | 最大价格,单位为分,如50000表示不高于500元 | | minPrice | int | 否 | 最小价格,单位为分,如20000表示不低于200元 | 返回结果: | 参数名 | 参数类型 | 参数说明 | | ---------- | -------- | ------------------------------------------------------------ | | success | boolean | 接口调用是否成功 | | message | string | 接口调用返回的消息 | | data | object | 查询结果 | | --segments | array | 航班信息列表 | | ----depAir | object | 出发机场信息 | | ------code | string | 出发机场IATA代码 | | ------name | string | 出发机场名称 | | ----arrAir | object | 到达机场信息 | | ------code | string | 到达机场IATA代码 | | ------name | string | 到达机场名称 | | ----flight | object | 航班信息 | | ------no | string | 航班号 | | ----cabin | object | 舱位信息 | | ------name | string | 舱位名称 | | ------code | string | 舱位代码 | | ----price | object | 价格信息 | | ------total| int | 总价,单位为分 | | ------base | int | 基准价,单位为分 | | ------tax | int | 税费,单位为分 | | ----flightNo|string | 航班号 | | ----depTime|string | 出发时间,格式为yyyy-mm-dd HH:mm:ss | | ----arrTime|string | 到达时间,格式为yyyy-mm-dd HH:mm:ss | | ----flightTime|int | 飞行时间,单位为分钟 | | ----stopCities|array | 经停城市列表 | | ----stopAirports|array | 经停机场列表 | | ----planeType|string | 机型 | 示例请求: { "searchType": "flight", "tripType": 1, "depCity": "BJS", "arrCity": "SHA", "depDate": "2021-10-01", "adultNum": 1, "childNum": 0, "infantNum": 0, "cabinClass": "ECONOMY" } 示例返回: { "success": true, "message": "", "data": { "segments": [ { "depAir": { "code": "BJS", "name": "北京首都国际机场" }, "arrAir": { "code": "SHA", "name": "上海虹桥国际机场" }, "flight": { "no": "MU5131" }, "cabin": { "name": "经济舱", "code": "Y" }, "price": { "total": 10100, "base": 10000, "tax": 100 }, "flightNo": "MU5131", "depTime": "2021-10-01 08:00:00", "arrTime": "2021-10-01 10:25:00", "flightTime": 145, "stopCities": [], "stopAirports": [], "planeType": "333" }, { "depAir": { "code": "BJS", "name": "北京首都国际机场" }, "arrAir": { "code": "SHA", "name": "上海虹桥国际机场" }, "flight": { "no": "CA1561" }, "cabin": { "name": "经济舱", "code": "Y" }, "price": { "total": 10200, "base": 10000, "tax": 200 }, "flightNo": "CA1561", "depTime": "2021-10-01 07:55:00", "arrTime": "2021-10-01 10:20:00", "flightTime": 145, "stopCities": [], "stopAirports": [], "planeType": "321" } ] } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值