PHPackages                             benmorel/gls-tracker - 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. benmorel/gls-tracker

ActiveLibrary

benmorel/gls-tracker
====================

A library to track GLS parcels using the GLS Track &amp; Trace Web API

0.1.0(6y ago)4319MITPHPPHP &gt;=7.3

Since Dec 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/BenMorel/gls-tracker)[ Packagist](https://packagist.org/packages/benmorel/gls-tracker)[ RSS](/packages/benmorel-gls-tracker/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

GLS Tracker
===========

[](#gls-tracker)

A PHP library to track GLS parcels using the GLS Track &amp; Trace Web API.

[![Latest Stable Version](https://camo.githubusercontent.com/3d44936a92c7de779c34da1ea595c5c13f49872449ee832a861def5f08fddcd9/68747470733a2f2f706f7365722e707567782e6f72672f62656e6d6f72656c2f676c732d747261636b65722f762f737461626c65)](https://packagist.org/packages/benmorel/gls-tracker)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](http://opensource.org/licenses/MIT)

Installation
------------

[](#installation)

This library is installable via [Composer](https://getcomposer.org/):

```
composer require benmorel/gls-tracker
```

Requirements
------------

[](#requirements)

This library requires PHP 7.1 or later.

Project status &amp; release process
------------------------------------

[](#project-status--release-process)

This library is under development.

The current releases are numbered `0.x.y`. When a non-breaking change is introduced (adding new methods, optimizing existing code, etc.), `y` is incremented.

**When a breaking change is introduced, a new `0.x` version cycle is always started.**

It is therefore safe to lock your project to a given release cycle, such as `0.1.*`.

If you need to upgrade to a newer release cycle, check the [release history](https://github.com/BenMorel/gls-tracker/releases)for a list of changes introduced by each further `0.x.0` version.

Quickstart
----------

[](#quickstart)

First, instantiate the tracker with your GLS API username &amp; password:

```
use BenMorel\GLSTracker\GLSTracker;
use BenMorel\GLSTracker\GLSTrackerException;

// Instantiate the tracker
$tracker = new GLSTracker('username', 'password');
```

You can optionally pass a language code as third parameter, to get results returned in another language (defaults to `en`):

```
$tracker = new GLSTracker('username', 'password', 'fr');
```

You can now track a single parcel:

```
try {
    $parcel = $tracker->trackOne('00AB1234');

    if ($parcel !== null) {
        echo $parcel->trackid, ' ', $parcel->status, PHP_EOL;

        foreach ($parcel->events as $event) {
            echo "\t", $event->timestamp, ' ', $event->description, PHP_EOL;
        }
    } else {
        echo 'Parcel not found!', PHP_EOL;
    }
} catch (GLSTrackerException $e) {
    // an error occurred
    echo $e;
}
```

Or track several parcels at once:

```
try {
    $parcels = $tracker->trackMany('00AB1234', '00XY6789');

    foreach ($parcels as $parcel) {
        echo $parcel->trackid, ' ', $parcel->status, PHP_EOL;

        foreach ($parcel->events as $event) {
            echo "\t", $event->timestamp, ' ', $event->description, PHP_EOL;
        }
    }
} catch (GLSTrackerException $e) {
    // an error occurred
    echo $e;
}
```

Note that there is a limit on the number of search results that may be returned by the API in a single call. If you request too many TrackIDs at a time, you may get a `TooManySearchResultsException`.

Error handling
--------------

[](#error-handling)

If an error occurs while querying the API, a `GLSTrackerException` is always thrown.

Exception hierarchy:

- `GLSTrackerException`
    Base class for all exceptions.
    - `Exception\APIException`
        A well-known error response has been received from the API.
        - `Exception\APIException\InputValidationException`
            An invalid TrackID has been given.
        - `Exception\APIException\MissingRightsException`
            The user can access the API but doesn't have the necessary rights.
        - `Exception\APIException\NotAuthorizedException`
            The username or password is incorrect.
        - `Exception\APIException\TooManySearchResultsException`
            Too many search results would be returned; you should request less TrackIDs.
        - `Exception\APIException\UserAccountBlockedException`
            The user account is blocked.
    - `Exception\InvalidResponseException`
        An invalid response has been received from the API, and this library cannot decode it.
    - `Exception\NetworkException`
        A network error occurred and no response has been received from the API.

These fine-grained exceptions allow you to act automatically upon each type of failure. For example, when receiving a `NetworkException`, you may schedule a retry a few moments later.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

2336d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57189121968030f0770811b461cc92f9c19c08f5c4767292f2ede48b7277cfad?d=identicon)[BenMorel](/maintainers/BenMorel)

---

Top Contributors

[![BenMorel](https://avatars.githubusercontent.com/u/1952838?v=4)](https://github.com/BenMorel "BenMorel (10 commits)")

### Embed Badge

![Health badge](/badges/benmorel-gls-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/benmorel-gls-tracker/health.svg)](https://phpackages.com/packages/benmorel-gls-tracker)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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