PHPackages                             wythe/logistics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wythe/logistics

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wythe/logistics
===============

查询快递物流信息

1.0.5(3y ago)3041.6k32[1 issues](https://github.com/uuk020/logistics/issues)1MITPHPPHP &gt;=7.0CI failing

Since Jan 7Pushed 3y ago10 watchersCompare

[ Source](https://github.com/uuk020/logistics)[ Packagist](https://packagist.org/packages/wythe/logistics)[ RSS](/packages/wythe-logistics/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (16)Used By (1)

 Logistics
===========

[](#-logistics-)

简单便捷查询运单快递信息

[![Build Status](https://camo.githubusercontent.com/ec5d72a04177e2ba5c2ee566f4b2f58148e67242bbc8b2362e4db48d86735bc6/68747470733a2f2f7472617669732d63692e6f72672f75756b3032302f6c6f676973746963732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/uuk020/logistics)[![StyleCI build status](https://camo.githubusercontent.com/07eaf5c2a81fc0cb39be96fa71d07de6979a6bcc710a3d8f10f3bff61af478d2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136333038353639352f736869656c64)](https://camo.githubusercontent.com/07eaf5c2a81fc0cb39be96fa71d07de6979a6bcc710a3d8f10f3bff61af478d2/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136333038353639352f736869656c64)[![Latest Stable Version](https://camo.githubusercontent.com/e8f9e85891c7b431e55eaad69d6b5d6db54bb3ed05b60170def6aec1482f15a3/68747470733a2f2f706f7365722e707567782e6f72672f77797468652f6c6f676973746963732f762f737461626c65)](https://packagist.org/packages/wythe/logistics)[![Total Downloads](https://camo.githubusercontent.com/6ec0a41120dae92d1656213269e902c231df38ad1678606fad1977f91183c02a/68747470733a2f2f706f7365722e707567782e6f72672f77797468652f6c6f676973746963732f646f776e6c6f616473)](https://packagist.org/packages/wythe/logistics)[![Latest Unstable Version](https://camo.githubusercontent.com/5b31a37248ea4ea1a5714d02a456483759e10cb96415e67d9da03fe68f051f27/68747470733a2f2f706f7365722e707567782e6f72672f77797468652f6c6f676973746963732f762f756e737461626c65)](https://packagist.org/packages/wythe/logistics)[![License](https://camo.githubusercontent.com/619fa65db06a2d9c11778b29dc754b8cd28c1ab40f7b07110c2024dc0bb53f09/68747470733a2f2f706f7365722e707567782e6f72672f77797468652f6c6f676973746963732f6c6963656e7365)](https://packagist.org/packages/wythe/logistics)

### 支持查询接口平台

[](#支持查询接口平台)

平台次数是否需要快递公司编码免费版支持的快递公司[快递100](https://www.kuaidi100.com/openapi/applyapi.shtml)100次(首次申请)Y[快递鸟](http://www.kdniao.com/api-all)500单/天(免费)Y支持申通、圆通、百世、天天，其他快递公司可自行尝试，不支持顺丰[聚合数据](https://www.juhe.cn/docs/api/id/43)100次(首次申请)Y[极速数据](https://www.jisuapi.com/api/express)1000次(免费)N[数据智汇](http://www.shujuzhihui.cn/apiDetails?id=1867)100次(免费)N### 配置须知

[](#配置须知)

- 只有快递鸟申请后会有两个,一个是用户ID, 填入到app\_secret,另外一个则是api\_key, 填入app\_key, 其他则把申请的key填入到app\_key

### 环境需求

[](#环境需求)

- PHP &gt;= 7.0

### 安装

[](#安装)

```
$ composer require wythe/logistics -vvv
```

### 使用

[](#使用)

```
use Wythe\Logistics\Logistics;
$config = [
    'juhe' => ['app_key' => 'app_key', 'vip' => false],
    'shujuzhihui' => ['app_key' => 'app_key', 'vip' => false],
    'jisu' => ['app_key' => 'app_key', 'vip' => false],
    'kuaidibird' => ['app_key' => 'app_key', 'app_secret' =>  'app_secret', 'vip' =>
            false],
    'kuaidi100' => ['app_key' => '']
];
$logistics = new Logistics($config);
```

### 参数说明

[](#参数说明)

```
array query(string $code, $channels = ['kuaidi100'], string $company = '')
array queryByProxy(array $proxy, string $code, $channels = ['kuaidi100'], string $company = '')

```

- query 与 queryByProxy 返回数组结构是一样, 只是多了一个参数代理IP
- $proxy - 代理地址 结构: \['proxy' =&gt; '代理IP:代理端口'\]
- $code - 运单号
- $channel - 渠道名称, 可选参数,默认快递鸟.
- $company - 快递公司 具体看 SupportLogistics 文件

### 快递 100 接口获取物流信息 所有接口返回格式是统一

[](#快递-100-接口获取物流信息-所有接口返回格式是统一)

```
use Wythe\Logistics\Logistics;
$config = [
    'juhe' => ['app_key' => 'app_key', 'vip' => false],
    'shujuzhihui' => ['app_key' => 'app_key', 'vip' => false],
    'jisu' => ['app_key' => 'app_key', 'vip' => false],
    'kuaidibird' => ['app_key' => 'app_key', 'app_secret' =>  'app_secret', 'vip' =>
            false],
    'kuaidi100' => ['app_key' => '']
];
$logistics = new Logistics($config);
$logistics->query('12313131231', ''); // 第二参数选填,可以为字符串或数组, 默认快递鸟
$logistics->query('12313131231', 'kuaidi100');
$logistics->query('12313131231', ['kuaidi100']);
```

示例:

```
[
   'kuaidi100' => [
       'channel' => 'kuaidi100',
       'status' => 'success',
       'result' => [
           [
               'status' => 200,
               'message'  => 'OK',
               'error_code' => 0,
               'data' => [
                   ['time' => '2019-01-09 12:11', 'description' => '仓库-已签收'],
                   ['time' => '2019-01-07 12:11', 'description' => '广东XX服务点'],
                   ['time' => '2019-01-06 12:11', 'description' => '广东XX转运中心']
               ],
               'logistics_company' => '申通快递',
               'logistics_bill_no' => '12312211'
           ],
           [
               'status' => 201,
               'message' => '快递公司参数异常：单号不存在或者已经过期',
               'error_code' => 0,
               'data' => '',
               'logistics_company' => '',
               'logistics_bill_no' => ''
           ]
       ]
   ]
]
```

### 多接口获取物流信息

[](#多接口获取物流信息)

```
use Wythe\Logistics\Logistics;
$config = [
    'juhe' => ['app_key' => 'app_key', 'vip' => false],
    'shujuzhihui' => ['app_key' => 'app_key', 'vip' => false],
    'jisu' => ['app_key' => 'app_key', 'vip' => false],
    'kuaidibird' => ['app_key' => 'app_key', 'app_secret' =>  'app_secret', 'vip' =>
            false],
    'kuaidi100' => ['app_key' => '']
];
$logistics = new Logistics($config);
$logistics->query('12313131231');
$logistics->query('12313131231', ['kuaidi100', 'ickd']);
```

示例:

```
[
   'kuaidi100' => [
       'channel' => 'kuaidi100',
       'status' => 'success',
       'result' => [
           [
               'status' => 200,
               'message'  => 'OK',
               'error_code' => 0,
               'data' => [
                   ['time' => '2019-01-09 12:11', 'description' => '仓库-已签收'],
                   ['time' => '2019-01-07 12:11', 'description' => '广东XX服务点'],
                   ['time' => '2019-01-06 12:11', 'description' => '广东XX转运中心']
               ],
               'logistics_company' => '申通快递',
               'logistics_bill_no' => '12312211'
           ],
           [
               'status' => 201,
               'message' => '快递公司参数异常：单号不存在或者已经过期',
               'error_code' => 0,
               'data' => '',
               'logistics_company' => '',
               'logistics_bill_no' => ''
           ]
       ]
   ],
   'ickd' => [
       'channel' => 'ickd',
       'status' => 'success',
       'result' => [
           [
               'status' => 200,
               'message'  => 'OK',
               'error_code' => 0,
                'data' => [
                    ['time' => '2019-01-09 12:11', 'description' => '仓库-已签收'],
                    ['time' => '2019-01-07 12:11', 'description' => '广东XX服务点'],
                    ['time' => '2019-01-06 12:11', 'description' => '广东XX转运中心']
                ],
                'logistics_company' => '申通快递',
                'logistics_bill_no' => '12312211'
           ]
       ]
   ]
]
```

参考
--

[](#参考)

- [PHP 扩展包实战教程 - 从入门到发布](https://laravel-china.org/courses/creating-package)
- [高德开放平台接口的 PHP 天气信息组件(weather)](https://github.com/overtrue/weather)
- [满足你的多种发送需求的短信发送组件(easy-sms)](https://github.com/overtrue/easy-sms)

最后
--

[](#最后)

欢迎提出 issue 和 pull request

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~169 days

Recently: every ~216 days

Total

10

Last Release

1158d ago

Major Versions

v0.0.4 → 1.0.02019-06-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/183c956fa043920a353bf089e57c4bd3ee80ad56685c12b0816e088ed5c83a50?d=identicon)[wythehuang](/maintainers/wythehuang)

---

Top Contributors

[![uuk020](https://avatars.githubusercontent.com/u/14903007?v=4)](https://github.com/uuk020 "uuk020 (54 commits)")[![AilonHuang](https://avatars.githubusercontent.com/u/18651361?v=4)](https://github.com/AilonHuang "AilonHuang (2 commits)")[![dacheng-gao](https://avatars.githubusercontent.com/u/13791720?v=4)](https://github.com/dacheng-gao "dacheng-gao (1 commits)")[![liujundezhanghao](https://avatars.githubusercontent.com/u/20275621?v=4)](https://github.com/liujundezhanghao "liujundezhanghao (1 commits)")[![netbuilding](https://avatars.githubusercontent.com/u/8249202?v=4)](https://github.com/netbuilding "netbuilding (1 commits)")[![ramzeng](https://avatars.githubusercontent.com/u/38133602?v=4)](https://github.com/ramzeng "ramzeng (1 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")[![almas-x](https://avatars.githubusercontent.com/u/9382335?v=4)](https://github.com/almas-x "almas-x (1 commits)")

---

Tags

composerlogisticsphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wythe-logistics/health.svg)

```
[![Health](https://phpackages.com/badges/wythe-logistics/health.svg)](https://phpackages.com/packages/wythe-logistics)
```

###  Alternatives

[vinelab/url-shortener

URL shortening the easy way.

6217.2k](/packages/vinelab-url-shortener)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
