本次讲解如何使用快递聚合供应商来实现查询京东速运快递物流轨迹,首先,我们需要准备的资源。
平台的密钥key:登录后在个人中心查看
测试接口的链接:在下方文档处查看
其中,KEY为用户后台我的api页面展示的API密钥, 代码示例如下:
import requests
url = "http://api.tanshuapi.com/api/exp/v1/index?key=&com=jd&no=JDV013104061328
payload={}
headers = {
'Accept': '*/*',
'Host': 'api.tanshuapi.com',
'Connection': 'keep-alive'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
返回物流轨迹说明:
请求结果展示:
{
"code": 1,
"msg": "操作成功",
-"data": {
"company": "京东快递",
"com": "jd",
"no": "JDX028718268671",
"com_phone": "950616",
"com_url": "www.jdl.cn",
"take_time": "1天4小时42分",
"courier_phone": "19502161316",
"status_desc": "已签收",
"status_detail": 4,
-"list": [
-{
"datetime": "2024-06-25 18:08:10",
"remark": "您的快件已由本人签收,感谢您使用京东物流,期待再次为您服务"
},
-{
"datetime": "2024-06-25 14:03:18",
"remark": "您的快件正在派送中,请您准备签收(快递员:谢全志,联系电话:19502161316)。京东已开启“号码保护”,您的电话隐私不会被泄露,请放心接听!"
},
-{
"datetime": "2024-06-25 13:27:23",
"remark": "您的快件已到达【杭州桐庐营业部】"
},
-{
"datetime": "2024-06-25 13:27:22",
"remark": "您的快件在【杭州桐庐营业部】收货完成"
},
-{
"datetime": "2024-06-25 11:51:36",
"remark": "您的快件已发车"
},
-{
"datetime": "2024-06-25 11:45:51",
"remark": "您的快件由【杭州散货分拣中心】完成分拣,准备发往【杭州桐庐营业部】"
},
-{
"datetime": "2024-06-25 11:45:46",
"remark": "您的快件在【杭州散货分拣中心】分拣完成"
},
-{
"datetime": "2024-06-25 11:45:38",
"remark": "您的快件已到达【杭州散货分拣中心】"
},
-{
"datetime": "2024-06-25 02:59:33",
"remark": "您的快件已发车"
},
-{
"datetime": "2024-06-24 23:31:48",
"remark": "您的快件由【南昌分拣中心】完成分拣,准备发往【杭州散货分拣中心】"
},
-{
"datetime": "2024-06-24 23:31:43",
"remark": "您的快件在【南昌分拣中心】分拣完成"
},
-{
"datetime": "2024-06-24 23:29:57",
"remark": "您的快件已到达【南昌分拣中心】"
},
-{
"datetime": "2024-06-24 19:35:12",
"remark": "您的快件已发车"
},
-{
"datetime": "2024-06-24 19:17:39",
"remark": "您的快件已离开【景德镇高新营业部】,正在发往【南昌分拣中心】"
},
-{
"datetime": "2024-06-24 17:07:39",
"remark": "您的快件已支付完成,正在为您安排骑手,请耐心等待"
},
-{
"datetime": "2024-06-24 16:55:24",
"remark": "您的快件已到达【景德镇高新营业部】"
},
-{
"datetime": "2024-06-24 13:38:02",
"remark": "您的快件已由【景德镇高新营业部】揽收完成"
},
-{
"datetime": "2024-06-24 13:38:01",
"remark": "京东快递 已收取快件"
},
-{
"datetime": "2024-06-24 13:25:43",
"remark": "揽收任务已分配给冯凯(联系电话:15727511162)。"
}
]
}
}