注意:非稳定接口!还在测试阶段!!!!!

1. 物流信息获取

URL

https://api.cocktail1024.top/api/transport

Method

get

参数

参数类型可以为空说明
nustring物流单号
comstring物流公司code

返回值

{
    "code": 0, // 0 为正常
    "message": "", // 错误信息
    "ttl": 1,
    "data": {
        "nu": "123",// 快递单号
        "company": {
            "com": "zhongtong", // 快递公司编号
            "full_name": "中通快递",
            "short_name": "中通",
            "logo": "", // logo url
            "url": "", // 官网地址
            "tel": "95311" // tel
        },
        "info": {
            "latest_progress": "2019-09-09 16:29:34 【广州市】 快件已在 【番禺新大石】 签收, 签收人: 速递易", // 最新消息
            "send_time": "2019-09-04 15:19:33", // 快递投递时间
            "state": "3", // 状态
            "detail": [
                {
                    "time": "1567605049",
                    "desc": "【广州市】 快件已在 【番禺新大石】 签收"
                }
            ]
        }
    }
}

state 说明

value说明
0已退
3签收

php example

<?php

$curl = curl_init();
$nu = "你的快递单号";
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.cocktail1024.top/api/transport?nu={$nu}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: */*",
    "Accept-Encoding: gzip, deflate",
    "Cache-Control: no-cache",
    "Connection: keep-alive",
    "Host: api.cocktail1024.top",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

2. 物流公司信息获取

URL

https://api.cocktail1024.top/api/transport/company

参数

返回值

{
    "code": 0,
    "message": "0",
    "ttl": 1,
    "data": [
        {
            "com": "ems",
            "full_name": "EMS"
        },
        {
            "com": "shentong",
            "full_name": "申通快递"
        },
        {
            "com": "yuantong",
            "full_name": "圆通速递"
        },
        {
            "com": "yunda",
            "full_name": "韵达速递"
        },
        {
            "com": "zhongtong",
            "full_name": "中通快递"
        },
        {
            "com": "tiantian",
            "full_name": "天天快递"
        },
        {
            "com": "huitongkuaidi",
            "full_name": "百世快递"
        },
        {
            "com": "zhaijisong",
            "full_name": "宅急送"
        },
        {
            "com": "quanfengkuaidi",
            "full_name": "全峰快递"
        },
        {
            "com": "debangwuliu",
            "full_name": "德邦快递"
        },
        {
            "com": "youzhengguonei",
            "full_name": "邮政包裹信件"
        },
        {
            "com": "ztky",
            "full_name": "中铁物流"
        },
        {
            "com": "aae",
            "full_name": "AAE全球专递"
        },
        {
            "com": "annengwuliu",
            "full_name": "安能物流"
        },
        {
            "com": "aramex",
            "full_name": "Aramex"
        },
        {
            "com": "baifudongfang",
            "full_name": "百福东方"
        },
        {
            "com": "bpost",
            "full_name": "比利时邮政"
        },
        {
            "com": "canpost",
            "full_name": "加拿大邮政"
        },
        {
            "com": "datianwuliu",
            "full_name": "大田物流"
        },
        {
            "com": "dhl",
            "full_name": "DHL中国件"
        },
        {
            "com": "dhlen",
            "full_name": "DHL全球件"
        },
        {
            "com": "emsguoji",
            "full_name": "EMS国际件"
        },
        {
            "com": "fanyukuaidi",
            "full_name": "凡宇快递"
        },
        {
            "com": "fedex",
            "full_name": "FedEx国际件"
        },
        {
            "com": "fedexcn",
            "full_name": "Fedex"
        },
        {
            "com": "fedexus",
            "full_name": "FedEx美国件"
        },
        {
            "com": "guotongkuaidi",
            "full_name": "国通快递"
        },
        {
            "com": "hengluwuliu",
            "full_name": "恒路物流"
        },
        {
            "com": "japanposten",
            "full_name": "日本邮政"
        },
        {
            "com": "jd",
            "full_name": "京东物流"
        },
        {
            "com": "jiajiwuliu",
            "full_name": "佳吉快运"
        },
        {
            "com": "jialidatong",
            "full_name": "嘉里大通"
        },
        {
            "com": "jiayiwuliu",
            "full_name": "佳怡物流"
        },
        {
            "com": "jiayunmeiwuliu",
            "full_name": "加运美"
        },
        {
            "com": "jinguangsudikuaijian",
            "full_name": "京广速递"
        },
        {
            "com": "kangliwuliu",
            "full_name": "康力物流"
        },
        {
            "com": "koreapost",
            "full_name": "韩国邮政"
        },
        {
            "com": "kuaijiesudi",
            "full_name": "快捷快递"
        },
        {
            "com": "kuayue",
            "full_name": "跨越速运"
        },
        {
            "com": "lianhaowuliu",
            "full_name": "联昊通"
        },
        {
            "com": "minbangsudi",
            "full_name": "民邦速递"
        },
        {
            "com": "minghangkuaidi",
            "full_name": "民航快递"
        },
        {
            "com": "mingliangwuliu",
            "full_name": "明亮物流"
        },
        {
            "com": "ocs",
            "full_name": "OCS"
        },
        {
            "com": "quanchenkuaidi",
            "full_name": "全晨快递"
        },
        {
            "com": "quanyikuaidi",
            "full_name": "全一快递"
        },
        {
            "com": "rrs",
            "full_name": "日日顺物流"
        },
        {
            "com": "rufengda",
            "full_name": "如风达"
        },
        {
            "com": "shenganwuliu",
            "full_name": "圣安物流"
        },
        {
            "com": "shenghuiwuliu",
            "full_name": "盛辉物流"
        },
        {
            "com": "suer",
            "full_name": "速尔快递"
        },
        {
            "com": "suijiawuliu",
            "full_name": "穗佳物流"
        },
        {
            "com": "tiandihuayu",
            "full_name": "天地华宇"
        },
        {
            "com": "tnt",
            "full_name": "TNT"
        },
        {
            "com": "ups",
            "full_name": "UPS"
        },
        {
            "com": "usps",
            "full_name": "USPS"
        },
        {
            "com": "vancl",
            "full_name": "凡客配送"
        },
        {
            "com": "wanxiangwuliu",
            "full_name": "万象物流"
        },
        {
            "com": "xinbangwuliu",
            "full_name": "新邦物流"
        },
        {
            "com": "xinfengwuliu",
            "full_name": "信丰物流"
        },
        {
            "com": "yinjiesudi",
            "full_name": "银捷速递"
        },
        {
            "com": "youshuwuliu",
            "full_name": "优速物流"
        },
        {
            "com": "ytkd",
            "full_name": "运通中港快递"
        },
        {
            "com": "yuanchengwuliu",
            "full_name": "远成物流"
        },
        {
            "com": "zengyisudi",
            "full_name": "增益速递"
        },
        {
            "com": "baishiwuliu",
            "full_name": "百世快运"
        }
    ]
}

PHP 代码

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.cocktail1024.top/api/transport/company",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: */*",
    "Accept-Encoding: gzip, deflate",
    "Cache-Control: no-cache",
    "Connection: keep-alive",
    "Host: api.cocktail1024.top",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}