PHPackages                             wi1dcard/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. [API Development](/categories/api)
4. /
5. wi1dcard/kuaidi

Abandoned → [finecho/logistics](/?search=finecho%2Flogistics)ArchivedLibrary[API Development](/categories/api)

wi1dcard/kuaidi
===============

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

v0.1.3(7y ago)241626MITPHPPHP &gt;=5.4

Since Aug 1Pushed 6y agoCompare

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

READMEChangelogDependencies (3)Versions (5)Used By (0)

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

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

已弃用，请关注新项目：
=================================================

[](#已弃用请关注新项目httpsgithubcomfinechologistics)

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

❤️ 本项目 [GitHub](https://github.com/wi1dcard/kuaidi) / [Gitee(码云)](https://gitee.com/wi1dcard/kuaidi)。

[![Build Status](https://camo.githubusercontent.com/b44380c974dd120f71c486aed88686d588e07256628ee67a3512473cda4cd4fe/68747470733a2f2f7472617669732d63692e6f72672f77693164636172642f6b75616964692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wi1dcard/kuaidi)[![StyleCI](https://camo.githubusercontent.com/bf13b98e6043c16e82bc7cd2d00ce191639902585b7379043177b9a54fd8a724/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133363535363538362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/136556586)[![Packagist](https://camo.githubusercontent.com/9ebf6bfe89276a62197130141faa3502ae0ca56134dc1a784825b78d1b431605/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77693164636172642f6b75616964692e737667)](https://packagist.org/packages/wi1dcard/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 wi1dcard/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

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Every ~81 days

Total

4

Last Release

2599d ago

### Community

Maintainers

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

---

Top Contributors

[![wi1dcard](https://avatars.githubusercontent.com/u/25447002?v=4)](https://github.com/wi1dcard "wi1dcard (55 commits)")

---

Tags

expresstrackerwaybills

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[stymiee/authnetjson

Library that abstracts Authorize.Net's JSON APIs. This includes the Advanced Integration Method (AIM), Automated Recurring Billing (ARB), Customer Information Manager (CIM), Transaction Reporting, Simple Integration Method (SIM), and Webhooks.

19545.7k](/packages/stymiee-authnetjson)[michaeldrennen/geonames

A Laravel (php) package that interfaces with the geolocation services on geonames.org.

9514.0k](/packages/michaeldrennen-geonames)[christianruhstaller/bexio-api-php-client

Client library for bexio API

1134.7k](/packages/christianruhstaller-bexio-api-php-client)[luyadev/luya-headless

LUYA headless API client

1025.6k3](/packages/luyadev-luya-headless)[mrteye/gdax

API for GDAX A service provided by coinbase. (Unofficial)

195.2k](/packages/mrteye-gdax)

PHPackages © 2026

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