PHPackages                             sockball/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. sockball/logistics

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

sockball/logistics
==================

简单物流查询整合

0.3.0(6y ago)4364MITPHPPHP &gt;=7.2.0CI failing

Since Aug 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/sockball/logistics)[ Packagist](https://packagist.org/packages/sockball/logistics)[ RSS](/packages/sockball-logistics/feed)WikiDiscussions master Synced 2w ago

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

About
-----

[](#about)

一些简单物流公司抓取接口的查询整合，理论上没有请求次数限制，不保证长期有效，有时间会陆续增加

Support
-------

[](#support)

✅ 代表暂时有效

🚧 代表施工中

❌ 代表失效或因有验证需要crack

快递公司常量名抓取类型支持添加日期备注失效日期申通TYPE\_STO滑动验证❌2019-10-062020.10圆通TYPE\_YTO简单API✅2019-08-19注意请求频率中通TYPE\_ZTO图形验证码❌2019-08-192020.07百世快递TYPE\_BSETHTML正则🚧2019-08-272020.01添加图片验证码2020.01丹鸟快递TYPE\_DANN简单API✅2019-08-29中国邮政TYPE\_CHPOAPI✅2019-08-30滑动验证码顺丰❌韵达TYPE\_YUNDA加密JS解析🚧计算图片验证码天天快递❌切片滑动验证码17trackTYPE\_XVIIAPI✅2020-01-07js加密TODO
----

[](#todo)

- 韵达返回问题...
- 异常处理不完善...
- 突破百世图片验证码...
- 优速快递图片验证码根据[此文](https://segmentfault.com/a/1190000015240294)与OCR可破

Install
-------

[](#install)

```
composer require sockball/logistics
```

Require
-------

[](#require)

部分物流需要 `python3` 支持，如中国邮政；

- `php >= 7.2`，并启用 `exec`函数
- `python >= 3` 并安装模块 `cv2 requests numpy execjs`：`pip install opencv-python requests numpy PyExecJS`

Demo
----

[](#demo)

```
use sockball\logstics\Logistics;
use sockball\logistics\base\Trace;

// 圆通
$waybillNo = 'YT4234858984188';

$logistics = new Logistics();
$response = $logistics->query(Logistics::TYPE_YTO, $waybillNo);

if ($response->isSuccess())
{
    foreach ($response as $trace)
    {
        /** @var Trace $trace */
        // echo $trace->timestamp;
        // echo $trace->state;
        echo $trace->info . "\n";
    }
    // print_r($response->getLatest());
    // print_r($response->getAll());
    // print_r($response->getRaw());
}
else if ($response->isFailed())
{
    echo $response->getMsg();
}
else
{
    echo $response->getError();
}
```

或

```
git clone https://github.com/sockball/logistics.git
cd logistics
composer install

./vendor/bin/phpunit tests/
...
```

方法示例

```
// '暂无信息'
$response->getError();

// 直接读取最新的物流信息
$response->timestamp;
$response->info;

// 遍历物流信息 或 getAll() 后再遍历
foreach ($response as $trace)
{
    echo $trace->info;
}

// 获取原请求数据
$response->getRaw();
```

License
-------

[](#license)

[MIT](https://github.com/sockball/logistics/blob/master/LICENSE)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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 ~47 days

Total

4

Last Release

2357d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.0.0

0.3.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17963718?v=4)[sockball](/maintainers/sockball)[@sockball](https://github.com/sockball)

---

Top Contributors

[![sockball](https://avatars.githubusercontent.com/u/17963718?v=4)](https://github.com/sockball "sockball (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k34](/packages/neuron-core-neuron-ai)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

346132.9M110](/packages/google-cloud-core)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

673139.5k6](/packages/spatie-laravel-export)[workos/workos-php

WorkOS PHP Library

423.0M9](/packages/workos-workos-php)

PHPackages © 2026

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