NAV Navbar
PHP cURL

General informations

Introduction

Welcome to the Alldebrid API v4 ! You can use this API to access various Alldebrid services from custom applications or scripts.

Our API is organized around REST, returns JSON-encoded responses and use standard HTTP response codes.

All calls are to be made on the HTTPS endpoints. Some are public, others require to be authentificated with an apikey (see Authentication).

You must also identify your apps or script with a meaningfull agent parameter.

This API version is namespaced as v4, as such all endpoint start with /v4/, such like http://api.alldebrid.com/v4/ping?agent=apiShowcase.

This API v4 should be the final version regarding general response format and errors (hopefully).

You are encouraged to migrate to this version if you have any apps or script using previous version of this API, as the old one will be deprecated around spring 2020. The old documentation can be found here.

If you have any issue or question, feel free to contact us.

Response format

<?php
$apiEndpoint = "http://api.alldebrid.com/v4/ping?agent=myAppName";
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "http://api.alldebrid.com/v4/ping?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "ping": "pong"
    }
}
<?php
$apiEndpoint = "http://api.alldebrid.com/v4/endpointDontExist?agent=myAppName";
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "http://api.alldebrid.com/v4/endpointDontExist?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "error",
    "error": {
        "code": "404",
        "message": "Endpoint doesn't exist"
    }
}

All responses return JSON with 2 attributes. The status attribute is always returned, and has a value of either success or error.

If the response is valid, you will get "status" : "success" and a data attribute, containing the response data.

If the request is invalid or an error occured, you will get "status" : "error" and an error attribute, containing the error details. All error codes and messages can be found in the errors section.

If a request doesn't return valid JSON or JSON without a status attribute, you can consider that this request failed.

This API also use HTTP status code to signal how a request went through. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a linkunlocking, etc.). Codes in the 5xx range indicate an error with Alldebrid's servers (these are rare).

HTTP Status Description
200 - OK Everything worked as expected
400 - Bad Request The request was unacceptable, often due to missing a required parameter
401 - Unauthorized Authentication error, see Authentication
404 - Not Found Api endpoint doesn't exist
429 - Too Many Requests Too many requests hit the API too quickly, see Rate limiting
500, 502, 503, 504 - Server Errors Something went wrong on Alldebrid's end

Authentication

<?php
$apiEndpoint = "http://api.alldebrid.com/v4/ping?agent=myAppName"; // Public endpoint, no need for apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "http://api.alldebrid.com/v4/ping?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "ping": "pong"
    }
}
<?php
$apiEndpoint = "http://api.alldebrid.com/v4/user?agent=myAppName"; // Authentificated endpoint with no apikey
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "http://api.alldebrid.com/v4/user?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "error",
    "error": {
        "code": "AUTH_MISSING_APIKEY",
        "message": "The auth apikey was not sent"
    }
}
<?php
$apiEndpoint = "http://api.alldebrid.com/v4/user?agent=myAppName"; // Authentificated endpoint with valid apikey
$authHeader = 'Authorization: Bearer someValidApikeyYouGenerated';
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true, 'header' => '' ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

// OR with GET param

$apiEndpoint = "http://api.alldebrid.com/v4/user?agent=myAppName&apikey=someValidApikeyYouGenerated"; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "http://api.alldebrid.com/v4/user?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "user": {
            // (...)
        }
    }
}

The Alldebrid API uses API keys to authenticate requests. You can view and manage your API keys in your Apikey dashboard, or generate them remotely (with user action) through the PIN flow.

You can send the apikey either in an Authorization: Bearer YourApikeyHere header, or directly in the url with a apikey=YourApikeyHere query parameter.

You'll also need to identify your software or script by a meaningful agent parameter (your software user-agent). Try to make it explicit, like the name of your software, script or library.

All endpoints need a valid agent and apikey except for a few public endpoints that are documented as such.

The following errors can be returned if your authentication fails.

Code Description
AUTH_MISSING_AGENT You must send a meaningful agent parameter
AUTH_BAD_AGENT Bad agent
AUTH_MISSING_APIKEY The auth apikey was not sent
AUTH_BAD_APIKEY The auth apikey is invalid
AUTH_BLOCKED This apikey is geo-blocked or ip-blocked
AUTH_USER_BANNED This account is banned

Rate limiting

There is rate limiting in place for the API.

Current limits are at 12 requests per second and 600 requests per minute.

Any request in excess of those limits will return a 429 or 503 errors.

If you intend to make more requests than those limits, please consider throttling or grouped calls.

Recent modifications

30/03/2020

27/03/2020

26/03/2020

04/03/2020

03/03/2020

01/03/2020

28/02/2020

06/02/2020

Pin auth

You can authenticate users in your application by using a PIN-auth flow. The steps are :

  1. Get a pin code and display it to the user

  2. The user submits the pin code on the Alldebrid pin page

  3. Once submitted, the auth apikey will be available on the api

Get pin

<?php

$apiEndpoint = "https://api.alldebrid.com/v4/pin/get?agent=myAppName"; // Public endpoint, no need for apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "https://api.alldebrid.com/v4/pin/get?agent=myAppName"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "pin": "ABCD",
        "check": "664c3ca2635c99f291d28e11ea18e154750bd21a",
        "expires_in": 600,
        "user_url": "https:\/\/alldebrid.com\/pin\/?pin=ABCD",
        "base_url": "https:\/\/alldebrid.com\/pin\/",
        "check_url": "https:\/\/api.alldebrid.com\/pin\/check?check=664c3ca2635c99f291d28e11ea18e154750bd21a&pin=ABCD&agent=myAppName"
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/pin/get?agent=myAppName (Test it live)

Response attributes

Key Type Description
pin String Pin code to display to your user
check String Hash needed for the pin/check call
expires_in Interger Number of second before the code expire
user_url String Url to display with PIN included
base_url String Base url
check_url String Endpoint to pool to get auth apikey once user submitted the PIN code

Check the pin status

<?php

// Full flow in action

$apiEndpoint = "https://api.alldebrid.com/v4/pin/check?agent=myAppName&check=960e43f9c1946716d1bd3489508f769737427b73&pin=EC79";
$pinInfo = json_decode(file_get_contents($apiEndpoint), true);

do {
    $pinCheck = json_decode(file_get_contents($pinInfo["check_url"]), true);
    if ($pinCheck["success"] == false) 
        die ("Either PIN has expired or check endpoind is invalid, check errorCode");

    sleep(5);
}
while ($pinCheck["activated"] == false);

$authApikey = $pinCheck["apikey"];
curl -G --data-urlencode "check=960e43f9c1946716d1bd3489508f769737427b73" --data-urlencode "pin=EC79" "https://api.alldebrid.com/v4/pin/check?agent=myAppName"

