baidu 快递查询API

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>百度快递查询接口Demo</title>

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

</head>

<script type="text/javascript">
var strUrl = "http://baidu.kuaidi100.com/query";
var typeValue = "tiantian", postIdValue = "886511927358";
typeValue = getCompanyCode("天天");

var gQueryType = 4; //查询类型,4为百度查询
var type;
var postid;
var isvalide;
var havereturn = false;
var statuscode = 0;
var req;
var ischoose = false;
var returnjson;
var returnjson_up = [];
var returnjson_down = [];
var gSortStatus = 0;
var queryurl = ‘‘;
var isavailable = 1;
var gIsCheck;

var t;
getResult();
function $(id) { return document.getElementById(id) }

function getCompanyCode(name) {
var companyList = []; // 快递公司名 | 快递公司对应查询快递单号名
companyList.push("EMS|ems");
companyList.push("申通|shentong");
companyList.push("圆通|yuantong");
companyList.push("中通|zhongtong");
companyList.push("汇通|huitongkuaidi");
companyList.push("E邮宝|ems");
companyList.push("UPS|ups");
companyList.push("顺丰|shunfeng");
companyList.push("韵达|yunda");
companyList.push("天天|tiantian");
companyList.push("宅急送|zhaijisong");
companyList.push("邮政包裹|youzhengguonei");

companyList.push("AAE|aae");
companyList.push("安信达|anxindakuaixi");
companyList.push("BHT|bht");
companyList.push("百福东方|aae");
companyList.push("包裹/平邮/挂号信|youzhengguonei");
companyList.push("COE|coe");
companyList.push("CCES(希伊艾斯)|cces");
companyList.push("DHL|dhl");
companyList.push("大田|datianwuliu");
companyList.push("德邦|debangwuliu");
companyList.push("D速|dsukuaidi");
companyList.push("递四方|disifang");
companyList.push("飞康达|feikangda");
companyList.push("FedEx(国际)|fedex");
companyList.push("凡客|rufengda");
companyList.push("能达速递|ganzhongnengda");
companyList.push("挂号信|youzhengguonei");
companyList.push("共速达|gongsuda");
companyList.push("京广|jinguangsudikuaijian");
companyList.push("佳吉|jiajiwuliu");
companyList.push("佳怡|jiayiwuliu");
companyList.push("急先达|jixianda");
companyList.push("龙邦|longbanwuliu");
companyList.push("联昊通|lianhaowuliu");
companyList.push("联邦快递(国内)|lianbangkuaidi");
companyList.push("全一|quanyikuaidi");
companyList.push("全晨|quanchenkuaidi");
companyList.push("全日通|quanritongkuaidi");
companyList.push("全峰|quanfengkuaidi");
companyList.push("速尔|suer");
companyList.push("盛辉|shenghuiwuliu");
companyList.push("申通E物流|shentong");
companyList.push("穗佳物流|suijiawuliu");
companyList.push("TNT|tnt");
companyList.push("天地华宇|tiandihuayu");
companyList.push("特快专递|ems");
companyList.push("新邦|xinbangwuliu");
companyList.push("信丰|xinfengwuliu");
companyList.push("鑫飞鸿|xinhongyukuaidi");
companyList.push("星晨急便|xingchengjibian");
companyList.push("优速|youshuwuliu");
companyList.push("运通|yuntongkuaidi");
companyList.push("源伟丰|yuanweifeng");
companyList.push("远成|yuanchengwuliu");
companyList.push("越丰|yuefengwuliu");
companyList.push("亚风|yafengsudi");
companyList.push("元智捷诚|yuanzhijiecheng");
companyList.push("邮政国内包裹|youzhengguonei");
companyList.push("邮政国际包裹|youzhengguoji");
companyList.push("中铁快运|zhongtiewuliu");
companyList.push("中邮物流|zhongyouwuliu");
var companyCode = "";
var flag = false;
for (var i = 0; i < companyList.length; i++) {
var values = companyList[i].split("|");
var companyNames = values[0].split("/");
for (var j = 0; j < companyNames.length; j++) {
if (companyNames[j].indexOf(name) >= 0) {
flag = true;
companyCode = values[1];
break;
}
}
if (flag) {
break;
}
}
return companyCode;
}

