NAV Navbar
PHP JS

Introduction

<?php
$apiEndpoint = "https://api.alldebrid.com/hosts";

$successfullCall = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this :

{
    "success": true,
    "hosts": []
}
<?php

$apiEndpoint = "https://api.alldebrid.com/invalidCall";

$invalidCall = json_decode(file_get_contents($apiEndpoint));


Some stuff ?

The above request returns JSON structured like this :

{
    "error": "This endpoint doesn't exist",
    "errorCode": "404"
}

Welcome to the OLD v3 Alldebrid API !

All calls are to be made on the HTTPS endpoints. Some are public, others require to be authentificated with a token parameter returned by the login endpoint.

You'll need to identify your software or script by a agent GET parameter (your software user-agent), especially for the endpoints requiring authentification.

All endpoints return JSON responses with a 200 status code. Successfull calls will always have a success field, and if not an error and errorCode fields will be returned.

Our API is behind Cloudflare, you may get a 502 Bad Gateway error if something takes too long to process or go wrong on our side.

You can find all the API and documentation changes and fixes on the changelog at the end of this documentation.

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

Thanks for using or integrating the Alldebrid service into your software !

Recent modifications

08/11/2019

31/05/2019

15/05/2019

24/04/2019

Authentification token and agent

A (user-)agent parameter and a valid token are required for all authentificated endpoints.

Try to make it explicit, like perfectDownloader, nodejsAlldLib or iOsDlManager. Most likely the name of your software, script or library.

Tokens are tied to the agent and user password, if you change the agent or if the user change its password, the tokens will be invalid and a new authentification will be required on the /user/login endpoint. Tokens will last forever if the user password and agent don't change.

Please keep your agent stable even across version, an agent change will loggout the user as the token will not be valid anymore. You can add a version parameter in the url if you would like to let us know what is the version of your software, but that's Optional.

Available public endpoints

Please notice that endpoints don't have any trailing slash.

Parameter Description
/hosts Get lists of supported hosts/redirectors and their status.
/hosts/domains Get list of supported domains.
/hosts/regexp Get list of regexp matching supported hosts/redirectors links.
/pin/get Get a pin for remote login on device
/pin/check Get the status of a pin

Available authentificated endpoints

Please notice that endpoints don't have any trailing slash.

All those endpoints require a valid token, sent as a token parameter like this :

GET https://api.alldebrid.com/some/endpoint?agent=mySoftware&token=mytokenabcdefghijklmnopqrstuvwxyz01234

Parameter Description
/user/login Get user token and informations.
/user/hosts Get available hosts for the user.
/user/torrents Get user torrents status.
/link/infos Retrieve informations about a link.
/link/redirector Retrieve links from a protection / redirection link.
/link/unlock Unlock a link.
/magnet/upload Upload a new magnet.
/magnet/upload/file Upload a new torrent.
/magnet/status Check a magnet status.
/magnet/delete Delete a magnet.
/magnet/instant Check is magnet can be downloaded instantaneously.
/magnet/restart Restart a failed magnet.
/voucher/get List avalaible vouchers.
/voucher/generate Generate new vouchers.
/voucher/balance Get current reseller balance.

General errors

Code Description
1 Invalid token.
401 Authentification required for this endpoint.
404 This API endpoint doesn't exist.

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.

Supported hosts

<?php

$apiEndpoint = "https://api.alldebrid.com/hosts";

$supportedHostsInfos = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this :

{   
    "success": true,
    "hosts": [{
        "domain": "uptobox.com",
        "status": true,
        "altDomains": ["uptostream.com"]
    }, {
        "domain": "vimeo.com",
        "status": false
    }],
    "redirectors": [{
        "domain": "dl-protecte.com",
        "status": true,
        "altDomains": ["dl-protecte.org"]
    }, {
        "domain": "adf.ly",
        "status": false
    }]
}

Use this endpoint to retrieve informations about what hosts we support, if the host is currently working on Alldebrid, and if the domain has any alternative domains. Are also returned the domains and status of redirectors / protectors we support.

HTTP Request

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

Host object

Key Always sent type Description
domain Yes String Host (main) domain.
status Yes Boolean Is the host currently (< 5 min) working on Alldebrid.
altDomains No Array Alternative domains the host use.

Domains only

<?php

$apiEndpoint = "https://api.alldebrid.com/hosts/domains";

$supportedDomainsList = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this :

{   
    "success": true,
    "hosts": ["uptobox.com", "uptostream.com", "4shared.com"],
    "redirectors": ["dl-protecte.com", "dl-protecte.org", "adf.ly"]
}