This check endpoint returns JSON structured like this if the PIN hasn't been submitted yet :

{
    "status": "success",
    "data": {
        "activated": false,
        "expires_in": 581
    }
}

Once the PIN has been submitted, the endpoin returns JSON structured like this if the PIN hasn't been submitted yet :

{
    "status": "success",
    "data": {
        "apikey": "abcdefABCDEF12345678",
        "activated": true,
        "expires_in": 570
    }
}

HTTP Request

The endpoint where the auth apikey will be available after the user submitted the PIN code on the Alldebrid website. The endpoint is available for 10 minutes after the PIN code is generated.

You should pool on the endpoint until the user has submitted the PIN code and an auth apikey is returned, or until the endpoint expires after 600 seconds.

GET https://api.alldebrid.com/v4/pin/check?agent=myAppName&check=KEY&pin=PIN

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string User apikey.
check true string Random hash from check_url given in /pin/get
pin true string Pin code from check_url given in /pin/get

Response attributes

Key | Always returned | Type | Description --------- | ---- | ----------- activated | Yes | Boolean | false if user didn't enter the pin on website yet expires_in | Yes | Integer | Seconds left before PIN expires apikey | No | String | Auth apikey, available once user has submitted the pin code.

Endpoint errors

Code Description
PIN_EXPIRED The pin has expired
PIN_INVALID This endpoint check parameter is invalid

Hosts

Use these endpoints to get a list of all the hosts we support, and the services of redirection (adf.ly, bit.ly) or protection we can extract links from.

If you want a live list of hosts the user can actually use depending on its subscription status, please use the authentificated /user/host endpoint.

Please consider caching the result of these calls for a few hours.

Supported hosts

<?php
$apiEndpoint = "https://api.alldebrid.com/v4/hosts?agent=myAppName"; // Public endpoint, authentication apikey is optional
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "https://api.alldebrid.com/v4/hosts?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "hosts": {
            "uptobox": {
                "name": "uptobox",
                "type": "premium",
                "domains": ["uptobox.com", "uptostream.com"],
                "regexp": "(uptostream\\.com\/iframe\/([0-9a-zA-Z]{12}))|((uptostream|uptobox)\\.com\/([0-9a-zA-Z]{12}))",
                "status": true
            }
        },
        "streams": {
            "twitch": {
                "name": "twitch",
                "type": "free",
                "domains": [
                    "twitch.tv",
                    "player.twitch.tv",
                    "m.twitch.tv",
                    "go.twitch.tv",
                    "clips.twitch.tv"
                ],
                "regexp": "(https?:\/\/(?:(?:www|go|m)\\.)?twitch\\.tv\/[^\/]+\/b\/(?P<id>\\d+))|(https?:\/\/(?:(?:www|go|m)\\.)?twitch\\.tv\/(?P<id>[^\/]+)\/videos\/highlights)",
            },
        },
        "redirectors": {
            "dlprotect": {
                "name": "dlprotect",
                "type": "premium",
                "domains": [
                    "dl-protect1.com",
                    "dl-protect1.co"
                ],
                "regexp": "((dl-protect1.com\/[0-9a-z]+))|((dl\\-protect1\\.co\/go\/[0-9a-zA-Z_\\-]+))|((dl\\-protect\\.net\/[0-9a-z]+))"
            }
        }
    }
}

Use this endpoint to retrieve informations about what hosts we support and all related informations about it.

HTTP Request

GET https://api.alldebrid.com/v4/hosts (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.
hostsOnly false Endpoint will only return "hosts" data

Host object

Key Always returned type Description
name Yes String Host name.
type Yes String Either "premium" or "free". Premium hosts need a premium subscription.
domains Yes Array of String Host domains.
regexp Yes String Rgexp matching link format that Alldebrid supports.
status No Boolean Is the host currently (< 5 min) working on Alldebrid (only tested on some hosts, updated every ~ 10 min).

Domains only

<?php
$apiEndpoint = "https://api.alldebrid.com/v4/hosts/domains?agent=myAppName"; // Public endpoint, authentication apikey is optional
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "https://api.alldebrid.com/v4/hosts/domains?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "hosts": ["uptobox.com", "uptostream.com", "vimeo.com"],
        "streams": ["youtube.com", "youtu.be", "twitch.tv"],
        "redirectors": ["dl-protecte.com", "dl-protecte.org", "adf.ly"]
    }
}

Use this endpoint to only retrieve the list of supported hosts domains and redirectors as an array. This will also include any alternative domain the hosts or redirectors have. Please use regexps availables in /hosts or /user/hosts endpoints to validate supported links.

GET https://api.alldebrid.com/v4/hosts/domains (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.

Hosts regexp

<?php
$apiEndpoint = "https://api.alldebrid.com/v4/hosts/regexp?agent=myAppName"; // Public endpoint, authentication apikey is optional
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "https://api.alldebrid.com/v4/hosts/regexp?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "hosts": {
            "uptobox.com": "uptostream\\.com\/iframe\/([0-9a-zA-Z]{12})|(uptostream|uptobox)\\.com\/([0-9a-zA-Z]{12})",
            "bayfiles.com": "(bayfiles\\.com\/[0-9a-zA-Z]{10})"
        },
        "redirectors": {
            "adf.ly": "(adf\\.ly\/[0-9]+\/(https?:\/\/[^ \"'<>]+))|(adf\\.ly\/[0-9a-zA-Z]+)",
            "bit.ly": "(bit\\.ly\/[0-9a-zA-Z]+)"
        }
    }
}

Use this endpoint to retrieve a list of regexp matching all our supported hosts and redirectors.

GET https://api.alldebrid.com/v4/hosts/regexp (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.

Hosts priority

<?php
$apiEndpoint = "https://api.alldebrid.com/v4/hosts/priority?agent=myAppName"; // Public endpoint, authentication apikey is optional
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl "https://api.alldebrid.com/v4/hosts/priority?agent=myAppName"

The above request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "hosts": {
            "uptobox": 1,
            "1fichier": 2,
            "4shared": 3,
            "backin": 4,
            "bdupload": 5
        }
    }
}

Not all hosts are created equal, so some hosts are more limited than other.

Use this endpoint to retrieve an ordered list of main domain of hosts, from more open to more restricted.

GET https://api.alldebrid.com/v4/hosts/priority (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.

User

Informations

<?php

$apiEndpoint = "https://api.alldebrid.com/v4/user?agent=myAppName&apikey=someValidApikeyYouGenerated"; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "https://api.alldebrid.com/v4/user?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "user": {
            "username": "MyUsername",
            "email": "some.email@example.com",
            "isPremium": true,
            "isTrial": false,
            "premiumUntil": "1545757200",
            "lang": "fr",
            "preferedDomain": "fr",
            "fidelityPoints": 200,
            "limitedHostersQuotas": {
                "someHost": 1024,
                "otherHost": 5000,
                "oneLast": 2000
            }
        }
    }
}