function getResult() {
var url = strUrl + "?type=" + typeValue + "&postid=" + postIdValue + "&id=" + gQueryType;
if (window.XMLHttpRequest) {
req = new XMLHttpRequest()
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP")
}
if (req) {
req.open("GET", url, true);
req.onreadystatechange = complete;
req.send(null);
}
}

function complete() {
if (req.readyState == 4) {
if (req.status == 200) {
if (!havereturn) {
var resultcontext = req.responseText;
var json = eval("(" + resultcontext + ")");
statuscode = json.status;
gIsCheck = 0;
if (json.status == 200) { //如果查询成功 20121011
gIsCheck = json.ischeck;
returnjson = json;

returnjson_up = [];
returnjson_down = [];
for (var i in json.data) {
returnjson_up[i] = json.data[i];
returnjson_down[i] = json.data[i];
}

for (var i = 0; i < returnjson_down.length / 2; i++) {
var tmp = returnjson_down[i];
returnjson_down[i] = returnjson_down[returnjson_down.length - i - 1];
returnjson_down[returnjson_down.length - i - 1] = tmp;
}
$("showcontext").style.display = "block";
var data = json.data;
totalcount = data.length;
currentpage = 1;
fenye(currentpage);
} else {
$("errordiv").style.display = "block";
$("errorMessage").innerHTML = "此单号无记录,请核对快递公司名称和运单号码是否正确!";
}
//refreshcode();
}
}
}
}

//排序
function sortToggle() {
if (gSortStatus == 1) {
gSortStatus = 0;
sortup();
} else {
gSortStatus = 1;
sortdown();
}
}

function sortup() {
var table = $("showtablecontext");
while (table.rows.length > 1) {
table.deleteRow(1);
}
returnjson.data = returnjson_up;
$("b-down").className = "b-down";
$("b-up").className = "b-up b-up-active";
fenye(1);
}

function sortdown() {
var table = $("showtablecontext");
while (table.rows.length > 1) {
table.deleteRow(1);
}
returnjson.data = returnjson_down;
$("b-down").className = "b-down b-down-active";
$("b-up").className = "b-up";
fenye(1);
}

function fenye(currentpage) {
var json = returnjson;
if (json == null) {
return;
}
var data = json.data;
var obj = json;
var pagecount = 0;
var pagesize = 5;
if (isvalide) pagesize = 4;
var totalcount = data.length;
if ((totalcount % pagesize) == 0) {
pagecount = parseInt(totalcount / pagesize);
} else {
pagecount = parseInt(totalcount / pagesize) + 1;
}
var data = json.data;
var height_table = 72;
var table = $("showtablecontext");

while (table.rows.length > 1) {
table.deleteRow(1);
}
for (var i = (currentpage - 1) * pagesize; i < currentpage * pagesize; i++) {
if (i > (totalcount - 1)) break;
if (isvalide) height_table = 80;
if ((height_table + table.clientHeight) > 280) {
$("fenye").style.display = "block";
break;
}
var newTr = table.insertRow(-1);
var newTd0 = newTr.insertCell(-1);
var newTd1 = newTr.insertCell(-1);
newTd0.innerHTML = data[i].time;
newTd1.innerHTML = data[i].context;
var strlength = 25;
if (newTr.clientHeight > 30) {
if (data[i].context.length > strlength) {
newTd1.innerHTML = data[i].context;
newTd1.innerHTML = newTd1.innerHTML.substring(0, strlength) + "...";
strlength = strlength - 1;
newTd1.title = data[i].context;
}
}
if (gSortStatus == 0 && i == 0) {
newTd0.className = "nobg c-g-a fontorange";
newTd1.className = "nobg c-g-b fontorange";
newTd1.innerHTML += ‘<span class="lastTag"></span>‘;
} else if (gSortStatus == 1 && i == totalcount - 1) {
newTd0.className = "nobg c-g-a fontorange";
newTd1.className = "nobg c-g-b fontorange";
newTd1.innerHTML += ‘<span class="lastTag"></span>‘;
} else {
newTd0.className = "nobg c-g-a";
newTd1.className = "nobg c-g-b";
}
if ((height_table + table.clientHeight) > 280) {
table.deleteRow(1);
break;
}
}
var sbufferContext = "";
if (pagecount == 1) {
$("fenye").innerHTML = sbufferContext;
$("fenye").style.display = "block";
return;
} else {
$("fenye").style.display = "block";
}
var list = "";
if (pagecount <= 5) {
for (var i = 1; i <= pagecount; i++) {
if (i == currentpage) {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number2‘ >" + i + "</a>";
} else {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(" + i + ")‘>" + i + "</a>";
}
}
} else if (pagecount > 5) {
if (currentpage <= 3) {
for (var i = 1; i <= 5; i++) {
if (i == currentpage) {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number2‘ >" + i + "</a>";
} else {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(" + i + ")‘>" + i + "</a>";
}
}
list += "<span class=‘divpaging-span2‘>...</span>";
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(" + pagecount + ")‘ >" + pagecount + "</a>";
} else if (currentpage <= pagecount - 4) {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(1)‘ >1</a>";
list += "<span class=‘divpaging-span2‘>...</span>";
for (var i = currentpage - 2; i <= currentpage + 2; i++) {
if (i == currentpage) {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number2‘ >" + i + "</a>";
} else {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(" + i + ")‘>" + i + "</a>";
}
}
list += "<span class=‘divpaging-span2‘>...</span>";
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(" + pagecount + ")‘ >" + pagecount + "</a>";
} else if (currentpage > pagecount - 4) {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(1)‘ >1</a>";
list += "<span class=‘divpaging-span2‘>...</span>";
for (var i = pagecount - 4; i <= pagecount; i++) {
if (i == currentpage) {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number2‘ >" + i + "</a>";
} else {
list += "<a href=‘javascript:void(0)‘ class=‘divpaging-a-number1‘ onclick=‘fenye(" + i + ")‘>" + i + "</a>";
}
}
}
}
$("fenye").innerHTML = list.toString();
}
</script>

