Skip to content

slince-archived/shipment-tracking-kuaidi100

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

快递100物流信息查询

Build Status Coverage Status Latest Stable Version Scrutinizer

快递100物流信息查询库

Installation

Install via composer

$ composer require slince/shipment-tracking-kuaidi100

Basic Usage

$tracker = new Slince\ShipmentTracking\KuaiDi100\KuaiDi100Tracker(APPKEY, 'shunfeng'); //承运商名称并不是标准的承运商代码,实际承运商代码请到kuaidi100.com查看

try {
   $shipment = $tracker->track('CNAQV100168101');
   
   if ($shipment->isDelivered()) {
       echo "Delivered";
   }
   print_r($shipment->getEvents());  //print the shipment events
   
} catch (Slince\ShipmentTracking\Exception\TrackException $exception) {
    exit('Track error: ' . $exception->getMessage());
}

快递100的key需要自行申请,免费版的key在查询申通顺丰之类的单号时会受限,需要企业版才可以;附上快递100文档

License

The MIT license. See MIT