Use this endpoint to get user informations.

HTTP Request

GET https://api.alldebrid.com/user?agent=myAppName&apikey=someValidApikeyYouGenerated (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.
apikey true User apikey.

Response attributes

Key Type Description
user Object User data.

User object

Key Always returned Type Description
username Yes String User username.
email Yes String User email.
isPremium Yes Boolean true is premium, false if not.
isTrial Yes Boolean true is account is in freedays trial, false if not.
premiumUntil Yes Integer 0 if user is not premium, or timestamp until user is premium.
lang Yes String Language used by the user on Alldebrid, eg. 'en', 'fr'. Default to fr.
preferedDomain Yes String Preferer TLD used by the user, eg. 'fr', 'es'. Default to fr.
fidelityPoints Yes Integer Number of fidelity points.
limitedHostersQuotas Yes Array Remaining quotas for the limited hosts (in MB).
remainingTrialQuota No Integer When in trial mode, remaining global traffic quota available (in MB).

Available hosts

<?php


$apiEndpoint = "https://api.alldebrid.com/v4/user/hosts?agent=myAppName&apikey=someValidApikeyYouGenerated"; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "https://api.alldebrid.com/v4/user/hosts?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "hosts": {
            "uptobox": {
                "name": "uptobox",
                "type": "premium",
                "domains": ["uptobox.com", "uptostream.com"],
                "regexp": "(uptobox\.com/[0-9a-zA-Z]+(/.*)?)|uptostream\.com/([0-9a-zA-Z]{12})",
                "status": true
            }
        },
        "streams": {
            "youtube": {
                "name": "youtube",
                "type": "free",
                "domains": [ "youtube.com", "youtu.be" ],
                "regexps": [ "https?:\/\/(?:www\\.)?youtube\\.com\/show\/(?P<id>[^?#]*)", "https?:\/\/(?:www\\.)?youtube\\.com\/feed\/history|:ythistory" ],
            }
        },
        "redirectors": {
            "dlprotecte": {
                "name": "dlprotecte",
                "type": "premium",
                "domains": ["dl-protecte.com", "dl-protecte.org", "protect-lien.com"],
                "regexp": "(dl-protecte\.com/[0-9a-zA-Z]+)|(protect-lien\.com/[0-9a-zA-Z]+)|dl-protecte\.org/([0-9a-zA-Z]+)"
            }
        }
    }
}

This endpoint retrieves a complete list of all available hosts for this user. Depending of the account subscription status (free user, trial mode, premium user), the list and limitations will vary.

The limits and quota are updated in real time. Use this page to have an up-to-date list of service the user can use on Alldebrid.

Quotas will reset every day for premium users.

HTTP Request

GET https://api.alldebrid.com/v4/user/hosts?agent=myAppName&apikey=someValidApikeyYouGenerated (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.
apikey true User apikey.
hostsOnly false Endpoint will only return "hosts" data

Response attributes

Key Type Description
hosts Object Hosts infos.
streams Object Streaming websites infos.
redirectors Object Redirectors infos.

Host object

Key Always returned type Description
name Yes String Host name.
type Yes String Either "premium" or "free". Premium hosts need a premium subscription.
domains Yes Array Host domains.
regexps Yes Array Regexps matching the supported urls for this host.
status No Boolean Is the host currently (< 5 min) working on Alldebrid (only tested on some hosts, updated every ~ 10 min).
quota No Integer Remaining quota for this host, if any.
quotaType No String Specify if the quota is the remaining traffic available in MB ("traffic" type) or the number of remaining downloads possible ("nb_download" type)
limitSimuDl No Integer We limit the number of simultaneous downloads for some hosts, this will display the remaining download slot available for the user at this time.

Links

Informations

<?php
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400

// Authentificated endpoints with valid apikey
$apiEndpointSingleLink = "https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated&link[]=" . urlencode("http://uptobox.com/l1ub83vil5c3");
$apiEndpointSingleLinkWithPass = "https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated&link[]=" . urlencode("http://uptobox.com/l1ub83vil5c3") . "&password=" . urlencode("somePassword");
$apiEndpointMultipleLinks = "https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated&link[]=" . urlencode("http://uptobox.com/l1ub83vil5c3") . "&link[]=" . urlencode("http://uptobox.com/l1ub83vil5c4");

$linkInfos =  json_decode(file_get_contents($apiEndpointSingleLink, false, $context));
$linksInfos =  json_decode(file_get_contents($apiEndpointMultipleLinks, false, $context));
curl -G --data-urlencode "link[]=http://uptobox.com/l1ub83vil5c3" "https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated"

The single link request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "infos": [
            {
                "link": "https:\/\/uptobox.com\/l1ub83vil5c3",
                "filename": "ubuntu-18.04.1-server-amd64.iso",
                "size": 699400192,
                "host": "uptobox",
                "hostDomain": "uptobox.com",
            }
        ]
    }
}

The multiple links request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "infos": [
            {
                "link": "https:\/\/uptobox.com\/l1ub83vil5c3",
                "filename": "ubuntu-18.04.1-server-amd64.iso",
                "size": 699400192,
                "host": "uptobox",
                "hostDomain": "uptobox.com",

            },
            {
                "link": "https:\/\/uptobox.com\/l1ub83vil5c4",
                "filename": "ubuntu-16.04.1-server-amd64.iso",
                "size": 699458755,
                "host": "uptobox",
                "hostDomain": "uptobox.com",
            },
            {
                "link": "http:\/\/example.com",
                "error": {
                    "code": "LINK_HOST_NOT_SUPPORTED",
                    "message": "This host or link is not supported",
                }  
            }
        ]
    }
}

Use this endpoint to retrieve informations about a link. If it is in our systems, you'll have the filename and size (if available).

If the host is not supported or the link is down, an error will be returned for that link.

This endpoint only support host links, not redirectors links. Use the link/redirector endpoint for this.

HTTP Request

GET https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated&link[]=LINK (Test it live)

GET https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated&link[]=LINK&password=PASSWORD

GET https://api.alldebrid.com/v4/link/infos?agent=myAppName&apikey=someValidApikeyYouGenerated&link[]=LINK1&link[]=LINK2 (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.
link[] true string|array The link or array of links you request informations about.
password false string Link password (supported on uptobox / 1fichier).

Response attributes

Key Type Description
infos Array Array of info objects

Info object

