聚合国内外1500家快递公司的物流信息查询服务,使用API接口查询UPS快递的便捷步骤,首先选择专业的数据平台的快递API接口:https://www.tanshuapi.com/market/detail-68
以下示例是参考的示例代码:
import requests
url = "http://api.tanshuapi.com/api/exp/v1/index?key=key&com=ups&no=272379635270&phone="
payload={}
headers = {
'User-Agent': 'Apifox/1.0.0'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
请求结果展示:
{
"code": 1,
"msg": "操作成功",
"data": {
"company": "ups",
"com": "ups",
"no": "272379635270",
"com_phone": "400-886-1888",
"com_url": "https://www.fedex.com/zh-cn/",
"take_time": "5天16小时21分",
"courier_phone": "",
"status_desc": "已签收",
"status_detail": 4,
"list": [
{
"datetime": "2024-03-25 12:56:00",
"remark": "[WASHINGTON, NJ]已送达"
},
{
"datetime": "2024-03-25 08:39:00",
"remark": "[BUDD LAKE, NJ]已装上 FedEx 车辆等待递送"
},
{
"datetime": "2024-03-25 08:16:00",
"remark": "[BUDD LAKE, NJ]抵达当地 FedEx 服务站"
},
{
"datetime": "2024-03-25 03:57:00",
"remark": "[NEWARK, NJ]离开FedEx集散中心"
},
{
"datetime": "2024-03-23 12:54:00",
"remark": "[MEMPHIS, TN]国际货物放行 - 进口"
},
{
"datetime": "2024-03-23 12:54:00",
"remark": "[SENNAN-SHI]途中"
},
{
"datetime": "2024-03-23 12:50:00",
"remark": "[SENNAN-SHI]途中"
},
{
"datetime": "2024-03-23 10:54:00",
"remark": "[MEMPHIS, TN]到达FedEx集散中心"
},
{
"datetime": "2024-03-23 05:12:00",
"remark": "[SENNAN-SHI]途中"
},
{
"datetime": "2024-03-22 21:55:00",
"remark": "[SHANGHAI]途中"
},
{
"datetime": "2024-03-22 21:20:00",
"remark": "[SHANGHAI]本地 延误 (延误超出了我们的控制)"
},
{
"datetime": "2024-03-22 20:29:00",
"remark": "[SHANGHAI]途中"
},
{
"datetime": "2024-03-22 20:28:00",
"remark": "[SHANGHAI]国际货物放行 - 出口"
},
{
"datetime": "2024-03-22 15:07:00",
"remark": "[SHANGHAI]途中"
},
{
"datetime": "2024-03-22 15:07:00",
"remark": "[SHANGHAI]国际货物放行 - 出口"
},
{
"datetime": "2024-03-21 22:22:00",
"remark": "[NANTONG]已离开 FedEx 始发地服务站"
},
{
"datetime": "2024-03-21 18:45:00",
"remark": "[NANTONG]已收取 (FedEx 截止时间过后收到包裹)"
},
{
"datetime": "2024-03-19 20:34:25",
"remark": "货件信息已发送给 FedEx"
}
]
}
}
这次的分享到这里就结束了,祝各位看官生活愉快,工作顺利!