商品分类
物流查询跟踪快递查询
拇指云物流快递API查询,智能获取快递物流跟踪信息,支持四通一达、京东等全国110多家快递公司物流跟踪信息查询。针对商户,电商等提供系统API对接自动、批量、快速获取物流信息并自动跟踪最新物流信息,避免多家物流公司需多个地方查询的烦恼。
价格
¥1

8人在使用

优质服务商家

7*8小时在线客服

专业测试保证品质

API文档

物流查询

调用地址:https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index

请求方式:GET

返回类型:JSON

API调用: API调用说明(secret_id & secret_key)

请求参数(Headers)

名称
类型
是否必须
描述
暂无数据

请求参数(Query)

名称
类型
是否必须
描述
kddh
string
快递单号
kdmc
string
快递名称

请求参数(Body)

名称
类型
是否必须
描述
暂无数据

请求示例

# -*- coding: utf-8 -*-
from __future__ import print_function

import ssl, hmac, base64, hashlib
from datetime import datetime as pydatetime

try:
    from urllib import urlencode
    from urllib2 import Request, urlopen
except ImportError:
    from urllib.parse import urlencode
    from urllib.request import Request, urlopen

# 云市场分配的密钥Id
secretId = "xxxx"
# 云市场分配的密钥Key
secretKey = "xxxx"
source = "market"

# 签名
datetime = pydatetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')
signStr = "x-date: %s\nx-source: %s" % (datetime, source)
sign = base64.b64encode(hmac.new(secretKey.encode('utf-8'), signStr.encode('utf-8'), hashlib.sha1).digest())
auth = 'hmac id="%s", algorithm="hmac-sha1", headers="x-date x-source", signature="%s"' % (secretId, sign.decode('utf-8'))

# 请求方法
method = 'GET'
# 请求头
headers = {
    'X-Source': source,
    'X-Date': datetime,
    'Authorization': auth,
}
# 查询参数
queryParams = {
    'kddh': '',
    'kdmc': ''}
# body参数(POST方法下存在)
bodyParams = {
}
# url参数拼接
url = 'https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index'
if len(queryParams.keys()) > 0:
    url = url + '?' + urlencode(queryParams)

request = Request(url, headers=headers)
request.get_method = lambda: method
if method in ('POST', 'PUT', 'PATCH'):
    request.data = urlencode(bodyParams).encode('utf-8')
    request.add_header('Content-Type', 'application/x-www-form-urlencoded')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urlopen(request, context=ctx)
content = response.read()
if content:
    print(content.decode('utf-8'))
curl -v -X GET https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index ?kddh=&kdmc=-H 'Host:service-ajyhisx8-1251498974.gz.apigw.tencentcs.com' -H 'Source:source' -H 'Date:Mon, 19 Mar 2018 12:08:40 GMT' -H 'Authorization:hmac id = "AKIDi6qE41WgJ9w8h4h9zq68Vq24d1beIuN0qIwU", algorithm = "hmac-sha1", headers = "date source", signature = yMCxXNytW5nvVGNZ8aBtRxmiLJ4=' -H 'X-Requested-With:XMLHttpRequest' 
//请用云市场分配给您的密钥计算签名并放入请求头,Date为当前的GMT时间
<?php
// 云市场分配的密钥Id
$secretId = 'xxxx';
// 云市场分配的密钥Key
$secretKey = 'xxxx';
$source = 'market';

// 签名
$datetime = gmdate('D, d M Y H:i:s T');
$signStr = sprintf("x-date: %s\nx-source: %s", $datetime, $source);
$sign = base64_encode(hash_hmac('sha1', $signStr, $secretKey, true));
$auth = sprintf('hmac id="%s", algorithm="hmac-sha1", headers="x-date x-source", signature="%s"', $secretId, $sign);

// 请求方法
$method = 'GET';
// 请求头
$headers = array(
    'X-Source' => $source,
    'X-Date' => $datetime,
    'Authorization' => $auth,
);
// 查询参数
$queryParams = array (
    'kddh' => '',
    'kdmc' => '',
);
// body参数(POST方法下)
$bodyParams = array (
);
// url参数拼接
$url = 'https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index';
if (count($queryParams) > 0) {
    $url .= '?' . http_build_query($queryParams);
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, array_map(function ($v, $k) {
    return $k . ': ' . $v;
}, array_values($headers), array_keys($headers)));
if (in_array($method, array('POST', 'PUT', 'PATCH'), true)) {
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($bodyParams));
}