Key Type Description
link string Requested link
filename string Link's file filename.
size Integer Link's file size in bytes.
host string Link host.
hostDomain string Host main domain
Code Description
LINK_IS_MISSING No link was sent
LINK_HOST_NOT_SUPPORTED This host or link is not supported
LINK_DOWN This link is not available on the file hoster website
LINK_PASS_PROTECTED Link is password protected

Redirectors

<?php
$apiEndpoint = "https://api.alldebrid.com/v4/link/redirector?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode("http://uptobox.com/l1ub83vil5c3"); // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl -G --data-urlencode "link=http://uptobox.com/l1ub83vil5c3" "https://api.alldebrid.com/v4/link/redirector?agent=myAppName&apikey=someValidApikeyYouGenerated"

The request returns JSON structured like this :

{
    "status": "success",
    "data": {
        "links": ["http:\/\/uptobox.com\/l1ub83vil5c3", "http://uptobox.com/apkb822il5c4"]
    }
}

Use this endpoint to retrieve links protected by a redirector or link protector.

HTTP Request

GET https://api.alldebrid.com/v4/link/redirector?agent=myAppName&apikey=someValidApikeyYouGenerated&link=LINK (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.
link true string The redirector or protector link to extract links.

Response attributes

Key Type Description
links array Link(s) extracted.

Errors

Code Description
REDIRECTOR_NOT_SUPPORTED Redirector not supported.
REDIRECTOR_ERROR Could not extract links.
<?php

$link = "http://uptobox.com/l1ub83vil5c3";
$apiEndpoint = "https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode($link);
$apiEndpointWithPassword = "https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode($link) . "&password=" . urlencode('somePassword');
// Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl -G --data-urlencode "link=http://uptobox.com/l1ub83vil5c3" "https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "link": "http:\/\/ombfyx.alld.io\/dl\/abcdefgh12\/ubuntu-16.04.1-server-amd64.iso",
        "host": "uptobox",
        "filename": "ubuntu-16.04.1-server-amd64.iso",
        "paws": false,
        "filesize": 699400192,
        "streams": [
            //(...)
        ],
        "id": "abcdefgh12",
        "hostDomain": "uptobox.com"
}

This endpoint unlocks a given link.

This endpoint can return a delayed ID. In that case, you must follow the delayed link flow.

HTTP Request

GET https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated&link=LINK (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.
link true string The link to unlock.
password false string Link password (supported on uptobox / 1fichier).

Response attributes

Key Type Description
link String Requested link, simplified if it was not in canonical form.
filename string Link's file filename.
host String Link host minified.
streams Array List of alternative links with other resolutions for some video links. See code example for more infos.
paws Boolean Unused.
filesize Interger Filesize of the link's file.
id Integer Generation ID
hostDomain String Matched host main domain
delayed Integer Delayed ID if link need time to generate

Errors

Code Description
LINK_HOST_NOT_SUPPORTED This link is not supported.
LINK_DOWN This link is not available on the file hoster website.
LINK_HOST_UNAVAILABLE Host under maintenance or not available.
LINK_TOO_MANY_DOWNLOADS Too many concurrent downloads.
LINK_HOST_FULL All servers are full for this host, please retry later.
LINK_HOST_LIMIT_REACHED You have reached the download limit for this host.
LINK_PASS_PROTECTED Link is password protected.
LINK_ERROR Generic unlocking error.
MUST_BE_PREMIUM You must be premium to process this link.
FREE_TRIAL_LIMIT_REACHED You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial).
NO_SERVER Server are not allowed to use this feature
<?php
// Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400

$link = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
$apiEndpoint = "https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode($link);
$apiEndpointWithPassword = "https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode($link);

$streamLinkInfos = json_decode(file_get_contents($apiEndpoint, false, $context));


$id = $streamLinkInfos['id'];
$stream = $streamLinkInfos['streams'][0]['id'];

$apiEndpoint = "https://api.alldebrid.com/v4/link/streaming?agent=myAppName&apikey=someValidApikeyYouGenerated&id=" . urlencode($id) . "&stream=" . urlencode($stream);

$streamLinkDLInfos = $response = json_decode(file_get_contents($apiEndpoint, false, $context));
curl -G --data-urlencode "id=123456" "https://api.alldebrid.com/v4/link/streaming?agent=myAppName&apikey=someValidApikeyYouGenerated"

The first request to get stream links infos, returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "link": "",
        "host": "stream",
        "filename": "Rick Astley - Never Gonna Give You Up (Video)",
        "filesize": 0,
        "id": "1nsjw3315ad",
        "streams": [{
                "id": "140",
                "ext": "mp3",
                "quality": "mp3",
                "filesize": 3433538,
                "proto": "https",
                "name": "",
                "tb": 130.621,
                "abr": 128
            },
            {
                "id": "137+140",
                "ext": "mp4",
                "quality": 1080,
                "filesize": 75910363,
                "proto": "https",
                "name": ""
            },
            {
                "id": "398+140",
                "ext": "mp4",
                "quality": 720,
                "filesize": 32752789,
                "proto": "https",
                "name": ""
            },
        ]
    }
}

The second request returns JSON structured like this if successfull :

    "status": "success",
    "data": {
        "link": "https://p1cjev.alldeb.ovh/dl/1nsjw3315ad/Rick%20Astley%20-%20Never%20Gonna%20Give%20You%20Up%20%28Video%29.360.mp4",
        "filename": "Rick Astley - Never Gonna Give You Up (Video).360.mp4",
        "filesize": 113129149
    }
}

The second request returns JSON structured like this if successfull, is case of delayed link :

{
    "status": "success",
    "data": {
        "filename": "Rick Astley - Never Gonna Give You Up (Video).360.mp4",
        "filesize": 113129149,
        "delayed": 2277564
    }
}

The unlocking flow for streaming link is a bit more complex.

First hit the usual link/unlock endpoint. Two cases :

  1. Stream link has only one quality : downloading link is available immediatly.

OR

  1. Stream links has multiple qualities : you must select the desired quality to obtain a download link or delayed id by using the link/streaming endpoint.

Depending of the stream website, you'll either get a download link, or a delayed id (see Delayed link section for delayed links).

HTTP Request

GET https://api.alldebrid.com/v4/link/streaming?agent=myAppName&apikey=someValidApikeyYouGenerated&id=ID&stream=STREAMID (Test it live)

GET https://api.alldebrid.com/v4/link/unlock?agent=myAppName&apikey=someValidApikeyYouGenerated&link=LINK&password=PASSWORD

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.
id true string The link ID you received from the /link/unlock call.
stream true string The stream ID you choosed from the stream qualities list returned by /link/unlock.

Response attributes

Key Type Description
link String Optional. Download link, ONLY if available. This attribute WONT BE RETURNED if download link is a delayed link.
filename string Link's file filename.
filesize Interger Filesize of the link's file.
delayed Interger Optional. Delayed ID to get download link with delayed link flow (see next section)

