2017 © Pedro Peláez
 

project parcel-track

Api Parcel Tracking API

image

afiqiqmal/parcel-track

Api Parcel Tracking API

  • Sunday, June 3, 2018
  • by afiqiqmal
  • Repository
  • 1 Watchers
  • 5 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 31 Versions
  • 350 % Grown

The README.md

Parcel Tracker

Build Status Coverage Packagist Packagist Donate, (*1)

Simple Parcel Tracker for Local Parcel Courier. Basically it just crawl the courier website or existing API. Need time to time to monitor web/api changes before failure happen., (*2)


, (*3)

BTW, Currently available (Successfully Scraped) 1. Post Laju 2. GDEX 3. ABX Express 4. DHL Express 5. DHL E-Commerce 6. SkyNet Express 7. CityLink Express 8. FedEx Express 9. LEL Express 10. KTM Distribution Sdn Bhd 11. UPS, (*4)

Tested in PHP 7.1 Only, (*5)

Installation

Step 1: Install from composer

composer require afiqiqmal/parcel-track

Alternatively, you can specify as a dependency in your project's existing composer.json file, (*6)

{
   "require": {
      "afiqiqmal/parcel-tracker": "^1.0"
   }
}

Usage

After installing, you need to require Composer's autoloader and add your code., (*7)

require_once __DIR__ .'/../vendor/autoload.php';

Sample for Post Laju

$data = parcel_track()
    ->postLaju()
    ->setTrackingNumber("ER157080065MY")
    ->fetch();

Sample for GDex

$data = parcel_track()
    ->gdex()
    ->setTrackingNumber("4941410530")
    ->fetch();

Sample for Abx Express

$data = parcel_track()
    ->abxExpress()
    ->setTrackingNumber("EZP843055940197")
    ->fetch();

Sample for DHL Express

$data = parcel_track()
    ->dhlExpress()
    ->setTrackingNumber("5176011131")
    ->fetch();

Sample for Check Which Carrier Tracking Number belongs to

$data = parcel_track()
    ->setTrackingNumber("5176011131")
    ->checkCourier();

Method

Method Param Description
postLaju() Post Laju Courier
abxExpress() Post Laju Courier
dhlExpress() DHL Express Courier
dhlCommerce() DHL E-Commerce Courier
gdex() GD Express Courier
skyNet() SkyNet Express Courier
cityLink() City Link Express Courier
fedEx() FedEx Express Courier
lelExpress() Lazada E-Logistic Courier
ktmDelivery() KTM Distribution Sdn Bhd
ups() United Parcel Service Courier
setTrackingNumber($refNumber) String Enter the tracking number

Result

Checking Result

For checking which carrier response like below:, (*8)

{
    "code": 200,
    "error": false,
    "possible_carrier": [
        "ABX Express Sdn Bhd",
        "City Link Express"
    ],
    "generated_at": "2018-05-14 08:53:35",
    "footer": {
        "developer": {
            "name": "Hafiq",
            "homepage": "https://github.com/afiqiqmal"
        }
    }
}

Tracker Result

You should getting data tracker similarly like below:, (*9)

{
    "code": 200,
    "error": false,
    "tracker": {
        "tracking_number": "4941410530",
        "provider": "gdex",
        "delivered": true,
        "checkpoints": [
            {
                "date": "2016-11-30 17:41:10",
                "timestamp": 1480527670,
                "process": "Outbound from KBR station",
                "type": "item_received",
                "event": "Kota Bharu"
            },
            {
                "date": "2016-11-30 17:47:00",
                "timestamp": 1480528020,
                "process": "Picked up by courier",
                "type": "dispatch",
                "event": "Kota Bharu"
            },
            {
                "date": "2016-12-01 03:25:11",
                "timestamp": 1480562711,
                "process": "In transit",
                "type": "facility_process",
                "event": "Petaling Jaya"
            },
            {
                "date": "2016-12-01 10:00:16",
                "timestamp": 1480586416,
                "process": "Inbound to JHB station",
                "type": "facility_process",
                "event": "Johor Bharu"
            },
            {
                "date": "2016-12-02 10:10:00",
                "timestamp": 1480673400,
                "process": "Delivered",
                "type": "delivered",
                "event": "Sungai Tiram"
            }
        ]
    },
    "generated_at": "2018-05-03 02:07:20",
    "footer": {
        "source": "GD Express Sdn Bhd",
        "developer": {
            "name": "Hafiq",
            "homepage": "https://github.com/afiqiqmal"
        }
    }
}

Todo

  • Struggling for other Parcel Data
  • Keep up to date if any parcel data changes

Issue

  • If Issue happen like the api always return empty [] after cross check with real site, just let me know =)


Pftt.. I just don't know why, the Travis CI is failed. It because of gnutls_handshake() failed. In my local env, all Test Unit Passed . I disabled it first because always failing on travis-ci.org =)
, (*10)

ChangeLog

  • See changelog.md

License

Licensed under the MIT license, (*11)

, (*12)

The Versions

03/06 2018

dev-master

9999999-dev

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

02/06 2018

1.12.1

1.12.1.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

02/06 2018

1.12

1.12.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

26/05 2018

1.11

1.11.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

26/05 2018

dev-dev

dev-dev

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

26/05 2018

dev-ups

dev-ups

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

24/05 2018

1.10

1.10.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

24/05 2018

dev-ktmd

dev-ktmd

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

23/05 2018

1.9

1.9.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

23/05 2018

dev-dhl-ecommerce

dev-dhl-ecommerce

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

17/05 2018

1.8.1

1.8.1.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

14/05 2018

1.8

1.8.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

14/05 2018

dev-checker

dev-checker

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

07/05 2018

1.7.2

1.7.2.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

07/05 2018

1.7.1

1.7.1.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

05/05 2018

1.7

1.7.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

1.6

1.6.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

dev-fedex

dev-fedex

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

1.5

1.5.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

dev-abx

dev-abx

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

dev-citylink

dev-citylink

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

dev-dhl

dev-dhl

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

dev-gdex

dev-gdex

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

04/05 2018

dev-skynet

dev-skynet

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

03/05 2018

1.4.1

1.4.1.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

03/05 2018

1.4

1.4.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

03/05 2018

1.3

1.3.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

02/05 2018

1.2.1

1.2.1.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

02/05 2018

1.2

1.2.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

02/05 2018

1.1

1.1.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel

02/05 2018

1.0

1.0.0.0

Api Parcel Tracking API

  Sources   Download

MIT

The Requires

 

The Development Requires

php parcel