$data = curl_exec($ch);
if (curl_errno($ch)) {
    echo "Error: " . curl_error($ch);
} else {
    print_r($data);
}
curl_close($ch);
/**
 * npm install crypto-js request
 */
var CryptoJS = require("crypto-js");
var request = require('request');
var querystring = require('querystring');

// 云市场分配的密钥Id
var secretId = "xxx";
// 云市场分配的密钥Key
var secretKey = "xxx";
var source = "market";

// 签名
var datetime = (new Date()).toGMTString();
var signStr = "x-date: " + datetime + "\n" + "x-source: " + source;
var sign = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(signStr, secretKey))
var auth = 'hmac id="' + secretId + '", algorithm="hmac-sha1", headers="x-date x-source", signature="' + sign + '"';

// 请求方法
var method = 'GET';
// 请求头
var headers = {
    "X-Source": source,
    "X-Date": datetime,
    "Authorization": auth,
}
// 查询参数
var queryParams = {
    'kddh': '',
    'kdmc': ''}
// body参数(POST方法下)
var bodyParams = {
}
// url参数拼接
var url = 'https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index';
if (Object.keys(queryParams).length > 0) {
    url += '?' + querystring.stringify(queryParams);
}

var options = {
    url: url,
    timeout: 5000,
    method: method,
    headers: headers
}
if (['POST', 'PUT', 'PATCH'].indexOf(method) != -1) {
    options['body'] = querystring.stringify(bodyParams);
    options['headers']['Content-Type'] = "application/x-www-form-urlencoded";
}

request(options, function (error, response, body) {
    if (error !== null) {
        console.log('error:', error);
        return;
    }
    console.log(body);
});
package main

import (
    "crypto/hmac"
    "crypto/sha1"
    "encoding/base64"
    "fmt"
    "io"
    "io/ioutil"
    "net/http"
    gourl "net/url"
    "strings"
    "time"
)

func calcAuthorization(source string, secretId string, secretKey string) (auth string, datetime string, err error) {
    timeLocation, _ := time.LoadLocation("Etc/GMT")
    datetime = time.Now().In(timeLocation).Format("Mon, 02 Jan 2006 15:04:05 GMT")
    signStr := fmt.Sprintf("x-date: %s\nx-source: %s", datetime, source)

    // hmac-sha1
    mac := hmac.New(sha1.New, []byte(secretKey))
    mac.Write([]byte(signStr))
    sign := base64.StdEncoding.EncodeToString(mac.Sum(nil))

    auth = fmt.Sprintf("hmac id=\"%s\", algorithm=\"hmac-sha1\", headers=\"x-date x-source\", signature=\"%s\"",
        secretId, sign)

    return auth, datetime, nil
}

func urlencode(params map[string]string) string {
    var p = gourl.Values{}
    for k, v := range params {
        p.Add(k, v)
    }
    return p.Encode()
}