Errors

Code Description
STREAM_INVALID_GEN_ID Invalid generation ID
STREAM_INVALID_STREAM_ID Invalid stream ID
<?php

$delayedID = 2457; // From /link/unlock
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$apiEndpoint = "https://api.alldebrid.com/v4/link/delayed?agent=myAppName&apikey=someValidApikeyYouGenerated&id=" . urlencode($link); // Authentificated endpoint with valid apikey

$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl -G --data-urlencode "id=123456" "https://api.alldebrid.com/v4/link/delayed?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if still delayed :

{
    "status": "success",
    "data": {
        "status": 1,
        "time_left": 45
    }
}

The above request returns JSON structured like this if link is available :

{
    "status": "success",
    "data": {
        "status": 2,
        "time_left": 0,
        "link": "http:\/\/ombfyx.alld.io\/dl\/abcdefgh12\/ubuntu-16.04.1-server-amd64.iso"
    }
}

This endpoint give the status of a delayed link.

Some links need time to generate, this endpoint send the status of such delayed links.

You should pool every 5 seconds or more the link/delayed endpoint until given the download link.

HTTP Request

GET https://api.alldebrid.com/v4/link/delayed?agent=myAppName&apikey=someValidApikeyYouGenerated&id=ID (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.
id true integer Delayed ID received in /link/unlock.

Response attributes

Key Always returned Type Description
status Yes Integer Current status.
time_left Yes Integer Estimated time left to wait.
link No String Download link, available when it is ready.

Status code

Status Description
1 Still processing.
2 Download link is available.
3 Error, could not generate download link.

Errors

Code Description
DELAYED_INVALID_ID This delayed link id is invalid

Magnet

Upload magnet

Upload a magnet with its URI or hash.

You can either send the magnets in GET parameters, or in POST.

<?php
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400

$magnet1 = 'magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso';
$magnet2 = '6be434d1f4ebefa14c4051e4bb0543cf47a8';
$magnet3 = '194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43';
// Authentificated endpoint with valid apikey
$apiEndpoint = "https://api.alldebrid.com/v4/magnet/upload?agent=myAppName&apikey=someValidApikeyYouGenerated&magnets[]=" . urlencode($magnet1) . "&magnets[]=" . urlencode($magnet2)  . "&magnets[]=" . urlencode($magnet3);
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

// OR with POST

$magnet1 = 'magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso';
$magnet2 = '6be434d1f4ebefa14c4051e4bb0543cf47a8';
$magnet3 = '194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43';

$ch = curl_init('https://api.alldebrid.com/v4/magnet/upload?agent=myAppName&apikey=E2XJrLFrlt30BW29qgqc');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'magnets[]='.$magnet1.'&magnets[]='.$magnet2.'&magnets[]='.$magnet2 );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);


curl -G \
    --data-urlencode "magnets[]=magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso" \
    --data-urlencode "magnets[]=6be434d1f4ebefa14c4051e4bb0543cf47a8" \
    --data-urlencode "magnets[]=194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43" \
    "https://api.alldebrid.com/v4/magnet/upload?agent=myAppName&apikey=someValidApikeyYouGenerated"

curl -X POST \
    -F "magnets[]=magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso" \
    -F "magnets[]=6be434d1f4ebefa14c4051e4bb0543cf47a8" \
    -F "magnets[]=194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43" \
    "https://api.alldebrid.com/v4/magnet/upload?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "magnets" : [
            {
                "magnet": "magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso",
                "hash": "842783e3005495d5d1637f5364b59343c7844707",
                "name": "ubuntu-18.04.2-live-server-amd64.iso",
                "size": 875773970,
                "ready": true,
                "id": 123456
            },
            {
                "magnet": "6be434d1f4ebefa14c4051e4bb0543cf47a8",
                "error": {
                    "code": "MAGNET_INVALID_URI",
                    "message": "Magnet is not valid"
                }
            },
            {
                "magnet": "194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43",
                "hash": "194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43",
                "name": "ubuntu-18.04.3-live-server-amd64.iso",
                "size": 9024340026,
                "ready": true,
                "id": 234567
            }
        ]  
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/magnet/upload?agent=myAppName&apikey=someValidApikeyYouGenerated&magnets[]=MAGNET (Test it live)

POST https://api.alldebrid.com/v4/magnet/upload?agent=myAppName&apikey=someValidApikeyYouGenerated

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.
magnets[] true string Magnet(s) URI or hash. Must send magnet either in GET param or in POST data.

Response attributes

Key Type Description
magnets Array Array of magnet objects

Magnet object

Key Type Description
magnet string Magnet sent.
name string Magnet filename, or 'noname' if could not parse it.
id integer Magnet id, used to query status.
hash string Magnet hash.
size integer Magnet files size.
ready boolean Whether the magnet is already available.

Endpoint errors

Code Description
MAGNET_NO_URI No magnet provided.
MAGNET_INVALID_URI Magnet is not valid.
MAGNET_MUST_BE_PREMIUM You must be premium to use this feature.
MAGNET_NO_SERVER Server are not allowed to use this feature.
MAGNET_TOO_MANY_ACTIVE Already have maximum allowed active magnets (30).

Upload file

Upload torrent files.

This endpoint should be POSTed on. It expects a multipart formdata file upload.

<?php

$filePath = 'ubuntu-18.04.2-live-server-amd64.iso.torrent';
$file = new CURLFile($filePath, 'application/x-bittorrent');

$filePath2 = 'not.a.torrent.zip';
$file2 = new CURLFile($filePath2, 'application/x-bittorrent');

$ch = curl_init('https://api.alldebrid.com/v4/magnet/upload/file?agent=myAppName&apikey=someValidApikeyYouGenerated');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['files[0]' => $file, 'files[1]' => $file2 ]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

curl -X POST \
    -F "files[]=@ubuntu-16.04.6-desktop-amd64.iso.torrent" \
    -F "files[]=@ubuntu-18.04.2-live-server-amd64.iso.torrent" \
    "https://api.alldebrid.com/v4/magnet/upload/file?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "files": [
            {
                "file": "ubuntu-18.04.2-live-server-amd64.iso.torrent",
                "name": "Ubuntu 18.04.2 live server amd64",
                "size": 1954210119,
                "hash": "842783e3005495d5d1637f5364b59343c7844707",
                "ready": false,
                "id": 123456
            },
            {
                "file": "not.a.torrent.zip",
                "error": {
                    "code": "MAGNET_INVALID_FILE",
                    "message": "File is not a valid torrent"
                }
            }
        ]
    }
}

HTTP Request

