PHPackages                             vdhicts/rebrandly-api-client - 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. [API Development](/categories/api)
4. /
5. vdhicts/rebrandly-api-client

ActiveLibrary[API Development](/categories/api)

vdhicts/rebrandly-api-client
============================

API client for the API of Rebrandly

v4.1.0(2mo ago)08.7k—4.2%1MITPHPPHP &gt;=8.2CI passing

Since Mar 7Pushed 2mo agoCompare

[ Source](https://github.com/vdhicts/rebrandly-api-client)[ Packagist](https://packagist.org/packages/vdhicts/rebrandly-api-client)[ RSS](/packages/vdhicts-rebrandly-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (10)Versions (7)Used By (0)

Rebrandly API client
====================

[](#rebrandly-api-client)

Easily use the [API](https://developers.rebrandly.com/) of the url shortener [Rebrandly](https://rebrandly.com/).

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

[](#requirements)

This packages requires PHP 7.4 or higher.

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

[](#installation)

This package can be used in any PHP project or with any framework.

You can install the package via composer:

```
composer require vdhicts/rebrandly-api-client

```

Usage
-----

[](#usage)

This package tries to offer you a complete implementation of the Rebrandly API. Some endpoints are restricted to certain plans Rebrandly offer (like scripts and tags).

### Quick usage

[](#quick-usage)

All endpoints can be retrieved from the `Rebrandly` class. This class needs the `Client`.

```
use Vdhicts\Rebrandly;

// Initialize the client and the Rebrandly instance
$client = new Rebrandly\Client('API_KEY');
$rebrandly = new Rebrandly\Rebrandly($client);

// Access the endpoints
$linksEndpoint = $rebrandly->links();
```

For example, to retrieve all links:

```
$links = $rebrandly->links()->list();
```

### Options

[](#options)

Some endpoints of the Rebrandly API offer some filtering. Those filters can be set in the `Options` class. For example, to order your links by clicks:

```
$links = $rebrandly->links()->list(new Options(['orderBy' => 'clicks', 'orderDir' => 'asc']));
```

### Models

[](#models)

This client will always return the related models. When creating a new resource, the object is provided to the `create`method. For example, to create a link:

```
$link = new Rebrandly\Models\Link();
$link->setDestination('https://time-tracker.vdhicts.nl');
$link->setSlashtag('time-tracker');
$link->setDomain($domain);

$rebrandly->links()->create($link);
```

To create a link for you custom domain, you need to specify the domain in the `Link` model:

```
$domain = new Rebrandly\Models\Domain();
$domain->setFullName('yourdomain.tld');

$link->setDomain($domain);

$rebrandly->links()->create($link);
```

### Exceptions

[](#exceptions)

When something goes wrong, the client will throw a `RebrandlyException`. If you want to catch exceptions from this package, that's the one you should catch. Error responses from the API also result in the `RebrandlyException`.

### Laravel

[](#laravel)

For Laravel users, I would suggest adding the api key to your `.env` file:

`REBRANDLY_API_KEY="your-key"`

And create a config file for Rebrandly or add this to your project's config file. Then initialize the client with the config value:

```
$client = new Rebrandly\Client(config('rebrandly.api_key'));
```

Tests
-----

[](#tests)

Unit tests are available in the `tests` folder. Run via phpunit:

`vendor\bin\phpunit`

By default a coverage report will be generated in the `build/coverage` folder.

Contribution
------------

[](#contribution)

Any contribution is welcome, but it should meet the PSR-2 standard and please create one pull request per feature. In exchange you will be credited as contributor on this page.

Security
--------

[](#security)

If you discover any security related issues in this or other packages of Vdhicts, please email instead of using the issue tracker.

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](http://opensource.org/licenses/MIT).

Support
-------

[](#support)

This package isn't an official package from Rebrandly, so they probably won't offer support for it. If you encounter a problem with this client, please open an issue on GitHub.

About vdhicts
-------------

[](#about-vdhicts)

[Vdhicts](https://www.vdhicts.nl) is the name of my personal company. Vdhicts develops and implements IT solutions for businesses and educational institutions.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance88

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

 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

Every ~550 days

Total

5

Last Release

61d ago

Major Versions

1.0.0 → 2.0.02021-09-12

2.0.0 → 3.0.02022-02-07

3.0.0 → v4.0.02025-02-27

PHP version history (4 changes)1.0.0PHP ^7.2

2.0.0PHP ^7.4

3.0.0PHP ^7.4 || ^8.0

v4.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/88d23e7b707d1cfe0eea91c00590613f45e0c75cb0a3ce89354328332e5c0c02?d=identicon)[vdhicts](/maintainers/vdhicts)

---

Top Contributors

[![dvdheiden](https://avatars.githubusercontent.com/u/90568118?v=4)](https://github.com/dvdheiden "dvdheiden (15 commits)")

---

Tags

api-clientphprebrandly

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vdhicts-rebrandly-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/vdhicts-rebrandly-api-client/health.svg)](https://phpackages.com/packages/vdhicts-rebrandly-api-client)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[ashallendesign/laravel-exchange-rates

A wrapper package for interacting with the exchangeratesapi.io API.

485677.8k](/packages/ashallendesign-laravel-exchange-rates)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

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