PHPackages                             yihaitao/express - 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. yihaitao/express

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

yihaitao/express
================

支持快递鸟、快递100的快递查询SDK

1.0.0(1y ago)017MITPHPPHP ^7.0|^8.0

Since Sep 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ljyljy0211/express)[ Packagist](https://packagist.org/packages/yihaitao/express)[ RSS](/packages/yihaitao-express/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

 快递鸟、快递100的快递查询SDK
===================

[](#-快递鸟快递100的快递查询sdk-)

安装
--

[](#安装)

```
$ composer require yihaitao/express -vvv
```

配置
--

[](#配置)

在使用本扩展之前，你需要去 [快递100](https://www.kuaidi100.com/openapi/applyapi.shtml) 或者 [快递鸟](http://www.kdniao.com/reg) 注册申请，获取到APP\_ID和APP\_KEY

用法
--

[](#用法)

### 快递100

[](#快递100)

```
use YiHaiTao\Express\Express100;

$express = new Express100('app_id','app_key');
$info = $express->track($trackingCode, $shippingCode, $phone); //快递单号 物流公司编号 收件人手机号(顺丰必填 其他快递选填)
```

示例:

```
{
    "message": "ok",
    "nu": "888888888888",
    "ischeck": "1",
    "condition": "F00",
    "com": "shunfeng",
    "status": "200",
    "state": "3",
    "data": [
        {
            "time": "2019-03-08 19:11:51",
            "ftime": "2019-03-08 19:11:51",
            "context": "[安高广场速运营业点]快件已发车"
        },
        {
            "time": "2019-03-08 18:56:12",
            "ftime": "2019-03-08 18:56:12",
            "context": "[安高广场速运营业点]快件在【合肥蜀山区安高广场营业点】已装车,准备发往 【合肥经开集散中心】"
        },
        {
            "time": "2019-03-08 18:50:52",
            "ftime": "2019-03-08 18:50:52",
            "context": "[安高广场速运营业点]顺丰速运 已收取快件"
        }
    ]
}
```

### 快递鸟

[](#快递鸟)

```
use YiHaiTao\Express\ExpressBird;

$express = new ExpressBird('app_id','app_key');
$info = $express->track($trackingCode, $shippingCode, $phone, $orderCode, $requestType = '8002'); //快递单号 物流公司编号 手机号 订单编号(选填) 请求类型
```

示例:

```
{
    "LogisticCode": "8888888888888888",
    "ShipperCode": "YTO",
    "Traces": [
        {
            "AcceptStation": "【四川省直营市场部公司】 取件人: 四川省直营市场部41 已收件",
            "AcceptTime": "2019-03-21 11:03:40"
        },
        {
            "AcceptStation": "【四川省直营市场部公司】 已收件",
            "AcceptTime": "2019-03-21 13:45:01"
        },
        {
            "AcceptStation": "【成都转运中心】 已收入",
            "AcceptTime": "2019-03-21 22:40:01"
        }
    ],
    "State": "3",
    "OrderCode": "",
    "EBusinessID": "100000",
    "Success": true
}
```

### 通用方法

[](#通用方法)

```
use YiHaiTao\Express\Express;

$express = new Express($app_id,$app_key,$type); //$type支持类型'express100'、'expressbird'

// 快递鸟  $additional=['order_code'=>111111, 'request_type'=>'8002', 'phone'=>'13012345678']
// 快递100 $additional=['phone'=>'18899996666']
$info = $express->track($trackingCode, $shippingCode，$additional); ////查询物流 快递单号 额外参数
```

### 在 Laravel 中使用

[](#在-laravel-中使用)

在 Laravel 中使用也是同样的安装方式，配置写在 `config/services.php` 中：

```
'express' => [
    'id' => env('EXPRESS_ID'),
    'key' => env('EXPRESS_KEY'),
    'type' => env('EXPRESS_TYPE'),
],
```

然后在 `.env` 中配置 `EXPRESS_ID`、`EXPRESS_KEY`、`EXPRESS_TYPE`；

```
 EXPRESS_ID=xxxxxxxxxxxxxxxxxxxxx
 EXPRESS_KEY=xxxxxxxxxxxxxxxxxxxxx
 EXPRESS_TYPE=express100
```

可以用两种方式来获取 `YiHaiTao\Express\Express` 实例：

#### 方法参数注入

[](#方法参数注入)

```
public function edit(Express $express)
{
    $response = $express->track('888888888', 'YTO');
}
```

#### 服务名访问

[](#服务名访问)

```
public function edit()
{
    $response = app('express')->track('888888888', 'YTO');
}
```

参考
--

[](#参考)

- [快递100接口文档](https://www.kuaidi100.com/openapi/api_post.shtml)
- [快递100快递公司编码](https://blog.csdn.net/u011816231/article/details/53063611)
- [快递鸟接口文档](https://www.yuque.com/kdnjishuzhichi)
- [快递鸟快递公司编码](http://www.kdniao.com/documents)

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4b789c10f951fb193126377cba6d73b5c6faf6e4fc9072413175a73148e5d0f?d=identicon)[ljyljy0211](/maintainers/ljyljy0211)

---

Top Contributors

[![ljyljy0211](https://avatars.githubusercontent.com/u/1272007?v=4)](https://github.com/ljyljy0211 "ljyljy0211 (1 commits)")

### Embed Badge

![Health badge](/badges/yihaitao-express/health.svg)

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

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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