POST https://api.alldebrid.com/v4/magnet/upload/file?agent=myAppName&apikey=someValidApikeyYouGenerated

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string Valid authentication apikey.

Response attributes

Key Type Description
files array array of file objects

File object

Key Type Description
file string File name sent.
name string Torrent filename, or 'noname' if could not parse it.
hash string Torrent hash.
id integer Torrent id, used to query status.
size integer Torrent files size.
ready boolean Whether the torrent is already available.

Endpoint errors

Code Description
MAGNET_INVALID_FILE File is not a valid torrent
MAGNET_MUST_BE_PREMIUM You must be premium to use this feature.
MAGNET_NO_SERVER Server are not allowed to use this feature.
MAGNET_TOO_MANY_ACTIVE Already have maximum allowed active magnets (30).
MAGNET_FILE_UPLOAD_FAILED File upload failed

Status

Get the status of current magnets, or only one if you specify a magnet ID.

<?php
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400

// Authentificated endpoint with valid apikey
$magnetID = 123456;
$apiEndpoint = "https://api.alldebrid.com/v4/magnet/status?agent=myAppName&apikey=someValidApikeyYouGenerated";
$apiEndpointOnlyOne = "https://api.alldebrid.com/v4/magnet/status?agent=myAppName&apikey=someValidApikeyYouGenerated&id=" . urlencode($magnetID);

$response = json_decode(file_get_contents($apiEndpoint, false, $context));


curl -G --data-urlencode "id=123456" "https://api.alldebrid.com/v4/magnet/status?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request could return JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "magnets": [
        {
            "id": 123456,
            "filename": "ubuntu-16.04.2-live-server-amd64.iso",
            "size": 587400285,
            "status": "Downloading",
            "statusCode": 1,
            "downloaded": 255400192,
            "uploaded": 0,
            "seeders": 7,
            "downloadSpeed": 18874368,
            "uploadSpeed": 0,
            "uploadDate": 1557133868,
            "links": []
        }, {
            "id": 234567,
            "filename": "ubuntu-18.04.2-live-server-amd64.iso",
            "size": 699400192,
            "status": "Ready",
            "statusCode": 4,
            "downloaded": 699400192,
            "uploaded": 0,
            "seeders": 7,
            "downloadSpeed": 0,
            "uploadSpeed": 0,
            "uploadDate": 1557133868,
            "links": [
                {
                    "link": "http:\/\/uptobox.com\/aaaabbbbcccc",
                    "filename": "ubuntu-18.04.2-live-server-amd64.iso",
                    "size": 685458252,
                    "files": null
                },
                {
                    "link": "http:\/\/uptobox.com\/aaaabbbbdddd",
                    "filename": "ubuntu-18.04.2-live-server-amd64.rar",
                    "size": 7845117,
                    "files": [
                        "README.txt",
                        "some.other.file.zip"
                    ]
                }
            ],
        }]
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/magnet/status?agent=myAppName&apikey=someValidApikeyYouGenerated&id=MAGNETID (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string User apikey.
id false interger Magnet ID.

Response attributes

Key Type Description
magnets array Array of magnet objects

Magnet object

Key Type Description
id integer Magnet id.
filename string Magnet filename.
size integer Magnet filesize.
status string Status in plain English.
statusCode integer Status code. See next table.
downloaded integer Downloaded data so far.
uploaded integer Uploaded data so far.
seeders integer Seeders count.
downloadSpeed integer Download speed.
uploadSpeed integer Upload speed.
uploadDate integer Timestamp of the upload date of the magnet.
links array of object an array of link objects
Key Type Description
link integer Download link
filename string File name
size integer File size.
files string|null If multiple files were packed together in a rar files, list the first 200 file names. Null if only one file was sent.

Status code

Code Type Description
0 Processing In Queue.
1 Processing Downloading.
2 Processing Compressing / Moving.
3 Processing Uploading.
4 Finished Ready.
5 Error Upload fail.
6 Error Internal error on unpacking.
7 Error Not downloaded in 20 min.
8 Error File too big.
9 Error Internal error.
10 Error Download took more than 72h.
11 Error Deleted on the hoster website

Endpoint errors

Code Description
MAGNET_INVALID_ID Magnet ID is invalid.

Delete

Delete a magnet.

<?php

$magnetID = 123456;
$apiEndpoint = "https://api.alldebrid.com/v4/magnet/delete?agent=myAppName&apikey=someValidApikeyYouGenerated&id=" . $magnetID; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));


curl -G --data-urlencode "id=123456" "https://api.alldebrid.com/v4/magnet/delete?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "message": "Magnet was successfully deleted"
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/magnet/delete?agent=myAppName&apikey=someValidApikeyYouGenerated&id=MAGNETID (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string User apikey.
id true integer Magnet ID.

Endpoint errors

Code Description
MAGNET_INVALID_ID Magnet ID is invalid

Restart

Restart a failed magnet.

<?php

$magnetID = 123456;
$apiEndpoint = "https://api.alldebrid.com/v4/magnet/restart?agent=myAppName&apikey=someValidApikeyYouGenerated&id=" . $magnetID; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));


curl -G --data-urlencode "id=123456" "https://api.alldebrid.com/v4/magnet/restart?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "message": "Magnet was successfully restarted"
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/magnet/restart?agent=myAppName&apikey=someValidApikeyYouGenerated&id=MAGNETID (Test it live)

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string User apikey.
id true integer Magnet ID.

Endpoint errors

Code Description
MAGNET_INVALID_ID Magnet ID is invalid
MAGNET_PROCESSING Magnet is processing or completed

Instant availability

Check if a magnet is available instantly.

You can either send the magnets in GET parameters, or in POST.

<?php
$magnet = 'magnet:?xt=urn:btih:845410b59b212ff4f6c12e0d5dd6c77116d85198&dn=ubuntu-16.04.6-server-arm64.iso';
$magnet2 = '33d414562b3b452680c5b9cedd4eb1a29012b9fe'; // Can also use magnet hash
$magnet2 = 'invalid974668f694948d065530cdfedb1e'; // Can also use magnet hash

// With GET parameters
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
// Authentificated endpoint with valid apikey
$apiEndpoint = "https://api.alldebrid.com/v4/magnet/instant?agent=myAppName&apikey=someValidApikeyYouGenerated&magnets[]=" . urlencode($magnet1) . "&magnets[]=" . urlencode($magnet2)  . "&magnets[]=" . urlencode($magnet3);
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

