PHPackages                             animail/bring-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. animail/bring-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

animail/bring-api
=================

Bring Tracking API library

0306PHP

Since Dec 16Pushed 10y ago4 watchersCompare

[ Source](https://github.com/Animail/Bring-PHP-API)[ Packagist](https://packagist.org/packages/animail/bring-api)[ RSS](/packages/animail-bring-api/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Bring PHP API
=============

[](#bring-php-api)

This PHP wrapper is not supported by Bring, but as of Dec 2015 they do not offer a PHP alternative. Based on the [developer documentation](http://developer.bring.com/).

Installing
----------

[](#installing)

With Composer:

```
composer require animail/bring-api

```

Voila!

How to use it
-------------

[](#how-to-use-it)

### Initialize

[](#initialize)

```
use \Animail\BringApi;

// ...

$api_uid = 'john.doe@example.com';
$api_key = '1234abc-abcd-1234-5678-abcd1234abcd';
$my_website_url = 'https://example.com/';
$bring = new BringApi($api_uid, $api_key, $my_website_url);

// Don't want to authenticate?
$bring = new BringApi();
```

### Find shipment by reference, package number or shipment number

[](#find-shipment-by-reference-package-number-or-shipment-number)

The `track()` method wraps the [Tracking API](http://developer.bring.com/api/tracking/) and always returns an array, including when the shipment(s) could not be found. Unless there was an API error, in which case we'll throw all kinds of fun `\Animail\BringApiException`s.

```
// Shipment number
$consignmentSet = $bring->track('73325389952521130'); // array('consignmentSet' => array())

// Package number
$consignmentSet = $bring->track('CT797294851NO'); // array('consignmentSet' => array())

// Reference (this is usually your internal ordernumber or shipmentID)
$consignmentSet = $bring->track('1234'); // array('consignmentSet' => array())
```

### Catching exceptions

[](#catching-exceptions)

**Catch everything in the same place**

```
try {
  $bring = new BringApi('', '', '');
} catch (BringApiException $e) {
  // All our exception types extend the BringApiException class
}
```

**Only catch errors from the API**

```
try {
  $bring = new BringApi('', '', '');
  $results = $bring->track('boobar');
} catch (BringApiErrorException $e) {

}
```

**Separate handlers for different types**

```
try {
  $bring = new BringApi('', '', '');
  $results = $bring->track('boobar');
} catch (BringApiClientException $e) {
  // Issues with the client. Guzzle for some reason threw an error.
} catch (BringApiErrorException $e) {

} catch (BringApiException $e) {
  // This one will never be called unless we add more exception types in the future
}
```

Contributing
------------

[](#contributing)

We love open source software and would love to see pull requests. We're *trying* to be [PSR-4](http://www.php-fig.org/psr/psr-4/) compliant but don't have many other requirements.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/677030?v=4)[Joakim Hedlund](/maintainers/Sleavely)[@Sleavely](https://github.com/Sleavely)

---

Top Contributors

[![Sleavely](https://avatars.githubusercontent.com/u/677030?v=4)](https://github.com/Sleavely "Sleavely (14 commits)")

### Embed Badge

![Health badge](/badges/animail-bring-api/health.svg)

```
[![Health](https://phpackages.com/badges/animail-bring-api/health.svg)](https://phpackages.com/packages/animail-bring-api)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M81](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.7k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M87](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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