飞机航班动态实时查询API接口文档中心 您所在的位置:网站首页 8l9979航班信息 飞机航班动态实时查询API接口文档中心

飞机航班动态实时查询API接口文档中心

2024-07-01 22:43| 来源: 网络整理| 查看: 265

接口描述

接口分为两种查询方式。方式一:通过航班号和查询日期进行查询;方式二:通过航班起降地和查询日期进行查询。

请求说明

接口域名

api.hangxx.com

请求示例

HTTP 方法:GET/POST

请求URL:https://接口域名/restapi/airQuery/flightTime?authCode=鉴权码&flightNo=航班号&leaveCode=起飞城市三字码&arriveCode=降落城市三字码&queryDate=查询日期

url请求参数说明如下:

请求参数

参数 是否必选 类型 说明 authCode 是 string 航讯讯应用鉴权码,个人中心 -> 应用管理 -> 新建应用 -> 获得应用鉴权码 flightNo 否 string 航班号(通过航班号查询必须填写,如填写了航班号则会根据航班号进行查询) leaveCode 否 string 起飞城市三字码(通过航班起降地必须填写,如填写了航班号则此参数无效) arriveCode 否 string 降落城市三字码(通过航班起降地必须填写,如填写了航班号则此参数无效) queryDate 是 string 查询日期,格式:yyyy-MM-dd,如:1999-01-01,往前只能查询当前时间前3天的航班信息

请求代码示例

提示一:使用示例代码前,请记得替换相应的参数值。

提示二:部分语言依赖的类或库,请在代码注释中查看下载地址。

curl Python JAVA PHP C# curl -i -X GET 'https://接口域名/restapi/airQuery/flightTime?authCode=&flightNo=&leaveCode=&arriveCode=&queryDate=' #请先安装requests模块 url='https://接口域名/restapi/airQuery/flightTime?authCode= &flightNo=&leaveCode=&arriveCode=&queryDate=' r=requests.get(url) print r.text //请先导入httpclient相应的包 HttpClient httpclient = HttpClients.createDefault(); HttpGet get = new HttpGet("https://接口域名/restapi/airQuery/flightTime?authCode=&flightNo=&leaveCode= &arriveCode=&queryDate="); HttpResponse response = httpclient.execute(get); System.out.println(EntityUtils.toString(response.getEntity())); using System.IO; using System.Text; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; private const String host = "https://接口域名"; private const String path = "/restapi/airQuery/flightTime?authCode=&flightNo=&leaveCode= &arriveCode=&queryDate="; private const String method = "POST"; static void Main(string[] args) { String querys = ""; String url = host + path; HttpWebRequest httpRequest = null; HttpWebResponse httpResponse = null; if (0 返回说明

返回结果示例

{ "code":200, "message":"查询成功", "flightInfos":[ { "planArriveTime":"2010-10-28 12:30:00", //计划到达时间 "airlineCompany":"中国国航", //航空公司 "arrivePortCode":"PEK", //到达机场编码 "arrivePort":"首都机场", //到达机场名称 "planLeaveTime":"2010-10-28 10:00:00", //计划起飞时间 "arriveCity":"北京", //到达城市 "arriveBuilding":"T3", //到达航站楼 "flightNo":"CA1450", //航班号 "leaveBuilding":"T2", //起飞航站楼 "leavePort":"江北机场", //起飞机场 "state":"航班计划", //航班状态 "leavePortCode":"CKG", //起飞机场编码 "leaveCity":"重庆" //起飞城市 } ] }


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有