如商城添加快递跟踪信息

图片描述公司的商城需要添加快递信息,根据快递单号查询快递信息,并显现在页面上改如何实现!!需要运用到哪方面的知识,或者用哪里的技术

阅读 6.3k
8 个回答

找个快递信息api,和他做接口,把你需要的信息返回

我之前做过抓取快递100的数据

首先,你们先要有一套快递查询的后台子系统,然后是和传递查询提供商或快递公司保持良好合作关系
因为数据不是你们的,所以有时候花点小钱也是值得的

新手上路,请多包涵

如果想要样式好看,比如类似天猫那样的,那就可以抓快递一百的手机端的数据,然后自己组装

可以用快递鸟的API,给你一份Java的DEMO:https://github.com/wucao/common-api

快递鸟官方网站:http://www.kdniao.com/

接口文档:http://www.kdniao.com/YundanChaxunAPI.aspx

免费使用,每天不超过3000次,需要注册后才可以使用。快递公司编码:http://www.kdniao.com/file/ExpressCode.xls

使用:

KdniaoService kdniaoService = new KdniaoService();
kdniaoService.setApiId("API ID"); // API ID(商户ID)
kdniaoService.setApiKey("API Key"); // API Key
List<KdniaoTrace> list = kdniaoService.getTrace("YTO", "700192858115"); // 快递公司编码、快递单号
for(KdniaoTrace trace : list) {
    System.out.println(trace.getTime() + " | " + trace.getMessage());
}

输出:

2016-05-24 19:15:08 | 【广东省广州市白云区罗冲围公司】 取件人: 张定 已收件
2016-05-24 20:15:35 | 【广东省广州市白云区罗冲围公司】 已收件
2016-05-24 23:07:52 | 【广州转运中心】 已收入
2016-05-24 23:13:35 | 【广州转运中心】 已发出 下一站 【上海转运中心】
2016-05-26 02:18:40 | 【上海转运中心】 已收入
2016-05-26 04:33:15 | 【上海转运中心】 已发出 下一站 【上海市闵行区虹桥公司】
2016-05-26 07:37:59 | 【上海市闵行区虹桥公司】 已收入
2016-05-26 07:38:03 | 【上海市闵行区虹桥公司】 派件人: 朱照耀 派件中 派件员电话18321539302
2016-05-26 11:55:09 | 客户 签收人: 邮件收发章 已签收 感谢使用圆通速递,期待再次为您服务
新手上路,请多包涵

可以用Trackingmore的API,接口文档:https://www.trackingmore.com/...

包含实时查询API和非实时查询API。

使用:

tracking_number": "734931338996",
"carrier_code": "fedex",
"status": "undelivered",
"original_country": "Hong Kong [CN]",
"destination_country": "Brazil",
"itemTimeLength": 22,
"origin_info":{
"weblink": "http://www.fedex.com/",
"phone": null,
"carrier_code": "fedex",
"trackinfo":[
{"Date": "2017-07-11 09:23:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-10 09:49:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-07 08:37:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-06 11:33:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-05 09:11:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-04 08:08:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-03 21:55:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-07-03 11:56:00", "StatusDescription": "Delivery exception,Held, unable to collect payment", "Details": "SUMARE BR"…},
{"Date": "2017-07-03 09:14:00", "StatusDescription": "On FedEx vehicle for delivery", "Details": "SUMARE BR"…},
{"Date": "2017-07-03 06:50:00", "StatusDescription": "At local FedEx facility", "Details": "SUMARE BR"…},
{"Date": "2017-06-30 20:21:00", "StatusDescription": "In transit", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-30 19:31:00", "StatusDescription": "International shipment release - Import", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-30 19:18:00", "StatusDescription": "In transit,Package available for clearance", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-30 04:45:00", "StatusDescription": "Departed FedEx location", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-30 03:58:00", "StatusDescription": "In transit", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-30 03:11:00", "StatusDescription": "In transit", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-30 03:11:00", "StatusDescription": "In transit", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-29 23:46:00", "StatusDescription": "Arrived at FedEx location", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-29 16:23:00", "StatusDescription": "At destination sort facility", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-29 11:54:00", "StatusDescription": "International shipment release - Import", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-29 11:54:00", "StatusDescription": "In transit", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-29 09:44:00", "StatusDescription": "In transit", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-28 20:24:00", "StatusDescription": "In transit,Package available for clearance", "Details": "CAMPINAS BR"…},
{"Date": "2017-06-27 02:50:00", "StatusDescription": "In transit", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-27 02:50:00", "StatusDescription": "In transit", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-23 23:41:00", "StatusDescription": "Arrived at FedEx location", "Details": "MEMPHIS, TN"…},
{"Date": "2017-06-23 21:58:00", "StatusDescription": "In transit", "Details": "LANTAU ISLAND HK"…},
{"Date": "2017-06-23 17:55:00", "StatusDescription": "Left FedEx origin facility", "Details": "YUEN LONG HK"…},
{"Date": "2017-06-23 12:01:00", "StatusDescription": "Picked up", "Details": "YUEN LONG HK"…},
{"Date": "2017-06-21 03:42:17", "StatusDescription": "Shipment information sent to FedEx", "Details": ""…}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