// With POST
$ch = curl_init('https://api.alldebrid.com/v4/magnet/instant?agent=myAppName&apikey=someValidApikeyYouGenerated');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['magnets[]='. $magnet.'&magnets[]='$magnet2] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl -G \
    --data-urlencode "magnets[]=magnet:?xt=urn:btih:845410b59b212ff4f6c12e0d5dd6c77116d85198&dn=ubuntu-16.04.6-server-arm64.iso" \
    --data-urlencode "magnets[]=33d414562b3b452680c5b9cedd4eb1a29012b9fe" \
    --data-urlencode "magnets[]=invalid974668f694948d065530cdfedb1e" \
    "https://api.alldebrid.com/v4/magnet/instant?agent=myAppName&apikey=someValidApikeyYouGenerated"

curl -X POST \
    -F "magnets[]=magnet:?xt=urn:btih:845410b59b212ff4f6c12e0d5dd6c77116d85198&dn=ubuntu-16.04.6-server-arm64.iso" \
    -F "magnets[]=33d414562b3b452680c5b9cedd4eb1a29012b9fe" \
    -F "magnets[]=invalid974668f694948d065530cdfedb1e" \
    "https://api.alldebrid.com/v4/magnet/instant?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "magnets": [
            {
                "magnet": "magnet:?xt=urn:btih:845410b59b212ff4f6c12e0d5dd6c77116d85198&dn=ubuntu-16.04.6-server-arm64.iso",
                "hash": "845410b59b212ff4f6c12e0d5dd6c77116d85198",
                "instant": true
            },
            {
                "magnet": "33d414562b3b452680c5b9cedd4eb1a29012b9fe",
                "hash": "33d414562b3b452680c5b9cedd4eb1a29012b9fe",
                "instant": false
            },
            {
                "magnet": "invalid974668f694948d065530cdfedb1e",
                "error": {
                    "code": "MAGNET_INVALID_URI",
                    "message": "Magnet is not valid"
                }
            }
        ]
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/magnet/instant?agent=myAppName&apikey=someValidApikeyYouGenerated&magnets[]=MAGNET (Test it live)

POST https://api.alldebrid.com/v4/magnet/instant?agent=myAppName&apikey=someValidApikeyYouGenerated

Query parameters

Parameter Required Type Description
agent true string Your software user-agent.
apikey true string User apikey.

Post parameters

Parameter Required Type Description
magnets[] true string Magnets URI or hash you wish to check instant availability, can be one or many links

Response attributes

Key Type Description
magnet string the magnet sent
hash string the magnet hash
instant boolean if instant or not

Endpoint errors

Code Description
MAGNET_NO_URI No magnet provided
MAGNET_INVALID_URI Bad magnet format

User links

<?php

$apiEndpoint = "https://api.alldebrid.com/v4/user/links?agent=myAppName&apikey=someValidApikeyYouGenerated"; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "https://api.alldebrid.com/v4/user/links?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "links": [
            {
                "link": "https:\/\/uptobox.com\/fx8sx9hcn18s",
                "filename": "ubuntu-16.04.6-desktop-amd64.iso",
                "size": 751267520,
                "date": 1569420668,
                "host": "uptobox"
            },
            {
                "link": "https:\/\/uptobox.com\/62srxw1y1a8p",
                "filename": "ubuntu-18.04.2-live-server-amd64.iso",
                "size": 795126720,
                "date": 1569420668,
                "host": "uptobox"
            },
            {
                "link": "http:\/\/youtube.com\/watch?v=dQw4w9WgXcQ",
                "filename": "",
                "size": 0,
                "date": 1583253075,
                "host": "stream"
            },
        ]
    }
}

Use this endpoint to get links the user saved for later use.

HTTP Request

GET https://api.alldebrid.com/user/links?agent=myAppName&apikey=someValidApikeyYouGenerated (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.
apikey true User apikey.

Response attributes

Key Type Description
links Array Saved links.
Key Type Description
link String Link URL.
filename String Link file name.
size Integer Link file size.
date Integer When the link was saved.
host String Link host.

Save a link.

<?php

$myLink = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
$apiEndpoint = "https://api.alldebrid.com/v4/user/links/save?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode($myLink); // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));


curl -G --data-urlencode "link=https://www.youtube.com/watch?v=dQw4w9WgXcQ" "https://api.alldebrid.com/v4/user/links/save?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "message": "Link was successfully saved"
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/user/links/save?agent=myAppName&apikey=someValidApikeyYouGenerated&link=LINK

Query parameters

Parameter Required Type Description
agent true String Your software user-agent.
apikey true String User apikey.
link true String Link to save.

Delete a saved link.

<?php

$myLink = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
$apiEndpoint = "https://api.alldebrid.com/v4/user/links/delete?agent=myAppName&apikey=someValidApikeyYouGenerated&link=" . urlencode($myLink); // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));


curl -G --data-urlencode "link=https://www.youtube.com/watch?v=dQw4w9WgXcQ" "https://api.alldebrid.com/v4/user/links/delete?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "message": "Link was successfully deleted"
    }
}

HTTP Request

GET https://api.alldebrid.com/v4/user/links/delete?agent=myAppName&apikey=someValidApikeyYouGenerated&link=LINK

Query parameters

Parameter Required Type Description
agent true String Your software user-agent.
apikey true String User apikey.
link true String Link to delete.
<?php

$apiEndpoint = "https://api.alldebrid.com/v4/user/history?agent=myAppName&apikey=someValidApikeyYouGenerated"; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "https://api.alldebrid.com/v4/user/history?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "links": [
            {
                "link": "https:\/\/uptobox.com\/fx8sx9hcn18s",
                "filename": "ubuntu-16.04.6-desktop-amd64.iso",
                "size": 751267520,
                "date": 1569420668,
                "host": "uptobox"
            },
            {
                "link": "https:\/\/uptobox.com\/62srxw1y1a8p",
                "filename": "ubuntu-18.04.2-live-server-amd64.iso",
                "size": 795126720,
                "date": 1569420668,
                "host": "uptobox"
            },
            {
                "link": "http:\/\/youtube.com\/watch?v=dQw4w9WgXcQ",
                "filename": "",
                "size": 0,
                "date": 1583253075,
                "host": "stream"
            },
        ]
    }
}

Use this endpoint to get recent links. Recent link logging being disabled by default, this will return nothing until history logging has been activated in your account settings.

Links older than 3 days are automatically deleted from the recent history. To keep links in your account, use the Saved links.

HTTP Request

GET https://api.alldebrid.com/user/history?agent=myAppName&apikey=someValidApikeyYouGenerated (Test it live)

Query parameters

Parameter Required Description
agent true Your software user-agent.
apikey true User apikey.

Response attributes

Key Type Description
links Array Saved links.
Key Type Description
link String Link URL.
filename String Link file name.
size Integer Link file size.
date Integer When the link was saved.
host String Link host.
<?php