<style type="text/css">

body
{
background: #ffffff;
}
*
{
margin: 0px;
padding: 0px;
}

.round_gray_new { padding:0px 0px 0px 10px; clear:both; width:514px }
.xboxcontent_a { display:block; background:#FFFAE2; border:0px solid #F5E190; border-width:0px 1px; padding:8px 15px }
.xboxcontent_a p { margin:0px; padding:0px; line-height:30px; font-size:14px; font-weight:bold; color:#F00 }
.xboxcontent_a dt { line-height:30px }
.xboxcontent_a dd { line-height:20px; font-family:"瀹嬩綋"; }
.xboxcontent_a a { color:#0A8ECE; font-weight:bold }

.divpaging
{
font-size: 12px;
line-height: 16px;
text-align: center;
vertical-align: middle;
margin: 5px 0px 0px 10px;
}
.divpaging a
{
float: left;
}
.divpaging span
{
float: left;
}
.divpaging .divpaging-a-number1
{
border: #cee3f2 1px solid;
padding: 1px 6px 1px 6px;
color: #2477b3;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-a-number1:hover
{
border: #fd6d01 1px solid;
padding: 1px 6px 1px 6px;
color: #fd6d01;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-a-number2
{
border: none;
padding: 2px 7px 2px 7px;
color: #e63922;
margin: 2px 1px 2px 2px;
font-weight: bold;
}
.divpaging .divpaging-a-number3
{
border: #2477b3 1px solid;
background: #2477b3;
padding: 1px 6px 1px 6px;
color: #ffffff;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-a-number3:hover
{
border: #fd6d01 1px solid;
background: #ffffff;
padding: 1px 6px 1px 6px;
color: #fd6d01;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-a-button
{
border: #cee3f2 1px solid;
padding: 1px 6px 1px 6px;
color: #2477b3;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-a-button:hover
{
border: #fd6d01 1px solid;
padding: 1px 6px 1px 6px;
color: #fd6d01;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-span1
{
border: #c0c7cc 1px solid;
padding: 1px 6px 1px 6px;
color: #c0c7cc;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-span2
{
border: none;
padding: 2px 6px 2px 6px;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-span3
{
border: none;
padding: 2px 0px 2px 10px;
color: #c0c7cc;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-span4
{
border: none;
padding: 2px 6px 2px 0px;
color: #c0c7cc;
margin: 2px 1px 2px 2px;
}
.divpaging .divpaging-input1
{
float: left;
border: #cee3f2 1px solid;
width: 32px;
height: 18px;
margin: 2px;
text-align: center;
color: #2477b3;
font-size: 12px;
}
.kd-result-new
{
padding: 0 0 0 10px;
float: left;
width: 514px;
}
#showtablecontext
{
background: #ffffff;
}
#showtablecontext .b-btn
{
float: right;
position: relative;
}
#showtablecontext b
{
font-size: 0;
height: 0;
line-height: 0;
overflow: hidden;
position: absolute;
width: 0;
}
#showtablecontext .b-up
{
border-color: transparent transparent #C9C4CA;
border-style: dashed dashed solid;
border-width: 4px;
border-width: 5px \9;
right: 5px;
right: 4px \9;
top: 4px;
top: 1px \9;
}
#showtablecontext .b-down
{
border-color: #C9C4CA transparent transparent;
border-style: solid dashed dashed;
border-width: 4px;
right: 5px;
top: 17px;
top: 15px \9;
}
#showtablecontext .b-up-active
{
border-color: transparent transparent #FFFFFF;
}
.bluebg
{
background: #64AADB;
border: #75C2EF 1px solid;
height: 28px;
line-height: 28px;
color: #FFFFFF;
font-weight: bold;
text-indent: 15px;
}
.nobg
{
border: 1px solid #DDDDDD;
font-size: 12px;
line-height: 22px;
padding: 3px 5px;
vertical-align: top;
}
.fontorange
{
color: #FF6600;
}
.lastTag
{
margin-left: 5px;
display: inline-block;
width: 22px;
height: 9px;
background: url("http://cdn.kuaidi100.com/images/frame/baidu/synastry_pics.gif") -251px -49px no-repeat;
vertical-align: top;
}
</style>
<body>
<div class="round_gray_new" id="errordiv" style="display: none; clear: both;">
<b class="xtop"><b class="xb1a"></b><b class="xb2a"></b><b class="xb3a"></b><b class="xb4a">
</b></b>
<div class="xboxcontent_a">
<p style="line-height: 25px; margin: 0px; padding: 0px;">
<font id="errorMessage">您输入的验证码错误,请重新输入!</font></p>
</div>
<b class="xbottom"><b class="xb4a"></b><b class="xb3a"></b><b class="xb2a"></b><b
class="xb1a"></b></b>
</div>
<div class="kd-result-new" id="showcontext" style="display: none;">
<table width="910" border="0" cellspacing="0" cellpadding="0" id="showtablecontext">
<tr>
<td width="27%" class="bluebg" onclick="sortToggle()" style="cursor: pointer">
<span class="b-btn"><b class="b-up b-up-active" id="b-up"></b><b class="b-down" id="b-down">
</b></span>时间
</td>
<td width="73%" class="bluebg">
地点和跟踪进度
</td>
</tr>
</table>
<div class="divpaging" id="fenye">
</div>
</div>
</body>
</html>

您输入的验证码错误,请重新输入!





时间 地点和跟踪进度

baidu 快递查询API,布布扣,bubuko.com

时间: 2024-10-13 01:06:15

baidu 快递查询API的相关文章

免费快递查询API接口

通过向指定的地址发送请求,即可在一个新的html5页面内显示物流单号的跟综信息,支持所有快递公司,无需后期维护,无需申请,适合手机应用. 免费快递查询API地址: http://m.kuaidi100.com/index_all.html?type=[快递公司编码]&postid=[快递单号]&callbackurl=[点击"返回"跳转的地址] 输入参数 名称 类型 是否必需 描述 type String 是 要查询的快递公司的代码,支持中文和模糊输入,支持本网站的所有

快递查询API接口对接方法

各类接口 快递查询API有即时查询和订阅查询两种,即时是请求即返回数据,订阅则是订阅快递单号到接口,有物流轨迹更新则全量返回数据.目前常用的有快递鸟.快递100.快递网等. 快递鸟即时API可以查询3000次,3000以上接订阅接口,统一接口模式接入,常用快递均支持查询,还有订阅API.在线下单API.电子面单API,接口均不收取费用,没有要求用户添加外链,支持418家国内外快递物流查询. 快递100每天可以免费查询2000次,超过2000次收费,每次0.06~0.1元不等,如果查询的量大的话可

php 快递查询api接口笔记

1 <?php 2 include_once("../includes/global.php"); 3 @include_once("../config/logistics_config.php"); 4 5 $api_id = $logistics_config['logistic_app_id']?$logistics_config['logistic_app_id']:""; 6 $api_sceret = $logistics_co

各种快递查询Api接口(快递鸟)

前提 应用场景 可实现需求 申请Key 快递查询Api接口 接口文档及各开发语言Demo 查询Api接口定义 系统级输入参数 应用级输入参数 返回结果参数 请求JSON参数 响应JSON参数 查询Api接口使用 温馨提示 前提 项目开发中,有些需求难免会用到关于快递的一些Api接口:本篇主要介绍的是快递的查询Api及与其他各家的不同之处: 常用的提供快递Api接口的有: 快递鸟 快递100 爱查快递 等等 如大家使用过,快递100和爱查快递等等网站提供的快递查询等接口时,你会发现,你所申请的账号

快递查询API接口调用代码示例

快递查询接口是指快递查询网对外开放的应用程序接口,开发人员能够通过调用该接口与快递查询网进行交互,并基于该接口开发自己的快递查询应用程序.目前比较常用的接口有快递鸟.快递100.快递网等. 应用场景 (1)电商网站用户打开"我的订单"时调用此API显示物流信息详情.  (2)电商管理后台的物流系统,客服在对账前查询所有运单的签收状态,并追踪问题. 物流轨迹查询接口有即时查询和订阅查询两种,即时是请求即返回数据,订阅则是订阅快递单号到接口,有物流轨迹更新则全量返回数据. 快递鸟即时接口可

快递查询API接口(trackingmore)

快递查询接口 目前提供快递查询的接口平台有: Trackingmore 快递100 快递网 不同接口的区别: (1)Trackingmore支持380家快递公司,其中有55家为国内的快递,其余325家为国际快递.具体的价格为0.6分钱/单号左右,新注册用户可以免费测试12小时. (2)快递100属于在国内做得比较早的平台,可以申请每天最多2000次的API调用,但需要给快递100做一个友链.超过2000次收费,每次0.06~0.1元不等. (3)快递网可以申请每天最多500次的API调用,但同样

电商平台适用基础快递查询api接口对接demo解决方案

电商企业从接收订单-配货-打印快递单到后期的快递员收件-快递配送-轨迹查询-签收短信通知等,都需要快递接口的接入.整理目前可以实现如上服务的有 1.各家快递公司:提供快递查询.电子面单打印等2.快递100:提供在线寄件.快递查询等3.菜鸟:提供快递查询.电子面单打印等4.快递鸟:提供预约寄件.快递查询.电子面单打印.代收货款.短信服务等 各家快递公司提供的是一级接口,快递100.菜鸟和快递鸟是集成接口,对于使用快递比较多的企业来说,集成接口相对更好维护一些.所以一般电商都会选择集成的接口.快递鸟

常用快递查询API接口-基于极核数据

此接口支持顺丰.EMS.申通.圆通.韵达.汇通.中通.天天.德邦.全峰等主流快递公司 1.快递公司列表 ·        接口地址:http://api.data-ranking.com/express/company ·        支持格式:JSON ·        请求方式:GET ·        请求示例:http://api.data-ranking.com/express/company?appkey=APPKEY 请求参数: 名称 类型 必填 说明 key string 是

简单快递查询接口API插件下载和安装说明

电商实现物流轨迹查询是通过对接接口或者安装插件就可以实现了 插件安装方法如下 安装办法 第1步:申请授权KEY 本插件是php通用版本,适用php5.2及以上版本:快递鸟提供的免费快递查询API,对接前需在快递鸟官网申请账号注册获取ID和秘钥 . 第2步:录入授权Key (1)拿到授权KEY后,用记事本.写字板或EditPlus等文本编辑工具,打开插件\plugins\kdniao下的kdniao_config.php 文件. (2)找到define('EBusinessID', '******