快递100物流信息查询库
Install via composer
$ composer require slince/shipment-tracking-kuaidi100
$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文档
The MIT license. See MIT