Welcome to Mega-Debrid API

• General informations

All requests are in the same pattern : https://www.mega-debrid.eu/?action=[action_name]. Some requests needs more parameters.
All requests return a json encoded response with at least the response "response_code" : "ok" or the error code. When an error is triggered, the parameter "response_text" give a text description of the error.

WARNING : After 4 login failed (bad login/password), your IP address will be banned for somes minutes.
WARNING : If you send more than 50 requests per seconds, your IP address will be banned for 1 day.

Only Premium members can use this API.
If free members try to connect on their accounts with this API, we return "vip_end" at the token generation and debrid link doesn't work.
We recommend an error message on your software for these accounts.

We can offer you a Premium account for your tests. Don't hesitate to contact us : contact[AT]mega-debrid.eu

• User section

Connect user :

You can use API without having to first call the connect endpoint by creating an application in your profile page.
Go to My Account, API Key and create a new application. Use the generated key with every call "token={APPLICATION_TOKEN}"
You need to set the application name and a callback url where the succeeded connection (for external application) callback will be sent.

We send a POST request to the callback url with this parameters :

{ token: [USER TOKEN], valid_until "yyyy-MM-dd hh:mm:ss" }

Get user history :

URL: https://www.mega-debrid.eu/api.php?action=getUserHistory&token=[token]

[optional] : GET fields : 'start' : skip [start] results
[optional] : GET fields : 'limit' : number of result
response: "response_code" => "ok", "history" => [user's history]

• Unrestrict setion

Get hosters list :

URL: https://www.mega-debrid.eu/api.php?action=getHostersList

params : no params
response: "response_code", "hosters" => [{name, status, img, domains (array), regexps (array)}]

Get debrid link :

URL: https://www.mega-debrid.eu/api.php?action=getLink&token=[token]

params : POST fields : 'link' : link to debrid. User password is md5 encoded
params : POST fields : 'password' : if the link have a password.
response: "response_code" => "ok", "debridLink" => debrided link

• Torrent section

Upload torrent :

URL: https://www.mega-debrid.eu/api.php?action=uploadTorrent&token=[token]

params :

  • POST 'file' : Upload file directly
  • POST 'magnet' : Magnet URL of the torrent
response: "response_code" => "ok", "newTorrent" => { name, size, hash }

Get Torrents list :

URL: https://www.mega-debrid.eu/api.php?action=getTorrents&token=[token]

response: "response_code" => "ok", "torrents" => [array of torrents (name, status, progress, speed) ]

Get torrent information :

URL: https://www.mega-debrid.eu/api.php?action=getTorrent&token=[token]

Params : POST 'hash' : hash of the torrent (Field `hash` when upload torrent)
response: response_code => "ok",
"status" => {
name nbFiles size status progress speed peers ub_link }

• External connection

Create a new link :

URL: https://mega-debrid.eu/api.php?action=link&token=[application_token]&code=[new code]

response: { "code": "[CODE]", "expires_at": "yyyy-MM-dd hh:mm:ss" }