func main() {
    // 云市场分配的密钥Id
    secretId := "xxxx"
    // 云市场分配的密钥Key
    secretKey := "xxxx"
    source := "market"

    // 签名
    auth, datetime, _ := calcAuthorization(source, secretId, secretKey)

    // 请求方法
    method := "GET"
    // 请求头
    headers := map[string]string{"X-Source": source, "X-Date": datetime, "Authorization": auth}

    // 查询参数
    queryParams := make(map[string]string)
    queryParams["kddh"] = ""
    queryParams["kdmc"] = ""
    // body参数
    bodyParams := make(map[string]string)

    // url参数拼接
    url := "https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index"
    if len(queryParams) > 0 {
        url = fmt.Sprintf("%s?%s", url, urlencode(queryParams))
    }

    bodyMethods := map[string]bool{"POST": true, "PUT": true, "PATCH": true}
    var body io.Reader = nil
    if bodyMethods[method] {
        body = strings.NewReader(urlencode(bodyParams))
        headers["Content-Type"] = "application/x-www-form-urlencoded"
    }

    client := &http.Client{
        Timeout: 5 * time.Second,
    }
    request, err := http.NewRequest(method, url, body)
    if err != nil {
        panic(err)
    }
    for k, v := range headers {
        request.Header.Set(k, v)
    }
    response, err := client.Do(request)
    if err != nil {
        panic(err)
    }
    defer response.Body.Close()

    bodyBytes, err := ioutil.ReadAll(response.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println(string(bodyBytes))
}
using System.IO;
using System.Text;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System;


public class CsharpTest
{
    public static String HMACSHA1Text(String EncryptText, String EncryptKey)
    {
            HMACSHA1 hmacsha1 = new HMACSHA1();
            hmacsha1.Key = System.Text.Encoding.UTF8.GetBytes(EncryptKey);

            byte[] dataBuffer = System.Text.Encoding.UTF8.GetBytes(EncryptText);
            byte[] hashBytes = hmacsha1.ComputeHash(dataBuffer);
            return Convert.ToBase64String(hashBytes);
    }

    public static void Main(String[] args)
    {
        String url = "https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index";
        String method = "GET";
        String querys = "kddh=&kdmc=";
        String source = "market";

        //云市场分配的密钥Id
        String  secretId = "xxx";
        //云市场分配的密钥Key
        String  secretKey = "xxx";

        String dt = DateTime.UtcNow.GetDateTimeFormats('r')[0];
        url = url + "?" + querys;

        String signStr = "x-date: " + dt + "\n" + "x-source: " + source;
        String sign = HMACSHA1Text(signStr, secretKey);

        String auth = "hmac id=\"" + secretId + "\", algorithm=\"hmac-sha1\", headers=\"x-date x-source\", signature=\"";
        auth = auth + sign + "\"";
        Console.WriteLine(auth + "\n");

        HttpWebRequest httpRequest = null;
        HttpWebResponse httpResponse = null;

        if (url.Contains("https://"))
        {
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
            httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
        }
        else
        {
            httpRequest = (HttpWebRequest)WebRequest.Create(url);
        }

        httpRequest.Method = method;
        httpRequest.Headers.Add("Authorization", auth);
        httpRequest.Headers.Add("X-Source", source);
        httpRequest.Headers.Add("X-Date", dt);

        try
        {
            httpResponse = (HttpWebResponse)httpRequest.GetResponse();
        }
        catch (WebException ex)
        {
            httpResponse = (HttpWebResponse)ex.Response;
        }

        Console.WriteLine(httpResponse.StatusCode);
        Console.WriteLine(httpResponse.Headers);
        Stream st = httpResponse.GetResponseStream();
        StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
        Console.WriteLine(reader.ReadToEnd());
        Console.WriteLine("\n");

    }

    public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
    {
        return true;
    }
}
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

import sun.misc.BASE64Encoder;


class Demo {
    public static String calcAuthorization(String source, String secretId, String secretKey, String datetime)
            throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException {
        String signStr = "x-date: " + datetime + "\n" + "x-source: " + source;
        Mac mac = Mac.getInstance("HmacSHA1");
        Key sKey = new SecretKeySpec(secretKey.getBytes("UTF-8"), mac.getAlgorithm());
        mac.init(sKey);
        byte[] hash = mac.doFinal(signStr.getBytes("UTF-8"));
        String sig = new BASE64Encoder().encode(hash);

        String auth = "hmac id=\"" + secretId + "\", algorithm=\"hmac-sha1\", headers=\"x-date x-source\", signature=\"" + sig + "\"";
        return auth;
    }

    public static String urlencode(Map<?, ?> map) throws UnsupportedEncodingException {
        StringBuilder sb = new StringBuilder();
        for (Map.Entry<?, ?> entry : map.entrySet()) {
            if (sb.length() > 0) {
                sb.append("&");
            }
            sb.append(String.format("%s=%s",
                    URLEncoder.encode(entry.getKey().toString(), "UTF-8"),
                    URLEncoder.encode(entry.getValue().toString(), "UTF-8")
            ));
        }
        return sb.toString();
    }

    public static void main(String[] args) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException {
        //云市场分配的密钥Id
        String secretId = "xxxx";
        //云市场分配的密钥Key
        String secretKey = "xxxx";
        String source = "market";

        Calendar cd = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.US);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        String datetime = sdf.format(cd.getTime());
        // 签名
        String auth = calcAuthorization(source, secretId, secretKey, datetime);
        // 请求方法
        String method = "GET";
        // 请求头
        Map<String, String> headers = new HashMap<String, String>();
        headers.put("X-Source", source);
        headers.put("X-Date", datetime);
        headers.put("Authorization", auth);

        // 查询参数
        Map<String, String> queryParams = new HashMap<String, String>();
        queryParams.put("kddh", "");
        queryParams.put("kdmc", "");
        // body参数
        Map<String, String> bodyParams = new HashMap<String, String>();

        // url参数拼接
        String url = "https://service-ajyhisx8-1251498974.gz.apigw.tencentcs.com/release/tx/index";
        if (!queryParams.isEmpty()) {
            url += "?" + urlencode(queryParams);
        }

        BufferedReader in = null;
        try {
            URL realUrl = new URL(url);
            HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
            conn.setConnectTimeout(5000);
            conn.setReadTimeout(5000);
            conn.setRequestMethod(method);

            // request headers
            for (Map.Entry<String, String> entry : headers.entrySet()) {
                conn.setRequestProperty(entry.getKey(), entry.getValue());
            }

            // request body
            Map<String, Boolean> methods = new HashMap<>();
            methods.put("POST", true);
            methods.put("PUT", true);
            methods.put("PATCH", true);
            Boolean hasBody = methods.get(method);
            if (hasBody != null) {
                conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

                conn.setDoOutput(true);
                DataOutputStream out = new DataOutputStream(conn.getOutputStream());
                out.writeBytes(urlencode(bodyParams));
                out.flush();
                out.close();
            }

            // 定义 BufferedReader输入流来读取URL的响应
            in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String line;
            String result = "";
            while ((line = in.readLine()) != null) {
                result += line;
            }

            System.out.println(result);
        } catch (Exception e) {
            System.out.println(e);
            e.printStackTrace();
        } finally {
            try {
                if (in != null) {
                    in.close();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }
}

正常返回示例

                                                                    {
  "kddh": "3101533515446",
  "kdmc": "韵达快递",
  "kddm": "yunda",
  "message": "查询成功",
  "errcode": "1",
  "status": 4,
  "data": [
    {
      "time": "2017-11-23 10:38:14",
      "content": "浙江温州龙湾区东站公司 已揽件"
    },
    {
      "time": "2017-11-23 11:40:33",
      "content": "浙江温州龙湾区东站公司 发往:山东济南网点包"
    },
    {
      "time": "2017-11-23 20:00:15",
      "content": "浙江温州分拨中心"
    },
    {
      "time": "2017-11-23 20:04:59",
      "content": "浙江温州分拨中心 发往:山东济南分拨中心"
    },
    {
      "time": "2017-11-24 17:20:49",
      "content": "山东济南分拨中心 上级站点:浙江温州分拨中心"
    },
    {
      "time": "2017-11-24 18:31:39",
      "content": "山东济南分拨中心 发往:山东济阳县公司"
    },
    {
      "time": "2017-11-25 08:09:32",
      "content": "山东济阳县公司 上级站点:山东济南分拨中心 发往:"
    },
    {
      "time": "2017-11-25 08:30:49",
      "content": "山东济阳县公司  派送"
    },
    {
      "time": "2017-11-25 13:17:18",
      "content": "山东济阳县公司  派送"
    },
    {
      "time": "2017-11-25 13:21:52",
      "content": "山东济阳县公司 由 本人 签收"
    }
  ]
}
                                                                

失败返回示例

                                                                    {
  "errcode": "10",
  "message": "kddh,kdmc参数不能为空"
}
                                                                

返回码定义

返回码
返回信息
描述
10
传入参数不能为空,请检查参数
41
有多个快递公司,无法确认哪个

商品介绍

支持物流公司
AAE快递通成物流
安信达快递UPS国际快递
安捷快递优速快递
新蛋物流伟邦快递
百福东方微特派快递
包裹、平邮、挂号信万象物流
传喜物流信丰物流
程光快递新邦物流
东方快递圆通快递
长通物流韵达快递
城市之星物流一邦快递
城市100快递运通快递
传志快递元智捷诚快递
德邦物流原飞航快递
DHL快递亚风快递
DPEX快递远成物流
递四方速递越丰快递
大田物流中通快递
大洋物流宅急送快递
D速快递中铁快运
EMS快递中邮物流
FEDEX国际快递芝麻开门
FEDEX国内快递郑州建华快递
飞康达快递中天万运快递
飞邦物流京东快递
飞豹快递增益快递
飞狐快递城际快递
共速达物流速通物流
国通快递冠达快递
港中能达华企快递
天地华宇安能物流
汇通快递布谷鸟快递
天天快递尼尔物流
恒路物流凡宇快递
汇强快递世运快递
华夏龙物流日日顺物流
昊盛物流蓝狐快递
嘉里大通物流大达物流
佳怡物流源安达快递
佳吉快运宇鑫物流
加运美快递宽容物流
京广快递飞洋快递
晋越快递广东ems快递
快捷快递万博快递
康力物流美龙快递
龙邦快递广通速递
联昊通快递丰达快递
乐捷递快递祥龙运通
立即送国际包裹
民邦快递易通达
民航快递高铁速递
美国快递苏宁快递
OCS快递Aramex
平安达快递超峰快递
全峰快递方方达物流
全一快递飞鹰物流
全晨快递捷特快递
全日通快递锦程快递
如风达快递科捷物流
申通快递跨越速运
顺丰快递立通快递
速尔快递新杰物流
山东海红快递远成快运
三态速递中环快递
盛辉物流邮政小包
盛丰物流挂号信
圣安物流安得物流
赛澳递ewe快递
TNT快递壹米滴答物流
通和天下物流 

 

 

返回结果统一JSON格式字符串,参数结果如下:

返回参数名

描述

errcode

错误代码,1表示成功,其它均为失败,错误代码见错误代码表

Kddh

查询的快递单号(顺丰必须加上/发件人手机号码的后四位,格式为:kddh=顺丰单号_XXXX

Kddm

快递代码

message

结果描述

Status

快递状态,见单号状态表

data

快递跟踪结果列表

time

记录时间、每条跟踪信息的时间

content

具体内容、每条跟踪信息的描述,如到达某某地区等等

快递单号状态表

编码

描述

-1

待查询、在批量查询中才会出现的状态,指提交后还没有进行任何更新的单号

0

查询异常

1

暂无记录、单号没有任何跟踪记录

2

在途中

3

派送中

4

已签收

5

拒收、用户拒签

6

疑难件、以为某些原因无法进行派送

7

无效单

8

超时单

9

签收失败

错误代码

代码

描述

1

查询成功

10

传入参数不能为空,请检查参数

20

传入时间戳格式不对

21

传入时间戳已失效

30

Sign参数不匹配

40

无效用户KEY

41

有多个快递公司,无法确认哪个

42

查无此快递公司信息

43

未找到对应的快递代码

80

当天购买次数已用完

90

查询异常

92

顺丰需传/发件人手机号码的后四位,格式为:kddh=顺丰单号_XXXX

填写顺丰/发件人手机号码必须是后四位

填写顺丰的非/发件人手机号码的后四位

返回示例值

{
  "kddh": "310153351****",
  "kdmc": "韵达快递",
  "kddm": "yunda",
  "message": "查询成功",
  "errcode": "1",
  "status": 4,
  "data": [
    {
      "time": "2017-11-23 10:38:14",
      "content": "福建XXX公司 已揽件"
    },
    {
      "time": "2017-11-23 11:40:33",
      "content": "福建XXX公司 发往:福建XXX网点包"
    },
    {
      "time": "2017-11-23 20:00:15",
      "content": "福建厦门分拨中心"
    },
    {
      "time": "2017-11-23 20:04:59",
      "content": "福建厦门分拨中心 发往:山东济南分拨中心"
    },
    {
      "time": "2017-11-24 17:20:49",
      "content": "山东济南分拨中心 上级站点:浙江温州分拨中心"
    },
    {
      "time": "2017-11-24 18:31:39",
      "content": "山东济南分拨中心 发往:山东济阳县公司"
    },
    {
      "time": "2017-11-25 08:09:32",
      "content": "山东济阳县公司 上级站点:山东济南分拨中心 发往:"
    },
    {
      "time": "2017-11-25 08:30:49",
      "content": "山东XXX公司 派送"
    },
    {
      "time": "2017-11-25 13:17:18",
      "content": "山东XXX公司 派送"
    },
    {
      "time": "2017-11-25 13:21:52",
      "content": "山东XXX公司 由 本人 签收"
    }
  ]
}

使用指南

1购买完成后,点击进入控制台

2在控制台点击”管理“查看详情”

3获得API的SecretID和SecretKey后,即可按照商品介绍里的方式调用API

累计评价(0)

为保障您的权益,请勿线下交易!90%的欺诈、纠纷、资金盗窃均由线下交易导致。腾讯云市场为您提供以下服务保障:

优质服务商家

严格准入 提供海量上云服务

7*8小时在线客服

全程在线咨询 助您安心购物

专业测试保证品质

安全监测 保障商品质量

退款售后无忧

不满意可退款 保障售后无忧

卖家服务时间

为保障您的权益,请勿线下交易!90%的欺诈、纠纷、资金盗窃均由线下交易导致。