PHPackages                             alldebrid/alldebrid-php - 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. alldebrid/alldebrid-php

ActiveLibrary[API Development](/categories/api)

alldebrid/alldebrid-php
=======================

Simple wrapper around Alldebrid API v4 in PHP

1.0.2(6y ago)81851MITPHPPHP &gt;=7.1

Since Mar 9Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Alldebrid/alldebrid-php)[ Packagist](https://packagist.org/packages/alldebrid/alldebrid-php)[ Docs](https://docs.alldebrid.com)[ RSS](/packages/alldebrid-alldebrid-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

alldebrid-php
=============

[](#alldebrid-php)

Simple abstraction wrapper around Alldebrid API v4 in PHP.

Requires PHP 7.1 or newer.

Documentation
-------------

[](#documentation)

The documentation for the Alldebrid API can be found [here](https://docs.alldebrid.com).

The PHP library documentation can be found in this README. An example folder is also provided to show library usage.

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

[](#installation)

You can install **alldebrid-php** in two ways, by using composer or downloading and including the standalone file.

### Via Composer:

[](#via-composer)

**alldebrid-php** is available on Packagist as the [`alldebrid/alldebrid-php`](https://packagist.org/packages/alldebrid/alldebrid-php) package:

```
composer require alldebrid/alldebrid

```

Then add the autoloader to your application with this line: `require("vendor/autoload.php")`

### Via include:

[](#via-include)

A standalone version of this library is provided, just download and include it manually :

```
include './alldebrid.standalone.php';
```

Quickstart
----------

[](#quickstart)

### Authentication

[](#authentication)

The Alldebrid API requires an agent and an apikey to authenticate requests. The agent is your app / library name ([doc](https://docs.alldebrid.com/v4/#authentication)).

You can view , create and manage your API keys in your [Alldebrid Apikey dashboard](https://alldebrid.com/apikeys/), or generate them remotly (with user action) through the PIN flow ([doc](https://docs.alldebrid.com/v4/#pin-auth) / [example](https://github.com/Alldebrid/alldebrid-php/blob/master/examples/pin.php)).

```
$agent = 'myAppName'; // Your project name
$apikey = 'YYYYYY'; // Apikey

$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);
```

### Use and error handling

[](#use-and-error-handling)

This library use Go-style error handling by default, but can be configured to use Exception if you choose so.

```
$agent = 'myAppName'; // Your project name
$apikey = 'YYYYYY'; // Apikey

$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);

// Go-style, always return an array [ $response, $error ]
[ $user, $error ] = $alldebrid->user();

if($error) {
    // Api call failed or returned an error
    $errorMessage = $user;
    die("Could not get user informations, error " . $error . " : " . $errorMessage . "\n");
}

// No error, you can consume the response
echo "Hello, " . $user['username'] . "\n";
```

Using the library with Exceptions

```
$agent = 'myAppName'; // Your project name
$apikey = 'YYYYYY'; // Apikey

$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);
$alldebrid->setErrorMode('exception');

try {
    $user = $alldebrid->user();
} catch(Exception $e) {
    die("Exception " . $e->getMessage() . "\n");
}

// No error, you can consume the response
echo "Hello, " . $user['username'] . "\n";
```

### High-level and low-level use

[](#high-level-and-low-level-use)

This library provides multiple ways to use the Alldebrid API, once the agent and apikey are set.

The lowest-level use is to call the api() function with the desired endpoint and parameters :

```
$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);
$myLink = 'https://example.com/example';
[ $response, $error ] = $alldebrid->api('link/infos', ['link' => [ $myLink ] ]);
```

Every API endpoint has its own wrapper function you can use, which handles proper parameters naming and some response checking :

```
$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);
$myLink = 'https://example.com/example';
[ $response, $error ] = $alldebrid->linkInfos($myLink);
```

Finally, for links, magnets and pin auth, helper objects are provided to easily interact with them :

```
$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);
$myLink = 'https://example.com/example';

$link = $alldebrid->link($myLink);
[ $response, $error ] = $link->infos();
//  you can then call $link->unlock() if there is no error
```

Every calls of this library are documented in the [example folder](https://github.com/Alldebrid/alldebrid-php/tree/master/examples).

### Configuration

[](#configuration)

Some options can tweak how this library behaves. The wrapper has a public options array property that you can update.

```
$alldebrid = new \Alldebrid\Alldebrid($agent, $apikey);

// By default retry=true and maxRetries=2, the library will retry failed request 2 times
$alldebrid->options['retry'] = false; // Disable retry
$alldebrid->options['maxRetries'] = 5; // Raise max retries

// By default autoInit=false, the library wont make any api call you didn't request explicitly
$alldebrid->options['autoInit'] = true; // Get user and hosts informations on wrapper creation

// By default autoUnlockBestStreamQuality=false
$alldebrid->options['autoUnlockBestStreamQuality'] = true; // On link with multiple stream options, the library will automatically unlock the highest quality source

// By default ignoreRedirector=true
$alldebrid->options['ignoreRedirector'] = true; // Flag to make the library handle redirectors

// By default exceptions=false
$alldebrid->options['exceptions'] = true; // Use Exception for error handling. Can also use $alldebrid->setErrorMode('exception');
```

Getting help
------------

[](#getting-help)

If you need help installing or using the library, please check the [Api docs](https://docs.alldebrid.com) first, check the [example codes](https://github.com/Alldebrid/alldebrid-php/tree/master/examples) and then [contact us](https://alldebrid.com/contact/) if you don't find an answer to your question.

If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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 ~4 days

Total

3

Last Release

2246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d75c6945ba7b0540c51e0b24df35b466a1b01a63c2f6f93dc16fac29dbd09dcd?d=identicon)[tsukasagenesis](/maintainers/tsukasagenesis)

---

Tags

alldebridphpapiwrapperalldebrid

### Embed Badge

![Health badge](/badges/alldebrid-alldebrid-php/health.svg)

```
[![Health](https://phpackages.com/badges/alldebrid-alldebrid-php/health.svg)](https://phpackages.com/packages/alldebrid-alldebrid-php)
```

###  Alternatives

[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[wtfzdotnet/php-tmdb-api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

4282.9k](/packages/wtfzdotnet-php-tmdb-api)[walle89/swedbank-json

Unofficial API client for the Swedbank's and Sparbanken's mobile apps in Sweden.

752.5k](/packages/walle89-swedbank-json)

PHPackages © 2026

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