$apiEndpoint = "https://api.alldebrid.com/v4/user/history/delete?agent=myAppName&apikey=someValidApikeyYouGenerated"; // Authentificated endpoint with valid apikey
$context = stream_context_create([ 'http' => [ 'ignore_errors' => true ] ]); // Suppress PHP warnings on HTTP status code >= 400
$response = json_decode(file_get_contents($apiEndpoint, false, $context));

curl "https://api.alldebrid.com/v4/user/history/delete?agent=myAppName&apikey=someValidApikeyYouGenerated"

The above request returns JSON structured like this if successfull :

{
    "status": "success",
    "data": {
        "message": "Links were successfully deleted"
    }
}

Use this endpoint to delete all links currently in your recent links history. Links older than 3 days are automatically deleted from the recent history.

HTTP Request

GET https://api.alldebrid.com/user/history/delete?agent=myAppName&apikey=someValidApikeyYouGenerated

Query parameters

Parameter Required Description
agent true Your software user-agent.
apikey true User apikey.

All errors

<?php
$apiErrors = [
    'GENERIC' => 'An error occured',
    '404' => "Endpoint doesn't exist",

    'AUTH_MISSING_AGENT' => "You must send a meaningful agent parameter, see api docs",
    'AUTH_BAD_AGENT' => "Bad agent",
    'AUTH_MISSING_APIKEY' => 'The auth apikey was not sent',
    'AUTH_BAD_APIKEY' => 'The auth apikey is invalid',
    'AUTH_BLOCKED' => 'This apikey is geo-blocked or ip-blocked',
    'AUTH_USER_BANNED' => 'This account is banned',

    'LINK_IS_MISSING' => 'No link was sent',
    'LINK_HOST_NOT_SUPPORTED' => 'This host or link is not supported',
    'LINK_DOWN' => 'This link is not available on the file hoster website',
    'LINK_PASS_PROTECTED' => 'Link is password protected',
    'LINK_HOST_UNAVAILABLE' => 'Host under maintenance or not available',
    'LINK_TOO_MANY_DOWNLOADS' => 'Too many concurrent downloads for this host',
    'LINK_HOST_FULL' => 'All servers are full for this host, please retry later',
    'LINK_HOST_LIMIT_REACHED' => "You have reached the download limit for this host",
    'LINK_ERROR' => 'Could not unlock this link',

    'REDIRECTOR_NOT_SUPPORTED' => 'Redirector not supported',
    'REDIRECTOR_ERROR' => 'Could not extract links',

    'STREAM_INVALID_GEN_ID' => 'Invalid generation ID',
    'STREAM_INVALID_STREAM_ID' => 'Invalid stream ID',

    'DELAYED_INVALID_ID' => "This delayed link id is invalid",

    'FREE_TRIAL_LIMIT_REACHED' => 'You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial)',
    'MUST_BE_PREMIUM' => "You must be premium to process this link",

    'MAGNET_INVALID_ID' => 'This magnet ID does not exists or is invalid',
    'MAGNET_INVALID_URI' => "Magnet is not valid",
    'MAGNET_INVALID_FILE' => "File is not a valid torrent",
    'MAGNET_FILE_UPLOAD_FAILED' => "File upload failed",
    'MAGNET_NO_URI' => "No magnet sent",
    'MAGNET_PROCESSING' => "Magnet is processing or completed",
    'MAGNET_TOO_MANY_ACTIVE' => "Already have maximum allowed active magnets (30)",
    'MAGNET_MUST_BE_PREMIUM' => "You must be premium to use this feature",
    'MAGNET_NO_SERVER' => "Server are not allowed to use this feature",
    'MAGNET_TOO_LARGE' => "Magnet files are too large (max 1TB)",

    'PIN_ALREADY_AUTHED' => "You already have a valid auth apikey",
    'PIN_EXPIRED' => "The pin is expired",
    'PIN_INVALID' => "The pin is invalid",

    'USER_LINK_MISSING' => "No link provided",
    'USER_LINK_INVALID' => "Can't save those links",

    'NO_SERVER' => "Server are not allowed to use this feature",

    'MISSING_NOTIF_ENDPOINT' => 'You must provide an endpoint to unsubscribe',
];

You can find all possible errors here, available in PHP array and JSON format if needed.

Some errors will return an HTTP code 401 or 429, depending of the error.

Code Description
GENERIC An error occured
404 Endpoint doesnt exist
AUTH_MISSING_AGENT You must send a meaningful agent parameter see api docs
AUTH_BAD_AGENT Bad agent
AUTH_MISSING_APIKEY The auth apikey was not sent
AUTH_BAD_APIKEY The auth apikey is invalid
AUTH_BLOCKED This apikey is geo-blocked or ip-blocked
AUTH_USER_BANNED This account is banned
LINK_IS_MISSING No link was sent
LINK_HOST_NOT_SUPPORTED This host or link is not supported
LINK_DOWN This link is not available on the file hoster website
LINK_PASS_PROTECTED Link is password protected
LINK_HOST_UNAVAILABLE Host under maintenance or not available
LINK_TOO_MANY_DOWNLOADS Too many concurrent downloads for this host
LINK_HOST_FULL All servers are full for this host please retry later
LINK_HOST_LIMIT_REACHED You have reached the download limit for this host
LINK_ERROR Could not unlock this link
REDIRECTOR_NOT_SUPPORTED Redirector not supported
REDIRECTOR_ERROR Could not extract links
STREAM_INVALID_GEN_ID Invalid generation ID
STREAM_INVALID_STREAM_ID Invalid stream ID
DELAYED_INVALID_ID This delayed link id is invalid
FREE_TRIAL_LIMIT_REACHED You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial)
MUST_BE_PREMIUM You must be premium to process this link
MAGNET_INVALID_ID This magnet ID does not exists or is invalid
MAGNET_INVALID_URI Magnet is not valid
MAGNET_INVALID_FILE File is not a valid torrent
MAGNET_FILE_UPLOAD_FAILED File upload failed
MAGNET_NO_URI No magnet sent
MAGNET_PROCESSING Magnet is processing or completed
MAGNET_TOO_MANY_ACTIVE Already have maximum allowed active magnets (30)
MAGNET_MUST_BE_PREMIUM You must be premium to use this feature
MAGNET_NO_SERVER Server are not allowed to use this feature
MAGNET_TOO_LARGE Magnet files are too large (max 1TB)
PIN_ALREADY_AUTHED You already have a valid auth apikey
PIN_EXPIRED The pin is expired
PIN_INVALID The pin is invalid
USER_LINK_MISSING No link provided
USER_LINK_INVALID Cant save those links
NO_SERVER Server are not allowed to use this feature
MISSING_NOTIF_ENDPOINT You must provide an endpoint to unsubscribe

Changelog

30/03/2020

27/03/2020

26/03/2020

04/03/2020

03/03/2020

01/03/2020

28/02/2020

--