Use this endpoint to only retreive the list of supported domains and redirectors as array. This will also includes any alternative domains the hosts or redirectors have.

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

Hosts regexp

<?php

$apiEndpoint = "https://api.alldebrid.com/hosts/regexp";

$hostRegexpsList = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this :

{   
    "success": true,
    "hosts": {
        "uptobox.com": "(uptobox\.com/[0-9a-zA-Z]+(/.*)?)|uptostream\.com/([0-9a-zA-Z]{12})",
        "4shared.com": "(4shared\.com/file/[0-9a-zA-Z\-]+/(.*?)\.htm[l]?)(\?.*?=.*?)?|(4shared\.com/[a-z3]+/(.*?)\.htm[l]?)"
    },
    "redirectors": {
        "dl-protecte.com": "(dl-protecte.com\/[0-9a-zA-Z]+)|dl-protecte.org\/([0-9a-zA-Z]+)",
        "adf.ly": "(adf.ly\/[0-9]+\/(.+))|(adf.ly\/[0-9a-zA-Z]+)"
    }
}

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

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

User

Login

<?php

$token = 'abcdefghijkl0123456';
$apiEndpoint = "https://api.alldebrid.com/user/login?agent=mySoft&token=" . urlencode($token);

$authInfos = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this if successfull :

{
    "success": true,
    "token": "abcdefghijkl0123456",
    "user": {
        "username": "MyUsername",
        "email": "some.email@example.com",
        "isPremium": true,
        "premiumUntil": "1545757200",
        "lang": "fr",
        "preferedDomain": "fr",
        "limitedHostersQuotas": {
            "someHost": 1024,
            "otherHost": 5000,
            "oneLast": 2000
        }
    }
}

Use this endpoint to get user informations. The token is required.

You can only call this endpoint with a valid token, no username/password login are available on the api anymore.

HTTP Request

GET https://api.alldebrid.com/user/login?agent=mySoft&token=TOKEN (Test it live)

Query Parameters

Parameter Optional Description
agent false Your software user-agent.
token false User api token.

Response values

Key Type Description
token String User api token.
user Object User data.

User object

Key Type Description
username String User username.
email String User email.
isPremium Boolean true is premium, false if not.
premiumUntil Integer 0 if user is not premium, or timestamp until user is premium.
lang String Language used by the user on Alldebrid, eg. 'en', 'fr'. Default to fr.
preferedDomain String Preferer TLD used by the user, eg. 'fr', 'es'. Default to fr.
limitedHostersQuotas Array Remaining quotas for the limited hosts.

Errors

Code Description
1 Invalid token.
3 Geolock protection active, please login on the website.
4 User is banned.
5 Please provide both username and password for authentification, or a valid token.
100 Too many login attempts, please wait.
101 Too many login attempts, blocked for 15 min.
102 Too many login attempts, blocked for 6 hours.

User hosts

<?php


$apiEndpoint = "https://api.alldebrid.com/user/hosts?agent=mySoft&token=TOKEN";

$hostsInfos = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this if successfull :

