免费快递查询接口api(识别各家快递,无需加友情链接无需授权)
apistore吧
全部回复
仅看楼主
level 1
sxmlovethq 楼主
免费快递查询(识别各家快递,无需加友情链接无需授权)
1,获取apikey,获取方法:1,加微信公众号“芝麻烩”,发送文本“接口”即可获得接口apikey
2,发起curl请求(可以是post也可以是get提交数据)
3,返回数据为json
4,交流讨论加群:338461207
使用说明:
请求url:http://www.monqin.com/wxapp/index.php/Home/api/express
apikey :授权密钥
keyword :需要查询的快递单号
kuaidicompany :快递公司
php请求示例:
$keyword=urlencode(1071504905514);
$url = 'http://www.monqin.com/wxapp/index.php/Home/api/express';
$data['apikey']='4a96d59a180d43bb22b98db840c0979a';
$data['keyword']=$keyword;
$data['kuaidicompany']="顺丰";
$data=curl($url,$data,'','post');
var_dump($data);
//构造请求
function curl($url,$data=1,$header=0,$type='get'){
$ch = curl_init();
// 添加header
if(is_object($header)||is_array($header)){
@curl_setopt($ch, CURLOPT_HTTPHEADER ,$header);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //如果需要将结果直接返回到变量里,那加上这句。
if(@$type=='post'){
curl_setopt($ch, CURLOPT_POST, 1);
if(is_object($data)||is_array($data)){
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));
}else{
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
}
}
// 执行HTTP请求
curl_setopt($ch , CURLOPT_URL , $url);
$res = curl_exec($ch);
curl_close($ch);
$res = json_decode($res,true); //将数组进行json格式打包
return $res;
}
2015年08月13日 15点08分 1
level 1
如果要商用的话 确实不建议用免费的接口 问题太多 可以试试聚合 极速数据 或者haoservise的
2016年03月16日 06点03分 3
level 13
这个我自己也做了一个。。
2016年07月30日 10点07分 4
level 1
也可以用百度的
https://apis.baidu.com/
2020年11月05日 12点11分 5
1