跳转到内容
返回官网

快递单号识别

根据传入的快递单号判断单号所归属的快递公司; 注意:【由于快递公司单号规则不统一,且不断变化,会存在无法识别的情况,该接口命中率为95-97%左右】

一、请求参数

请求URL:

POST https://kf.fw199.com/gateway/logistics/num/recognition

参数名称参数类型是否必须示例值参数描述
appidString合作伙伴AppId
timestampString1657525936当前Unix时间戳,秒
numString38173182要识别的快递单号,支持市场上主流快递公司的单号
signString

二、请求示例代码

Java

@Test
public void LogisticsNumRecognition() throws Exception {
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("num", "9791392354758");
// 参数签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
doHttpRequest(Config.LOGISTICS_NUM_RECOGNITION,data);
}

三、返回结果

返回结果如下

{
"code": 0,
"message": "ok",
"data": [
{ "lengthPre": 13, "comCode": "youzhengguonei", "name": "邮政快递包裹" },
{ "lengthPre": 13, "comCode": "ems", "name": "EMS" }
],
"trace_id": ""
}

返回code为0表示成功, 非0为失败,失败时message会有失败原因。data包括返回的快递公司代码(comCode)和名称(name)。

注意: 由于运单号规则不断变化且各个快递公司没有标准、统一的规则,所以无法保证判断准确率能达到100%。建议在使用时,提示“提示“本结果仅供参考”等文字说明”。