{
    "success": true,
    "hosts": {
        "uptobox": {
            "domain": "uptobox.com",
            "status": true,
            "altDomains": [
                "uptostream.com"
            ],
            "regexp": "(uptobox\.com/[0-9a-zA-Z]+(/.*)?)|uptostream\.com/([0-9a-zA-Z]{12})"
        },
        "depfile": {
            "domain": "depfile.com",
            "status": true,
            "altDomains": [
                "depfile.com"
            ],
            "regexp": "(depfile\.com/downloads/.*?)|(depfile\.com/[a-z0-9A-Z]+)|dipfile\.com/([a-z0-9A-Z]+)|depfile\.us/([a-z0-9A-Z]+)",
            "quota": 5500,
            "quotaType": "traffic",
            "limitSimuDl": 2
        }
    },
    "redirectors": {
        "adfly": {
            "domain": "adf.ly",
            "status": true,
            "regexp": "(adf\.ly/[0-9]+/(.+))|(adf\.ly/[0-9a-zA-Z]+)"
        },
        "dlprotecte": {
            "domain": "dl-protecte.com",
            "status": true,
            "altDomains": [
                "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.

HTTP Request

GET https://api.alldebrid.com/user/hosts?agent=mySoft&token=TOKEN (Test it live)

Torrent object

Host object

Quotas will reset every day for premium users.

Key Always sent type Description
domain Yes String Host (main) domain.
status Yes Boolean Is the host currently (< 5 min) working on Alldebrid.
altDomains No Array Alternative domains the host use.
regexp Yes String Regexp matching the supported urls for this host.
quota No Integer Remaining quota for this host, if any.
quotaType No String Specify if the quota is the remainging 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.

User hosts v2

<?php


$apiEndpoint = "https://api.alldebrid.com/user/hosts?apiVersion=2&agent=mySoft&token=TOKEN";

$hostsInfos = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this if successfull :

{
    "success": true,
    "hosts": {
        "uptobox": {
            "domains": ["uptobox.com", "uptostream.com"],
            "regexps": ["(uptobox\\.com/[0-9a-zA-Z]+(/.*)?)", "uptostream\\.com/([0-9a-zA-Z]{12})"],
            "status": true
        }
    },
    "streams": {
        "youtube": {
            "domains": ["youtube.com", "youtu.be"],
            "regexps": ["https?://(?:www\\.)?youtube\\.com/show/(?P<id>[^?#]*)", "https?://(?:www\\.)?youtube\\.com/results\\?(.*?&)?(?:search_query|q)=(?P<query>[^&]+)(?:[&]|$)"]
        }
    },
    "redirectors": {
        "adfly": {
            "domains": ["adf.ly"],
            "regexps": ["(adf\\.ly/[0-9]+/(.+))|(adf\\.ly/[0-9a-zA-Z]+)"]
        },
        "dlprotecte": {
            "domains": ["dl-protecte.com"],
            "regexps": ["(dl-protecte\\.com/[0-9a-zA-Z]+)", "dl-protecte\\.org/([0-9a-zA-Z]+)"]
        }
    }
}

New format of user/hosts endpoints. New returns array of domains, and arrays of regexps. Also seperate host and stream services.

HTTP Request

GET https://api.alldebrid.com/user/hosts?apiVersion=2&agent=mySoft&token=TOKEN (Test it live)

Torrent object

Host object

Quotas will reset every day for premium users.

Key Always sent type Description
domains Yes Array Array of domains.
status No Boolean Is the host currently (< 5 min) working on Alldebrid.
regexps Yes Array Array of regexp matching the supported urls for this host.
quota No Integer Remaining quota for this host, if any.
quotaType No String Specify if the quota is the remainging 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


$apiEndpointSingleLink = "https://api.alldebrid.com/link/infos?agent=mySoft&token=TOKEN&link=" . urlencode("http://uptobox.com/l1ub83vil5c3");
$apiEndpointSingleLinkWithPass = "https://api.alldebrid.com/link/infos?agent=mySoft&token=TOKEN&link=" . urlencode("http://uptobox.com/l1ub83vil5c3") . "&password=" . urlencode("somePassword");
$apiEndpointMultipleLinks = "https://api.alldebrid.com/link/infos?agent=mySoft&token=TOKEN&link[]=" . urlencode("http://uptobox.com/l1ub83vil5c3") . "&link[]=" . urlencode("http://uptobox.com/l1ub83vil5c4");

$linkInfos = json_decode(file_get_contents($apiEndpointSingleLink));
$linksInfos = json_decode(file_get_contents($apiEndpointMultipleLinks));

Some stuff ?

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

{
    "success": true,
    "infos": {
        "host": "uptobox",
        "link": "http:\/\/uptobox.com\/l1ub83vil5c3",
        "filename": "ubuntu-16.04.1-server-amd64.iso",
        "size": "699400192"
    }
}

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

{
    "success": true,
    "infos": {
        "http://uptobox.com/l1ub83vil5c3": {
            "host": "uptobox",
            "link": "http:\/\/uptobox.com\/l1ub83vil5c3",
            "filename": "ubuntu-16.04.1-server-amd64.iso",
            "size": "699400192"
        },
        "http://uptobox.com/l1ub83vil5c4": {
            "host": "uptobox",
            "link": "http:\/\/uptobox.com\/l1ub83vil5c3",
            "filename": "ubuntu-16.10.1-server-amd64.iso",
            "size": "699458755"
        },
        "http://example.com": {
            "errorCode": 11,
            "error": "Host 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.

HTTP Request

GET https://api.alldebrid.com/link/infos?agent=mySoft&token=TOKEN&link=LINK (Test it live)

GET https://api.alldebrid.com/link/infos?agent=mySoft&token=TOKEN&link=LINK&password=PASSWORD

GET https://api.alldebrid.com/link/infos?agent=mySoft&token=TOKEN&link[]=LINK1&link[]=LINK2 (Test it live)

Query Parameters

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

Response values

If one link is provided, return an object with the following properties. If multiple links were sent, return a global object containing the following objects, with links as key.

Key Type Description
host string Link host.
link string Requested link, simplified if it was not in canonical form.
filename string Link's file filename.
size Integer Link's file size in bytes.
Code Description
11 Host not supported
12 Link seems down
13 Link is password protected

Endpoint errors

Code Description
10 No link provided
110 Too many links requested, please wait
111 Too many links requested, blocked for 15 min
112 Too many links requested, blocked for 6 hours

Redirectors

<?php


$apiEndpoint = "https://api.alldebrid.com/link/redirector?agent=mySoft&token=TOKEN&link=" . urlencode("http://uptobox.com/l1ub83vil5c3");

$redirectorsInfos = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The request returns JSON structured like this if the redirector / protector have multiple links :

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

The request returns JSON structured like this if the redirector / protector have only one link :

{
    "success": true,
    "folder": false,
    "links": ["http:\/\/uptobox.com\/l1ub83vil5c3"]
}

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

HTTP Request

GET https://api.alldebrid.com/link/redirector?agent=mySoft&token=TOKEN&link=LINK (Test it live)

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
token false string Valid authentification token.
link false string The redirector or protector link to extract links.

Response values

Key Type Description
folder bool True is the protector have multiple links.
links array Link(s) extracted.

Errors

Code Description
20 Redirector not supported.
21 Could not extract links.
<?php

$link = "http://uptobox.com/l1ub83vil5c3";
$apiEndpoint = "https://api.alldebrid.com/link/unlock?agent=mySoft&token=TOKEN&link=" . urlencode($link);
$apiEndpointWithPassword = "https://api.alldebrid.com/link/unlock?agent=mySoft&token=TOKEN&link=" . urlencode($link) . "&password=" . urlencode('somePassword');

$unlockedLinkInfos = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

The above request returns JSON structured like this if successfull :

{
    "success": true,
    "infos": {
       "link": "http:\/\/ombfyx.alld.io\/dl\/abcdefgh12\/ubuntu-16.04.1-server-amd64.iso",
        "host": "uptobox",
        "filename": "ubuntu-16.04.1-server-amd64.iso",
        "streaming": [],
        "paws": false,
        "filesize": 699400192
    }
}

This endpoint unlocks a given link.

If the unlocking isn't sucessfull, an error property in the returned JSON object will be set.

This endpoint can return an delayed ID. In that case, you must pool every 5 seconds or more the link/delayed endpoint until given the download link.

HTTP Request

GET https://api.alldebrid.com/link/unlock?agent=mySoft&token=TOKEN&link=LINK (Test it live)

Query Parameters

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

Response values

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.
streaming 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.
delayed Integer Delayed ID if link need time to generate

Errors

Code Description
30 This link is not supported.
31 This link is not available on the file hoster website.
32 Host under maintenance or not available.
33 You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial).
34 Too many concurrent downloads.
35 All servers are full for this host, please retry later.
36 You have reached the download limit for this host.
37 You must be premium to process this link.
38 Link is password protected.
39 Generic unlocking error.
<?php

$link = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
$apiEndpoint = "https://api.alldebrid.com/link/unlock?agent=mySoft&token=TOKEN&link=" . urlencode($link);
$apiEndpointWithPassword = "https://api.alldebrid.com/link/unlock?agent=mySoft&token=TOKEN&link=" . urlencode($link);

$streamLinkInfos = json_decode(file_get_contents($apiEndpoint));


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

$apiEndpoint = "https://api.alldebrid.com/link/streaming?agent=mySoft&token=TOKEN&id=" . urlencode($id) . "&stream=" . urlencode($stream);

$streamLinkDLInfos = json_decode(file_get_contents($apiEndpoint));


Some stuff ?

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

{
    "success": true,
    "infos": {
        "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 :

{
    "success": true,
    "infos": {
        "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 :

{
    "success": true,
    "infos": {
        "link": "",
        "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 next section for delayed links).

HTTP Request

GET https://api.alldebrid.com/link/streaming?agent=mySoft&token=TOKEN&id=ID&stream=STREAMID (Test it live)

GET https://api.alldebrid.com/link/unlock?agent=mySoft&token=TOKEN&link=LINK&password=PASSWORD

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
token false string Valid authentification token.
id false string The link ID you received from the /link/unlock call.
stream false string The stream ID you choosed fromt he stream qualities list returned by /link/unlock.

Response values

Key Type Description
link String Download link, ONLY if available. This WILL be empty 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
14 Invalid generation ID
15 Invalid stream ID
<?php

$delayedID = 2457; // From /link/unlock
$apiEndpoint = "https://api.alldebrid.com/link/delayed?agent=mySoft&token=TOKEN&id=" . urlencode($link);

$delayedStatus = json_decode(file_get_contents($apiEndpoint));

Some stuff ?

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

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

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

{
    "success": true,
    "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 needs time to generate, this endpoint send the status of such delayed links.

If the unlocking isn't sucessfull, an error property in the returned JSON object will be set.

This endpoint can return an delayed ID. In that case, you must pool every 5 seconds or more the link/delayed endpoint until given the download link.

HTTP Request

GET https://api.alldebrid.com/link/delayed?agent=mySoft&token=TOKEN&id=ID

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
token false string Valid authentification token.
id false integer Delayed ID received in /link/unlock.

Response values

Key Type Description
status Integer Current status.
time_left Integer Estimated time left to wait.
link 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
40 No id or invalid id specified.

Magnet

Upload

Upload a magnet with its URI or hash.

<?php

$magnet = 'magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso';
// $magnet = '842783e3005495d5d1637f5364b59343c7844707'; // Can also use hash directly
$apiEndpoint = "https://api.alldebrid.com/magnet/upload?agent=Mysoft&token=TOKEN&magnet=" . urlencode($magnet);
$result = json_decode(file_get_contents($apiEndpoint));


The above request returns JSON structured like this if successfull :

{
  "success": true,
  "id": 123456,
  "hash": "842783e3005495d5d1637f5364b59343c7844707",
  "filename": "ubuntu-18.04.2-live-server-amd64.iso"
}

HTTP Request

GET https://api.alldebrid.com/magnet/upload?agent=mySoft&token=TOKEN&magnet=MAGNET (Test it live)

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
magnet false string Magnet URI or hash.

Response values

Key Type Description
id Int Magnet id, used to query status.
hash String Magnet hash.
filename String Magnet filename, or 'noname' if could not parse it.

Endpoint errors

Code Description
50 No magnet provided.
51 Magnet is not valid.
52 You must be premium to use this feature.
53 Server are not allowed to use this feature.
54 Already have maximum allowed active magnets (30).

Upload file

Upload a torrent file.

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');

$ch = curl_init('https://api.alldebrid.com/magnet/upload/file?agent=Mysoft&token=TOKEN');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['files[]' => $file] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

The above request returns JSON structured like this if successfull :

{
  "success": true,
  "id": 123456,
  "hash": "842783e3005495d5d1637f5364b59343c7844707",
  "filename": "ubuntu-18.04.2-live-server-amd64.iso"
}

HTTP Request

POST https://api.alldebrid.com/magnet/upload/file?agent=mySoft&token=TOKEN

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.

Response values

Key Type Description
id Int Magnet id, used to query status.
hash String Magnet hash.
filename String Magnet filename, or 'noname' if could not parse it.

Endpoint errors

Code Description
50 No magnet provided.
51 Magnet is not valid.
52 You must be premium to use this feature.
53 Server are not allowed to use this feature.
54 Already have maximum allowed active magnets (30).

Status

Get one/all magnet status

<?php

$magnetID = 123456;
$apiEndpoint = "https://api.alldebrid.com/magnet/status?agent=Mysoft&token=TOKEN&apiVersion=2&id=" . urlencode($magnetID);
$magnetStatus = json_decode(file_get_contents($apiEndpoint));


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

{
  "success": true,
  "id": 123456,
  "filename": "ubuntu-18.04.2-live-server-amd64.iso",
  "size": 699400192,
  "status": "Downloading",
  "statusCode": 1,
  "downloaded": 255400192,
  "uploaded": 0,
  "seeders": 7,
  "downloadSpeed": 18874368,
  "uploadSpeed": 0,
  "uploadDate": 1557133868,
  "links": {}
}


{
  "success": true,
  "id": 123456,
  "filename": "ubuntu-18.04.2-live-server-amd64.iso",
  "size": 699400192,
  "status": "Ready",
  "statusCode": 4,
  "downloaded": 699400192,
  "uploaded": 699400192,
  "seeders": 0,
  "downloadSpeed": 0,
  "uploadSpeed": 0,
  "uploadDate": 1557133868,
  "links": [
    {
        "link": "http:\/\/uptobox.com\/aaaabbbbcccc",
        "filename": "ubuntu-18.04.2-live-server-amd64.iso",
        "size": 700000000
    },
    {
        "link": "http:\/\/uptobox.com\/aaaabbbbdddd", 
        "filename": "some.other.file.txt", 
        "size": 2054
    }
  ]
}

HTTP Request

GET https://api.alldebrid.com/magnet/status?agent=mySoft&apiVersion=2&token=TOKEN&id=MAGNETID (Test it live)

Query Parameters

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

Response values

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 object with filename, link and size

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
55 Magnet ID is invalid.

Delete

Delete a magnet.

<?php

$magnetID = 123456;
$apiEndpoint = "https://api.alldebrid.com/magnet/delete?agent=Mysoft&token=TOKEN&id=" . $magnetID;
$result = json_decode(file_get_contents($apiEndpoint));


The above request returns JSON structured like this if successfull :

{
  "success": true
}

HTTP Request

GET https://api.alldebrid.com/magnet/delete?agent=mySoft&token=TOKEN&id=MAGNETID (Test it live)

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
id false integer Magnet ID.

Endpoint errors

Code Description
55 Magnet ID is invalid

Restart

Restart a failed magnet.

<?php

$magnetID = 123456;
$apiEndpoint = "https://api.alldebrid.com/magnet/restart?agent=Mysoft&token=TOKEN&id=" . $magnetID;
$result = json_decode(file_get_contents($apiEndpoint));


The above request returns JSON structured like this if successfull :

{
  "success": true
}

HTTP Request

GET https://api.alldebrid.com/magnet/restart?agent=mySoft&token=TOKEN&id=MAGNETID (Test it live)

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
id false integer Magnet ID.

Endpoint errors

Code Description
55 Magnet ID is invalid
58 Magnet is processing or completed

Instant availability

Check if a magnet is available instantly.

<?php

$magnet = 'magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso';
$magnet2 = '222783e3005495d51637f5364b59343c78447065'; // Can also use magnet hash

$ch = curl_init('https://api.alldebrid.com/magnet/instant?agent=Mysoft&token=TOKEN');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ['magnets' => [$magnet, $magnet2] ] );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);


The above request returns JSON structured like this if successfull :

{
    "success": true,
    "data": [
        {
            "magnet": "magnet:?xt=urn:btih:842783e3005495d5d1637f5364b59343c7844707&dn=ubuntu-18.04.2-live-server-amd64.iso",
            "hash": "842783e3005495d5d1637f5364b59343c7844707",
            "instant": true
        },
        {
            "magnet": "222783e3005495d51637f5364b59343c78447065",
            "hash": "222783e3005495d51637f5364b59343c78447065",
            "instant": false
        }
    ]
}

HTTP Request

POST https://api.alldebrid.com/magnet/instant?agent=mySoft&token=TOKEN (Test it live)

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.

Post Parameters

magnets[] | false | string | Magnets URI or hash you wish to check instant availability, can be one or many links

Response values

Key Type Description
magnet string the magnet sent
hash string the magnet hash
instant boolean if instant or not
errorCode string only if there is an error (51)

Endpoint errors

Code Description
50 No magnet provided
51 Bad magnet format

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 token will be available on the api

Get pin

<?php

$apiEndpoint = "https://api.alldebrid.com/pin/get?agent=Mysoft";
$pinInfo = json_decode(file_get_contents($apiEndpoint));


The above request returns JSON structured like this if successfull :

{
  "success": true,
  "pin": "EC79",
  "expired_in": 600,
  "user_url": "https://alldebrid.com/pin/?pin=EC79",
  "base_url": "https://alldebrid.com/pin/",
  "check_url": "https://api.alldebrid.com/pin/check?check=960e43f9c1946716d1bd3489508f769737427b73&pin=EC79"
}

HTTP Request

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

Response values

Key Type Description
pin String Pin code to display to your user
expired_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 token once user submitted the PIN code

Check the pin status

<?php

// Full flow in action

$apiEndpoint = "https://api.alldebrid.com/pin/check?agent=Mysoft&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);

$authToken = $pinCheck["token"];

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

{
  "success": true,
  "activated": false,
  "expired_in": 580
}

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

{
  "success": true,
  "token": "abcdefghijkl0123456",
  "activated": true,
  "expired_in": 510
}

HTTP Request

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

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

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

Query Parameters

Parameter Optional Type Description
agent false string Your software user-agent.
check false string Random hash from check_url given in /pin/get
pin false string Pin code from check_url given in /pin/get

Response values

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

Endpoint errors

Code Description
60 The pin has expired
61 This endpoint check parameter is invalid

Vouchers

Those endpoints are available only for Alldebrid authorized resellers.

You can use them to retreive available vouchers on your reseller account, generate new ones or get your current balance.

Vouchers are available in duration of 30, 90, 180 and 300 days. You can retreive or generate between 1 and 10 vouchers at once.

Get vouchers

<?php

$apiEndpoint = "https://api.alldebrid.com/voucher/get?agent=Mysoft&token=TOKEN&duration=90&nb=2";
$pinInfo = json_decode(file_get_contents($apiEndpoint));

The above request returns JSON structured like this if successfull :

{
  "success": true,
  "codes": [
    "AAAAAA-BBBBBB-CCCCCC-DDDDDD",
    "DDDDDD-AAAAAA-BBBBBB-CCCCCC",
    "CCCCCC-DDDDDD-AAAAAA-BBBBBB",
    "BBBBBB-CCCCCC-DDDDDD-AAAAAA"
  ]
}

The above request returns JSON structured like if not enough vouchers are available :

{
  "success": true,
  "codes": [
    "AAAAAA-BBBBBB-CCCCCC-DDDDDD",
    "DDDDDD-AAAAAA-BBBBBB-CCCCCC"
  ],
  "partialList": true
}

HTTP Request

GET https://api.alldebrid.com/voucher/get?agent=mySoft&token=TOKEN&duration=30&nb=2 (Test it live)

Query Parameters

Parameter Optional Description
duration false Voucher duration. Valid values are 30, 90, 180 and 300.
nb true Number of voucher to get. Default to 1, max 10.

Response values

Key Type Description
codes Array Voucher list
partialList Boolean (Optional) True if not enough voucher were available

Endpoint errors

Code Description
81 Duration is invalid
82 Voucher number is invalid
83 No more available vouchers for this duration
403 You don’t have authorization to access this endpoint

Generate vouchers

<?php

$apiEndpoint = "https://api.alldebrid.com/voucher/generate?agent=Mysoft&token=TOKEN&duration=90&nb=2";
$pinInfo = json_decode(file_get_contents($apiEndpoint));

The above request returns JSON structured like this if successfull :

{
  "success": true,
  "codes": [
    "AAAAAA-BBBBBB-CCCCCC-DDDDDD",
    "DDDDDD-AAAAAA-BBBBBB-CCCCCC"
  ],
  "pricePerVoucher": 6.8,
  "total": 13.6
}

HTTP Request

GET https://api.alldebrid.com/voucher/generate?agent=mySoft&token=TOKEN&duration=30&nb=2 (Test it live)

Query Parameters

Parameter Optional Description
duration false Voucher duration. Valid values are 30, 90, 180 and 300.
nb true Number of voucher to get. Default to 1, max 10.

Response values

Key Type Description
codes Array Voucher list
pricePerVoucher Float Price charged per voucher (€)
total Float Total price of the vouchers generated (€)

Endpoint errors

Code Description
80 No enough balance
81 Duration is invalid
82 Voucher number is invalid
403 You don’t have authorization to access this endpoint

Reseller balance

<?php

$apiEndpoint = "https://api.alldebrid.com/voucher/balance?agent=Mysoft&token=TOKEN";
$pinInfo = json_decode(file_get_contents($apiEndpoint));

The above request returns JSON structured like this if successfull :

{
  "success": true,
  "balance": 51.6
}

HTTP Request

GET https://api.alldebrid.com/voucher/balance?agent=mySoft&token=TOKEN (Test it live)

Response values

Key Type Description
balance Float Your reseller balance (€)

Endpoint errors

Code Description
403 You don’t have authorization to access this endpoint

Errors

<?php
$apiErrors = [
    1 => 'Invalid token',
    2 => 'Invalid user or password',
    3 => 'Geolock protection active, please login from the website',
    4 => 'User is banned',
    5 => 'Please provide both username and password for authentification, or a valid token',
    10 => 'No link provided',
    11 => 'Host not supported',
    12 => 'Link seems down',
    13 => 'Link is password protected',
    14 => 'Invalid generation ID',
    15 => 'Invalid stream ID',
    20 => 'Redirector not supported',
    21 => 'Could not extract links',
    30 => 'This host or link is not supported',
    31 => 'This link is not available on the file hoster website',
    32 => 'Host under maintenance or not available',
    33 => 'You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial)',
    34 => 'Too many concurrent downloads',
    35 => 'All servers are full for this host, please retry later',
    36 => 'You have reached the download limit for this host',
    37 => 'You must be premium to process this link',
    38 => "Link is password protected",
    39 => 'Generic unlocking error',
    40 => 'No id or invalid delayed id',
    50 => "No magnet provided",
    51 => "Magnet is not valid",
    52 => "You must be premium to use this feature",
    53 => "Server are not allowed to use this feature",
    54 => "Already have maximum allowed active magnets (30)",
    55 => "Magnet ID is invalid",
    56 => "No file provided",
    57 => "File is not valid",
    58 => "Magnet is processing or completed",
    60 => "The pin is expired",
    61 => "The pin is invalid",
    80 => "No enough balance", 
    81 => "Duration is invalid", 
    82 => "Voucher number is invalid",
    83 => "No more available vouchers for this duration",
    100 => 'Too many login attempts, please wait',
    101 => 'Too many login attempts, blocked for 15 min',
    102 => 'Too many login attempts, blocked for 6 hours',
    110 => 'Too many links requested, please wait',
    111 => 'Too many links requested, blocked for 15 min',
    112 => 'Too many links requested, blocked for 6 hours',
    401 => 'Authentification required for this endpoint',
    403 => "You don't have authorization to access this endpoint",
    404 => "This API endpoint doesn't exist"
];
var apiErrors = {
    "1": "Invalid token",
    "2": "Invalid user or password",
    "3": "Geolock protection active, please login from the website",
    "4": "User is banned",
    "5": "Please provide both username and password for authentification, or a valid token",
    "10": "No link provided",
    "11": "Host not supported",
    "12": "Link seems down",
    "13": "Link is password protected",
    "14": "Invalid generation ID",
    "15": "Invalid stream ID",
    "20": "Redirector not supported",
    "21": "Could not extract links",
    "30": "This host or link is not supported",
    "31": "This link is not available on the file hoster website",
    "32": "Host under maintenance or not available",
    "33": "You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial)",
    "34": "Too many concurrent downloads",
    "35": "All servers are full for this host, please retry later",
    "36": "You have reached the download limit for this host",
    "37": "You must be premium to process this link",
    "38": "Link is password protected",
    "39": "Generic unlocking error",
    "40": "No id or invalid delayed id",
    "50": "No magnet provided",
    "51": "Magnet is not valid",
    "52": "You must be premium to use this feature",
    "53": "Server are not allowed to use this feature",
    "54": "Already have maximum allowed active magnets (30)",
    "55": "Magnet ID is invalid",
    "56": "No file provided",
    "57": "File is not valid",
    "58": "Magnet is processing or completed",
    "60": "The pin is expired",
    "61": "The pin is invalid",
    "80": "No enough balance", 
    "81": "Duration is invalid", 
    "82": "Voucher number is invalid",
    "83": "No more available vouchers for this duration",
    "100": "Too many login attempts, please wait",
    "101": "Too many login attempts, blocked for 15 min",
    "102": "Too many login attempts, blocked for 6 hours",
    "110": "Too many links requested, please wait",
    "111": "Too many links requested, blocked for 15 min",
    "112": "Too many links requested, blocked for 6 hours",
    "401": "Authentification required for this endpoint",
    "403": "You don't have authorization to access this endpoint",
    "404": "This API endpoint doesn't exist"
}

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
1 Invalid token.
2 Invalid user or password.
3 Geolock protection active, please login from the website.
4 User is banned.
5 Please provide both username and password for authentification, or a valid token.
10 No link provided.
11 Host not supported.
12 Link seems down.
13 Link is password protected.
14 Invalid generation ID.
15 Invalid stream ID.
20 Redirector not supported.
21 Could not extract links.
30 This host or link is not supported.
31 This link is not available on the file hoster website.
32 Host under maintenance or not available.
33 You have reached the free trial limit (7 days // 25GB downloaded or host uneligible for free trial).
34 Too many concurrent downloads.
35 All servers are full for this host, please retry later.
36 You have reached the download limit for this host.
37 You must be premium to process this link.
38 Link is password protected.
39 Generic unlocking error.
40 No id or invalid delayed id.
50 No magnet provided.
51 Magnet is not valid.
52 You must be premium to use this feature.
53 Server are not allowed to use this feature.
54 Already have maximum allowed active magnets (30).
55 Magnet ID is invalid.
56 No file provided.
57 File is not valid.
58 Magnet is processing or completed.
60 The pin is expired.
61 The pin is invalid.
80 No enough balance.
81 Duration is invalid.
82 Voucher number is invalid.
83 No more available vouchers for this duration.
100 Too many login attempts, please wait.
101 Too many login attempts, blocked for 15 min.
102 Too many login attempts, blocked for 6 hours.
110 Too many links requested, please wait.
111 Too many links requested, blocked for 15 min.
112 Too many links requested, blocked for 6 hours.
401 Authentification required for this endpoint.
403 You don't have authorization to access this endpoint.
404 This API endpoint doesn't exist.

Changelog

08/11/2019

--

15/05/2019

--

24/04/2019

--

08/03/2019

--

14/01/2019

--

08/01/2019

--

18/12/2018

--

08/06/2018

--

20/11/2017

--

14/09/2017

--

13/09/2017

--

12/09/2017