PHPackages                             nizerin/kuaidi - 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. nizerin/kuaidi

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

nizerin/kuaidi
==============

A wrapper library of multiple free express tracking APIs in China.

1.0.0(6y ago)34MITPHPPHP &gt;=5.4

Since Jun 24Pushed 6y agoCompare

[ Source](https://github.com/NiZerin/kuaidi)[ Packagist](https://packagist.org/packages/nizerin/kuaidi)[ RSS](/packages/nizerin-kuaidi/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Kuaidi - 免费快递查询扩展包
==================

[](#kuaidi---免费快递查询扩展包)

📦 集成「快递100」、「快递网」、「快递鸟」三家快递查询接口，并统一调用方式。

❤️ 本项目 [GitHub](https://github.com/NiZerin/kuaidi)。

[![Build Status](https://camo.githubusercontent.com/80f4ba170802c721e4ed056a26e6b11d6fb91e83668d45475a891ea35de7d21d/68747470733a2f2f7472617669732d63692e6f72672f4e695a6572696e2f6b75616964692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/NiZerin/kuaidi)[![StyleCI](https://camo.githubusercontent.com/bf13b98e6043c16e82bc7cd2d00ce191639902585b7379043177b9a54fd8a724/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133363535363538362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/136556586)[![Packagist](https://camo.githubusercontent.com/cdea9cb4ab0ac8805658df0578d17e15631beed8f9d56e0fc75ca9cf70d73818/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4e695a6572696e2f6b75616964692e737667)](https://packagist.org/packages/NiZerin/kuaidi)

- **目录**
    - [小试牛刀](#%E5%B0%8F%E8%AF%95%E7%89%9B%E5%88%80)
    - [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)
        - [0. 安装](#0-%E5%AE%89%E8%A3%85)
        - [1. 创建运单](#1-%E5%88%9B%E5%BB%BA%E8%BF%90%E5%8D%95)
        - [2. 查询](#2-%E6%9F%A5%E8%AF%A2)
        - [3. 获得数据](#3-%E8%8E%B7%E5%BE%97%E6%95%B0%E6%8D%AE)
    - [结语](#%E7%BB%93%E8%AF%AD)
    - [声明](#%E5%A3%B0%E6%98%8E)

小试牛刀
----

[](#小试牛刀)

**注意：本扩展包内所有快递公司名称，均不带结尾 `物流` / `快递` / `快运` / `速递` / `速运` 等字眼。**

克隆本仓库，并执行 `composer install` 安装所需依赖。

在命令行内运行。

```
php examples/index.php  [快递公司名称]
```

其中，快递公司名称可省略；效果如下：

[![](https://camo.githubusercontent.com/f2056afb86d6503cc1d679c2310154043551190ff9bfb464a3b54518a3fba5f0/68747470733a2f2f692e6c6f6c692e6e65742f323031382f30382f30312f356236313830613565313366302e706e67)](https://camo.githubusercontent.com/f2056afb86d6503cc1d679c2310154043551190ff9bfb464a3b54518a3fba5f0/68747470733a2f2f692e6c6f6c692e6e65742f323031382f30382f30312f356236313830613565313366302e706e67)

使用方法
----

[](#使用方法)

### 0. 安装

[](#0-安装)

```
composer require nizerin/kuaidi
```

### 1. 创建运单

[](#1-创建运单)

```
$waybill = new \Kuaidi\Waybill(
    '运单编号',
    '快递公司名称'
);
```

「快递100」支持自动识别，可不填快递公司名称。

### 2. 查询

[](#2-查询)

```
(new \Kuaidi\Trackers\Kuaidi100)->track($waybill);
(new \Kuaidi\Trackers\Kuaidiwang)->track($waybill);
(new \Kuaidi\Trackers\Kuaidiniao('Business ID', 'APP Key'))->track($waybill);
```

通常三选一即可，推荐使用「快递100」。

若查询过程出错，或接口返回失败将会抛出 `Kuaidi\TrackingException`。

### 3. 获得数据

[](#3-获得数据)

```
// 获取状态，所有状态列表见 `Waybill::STATUS_*` 常量。
$waybill->getStatus();
// 获取详情，支持直接 foreach / while / 数组下标 形式访问。
$waybill->getTraces();
```

实际项目中，可自行封装辅助函数以便于使用。

结语
--

[](#结语)

这个扩展包的初衷，是因为各家快递查询接口支持的快递公司不同，有部分接口不稳定 / 缺失小众快递公司的支持；公司产品需要稳定且支持率高，所以封装出来一套比较统一的快递查询接口，包装各家的 API，也方便以后进行扩展。

目前已经在生产环境稳定使用三个月左右，解除无关依赖后修改放出，供大家参考使用。

如果你有新的公共接口 / 原有接口出现问题，欢迎 Issue 和 PR，不胜感激。

关于命名，考虑到国内外环境差距大，此扩展包多数只在国内使用；所以干脆用本地化的词语，简单好记：`Kuaidi`。

声明
--

[](#声明)

接口来源于网络，本扩展包仅为包装和收集，仅供学习参考；对于数据准确性、接口可用性不作保证；一切法律问题自行承担。

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

2516d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/573fcf255345bc64772d2c61b862bd91ff59089560d78094eb218a4df1d72e35?d=identicon)[nizerin](/maintainers/nizerin)

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nizerin-kuaidi/health.svg)

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

PHPackages © 2026

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