Introduction
The BestDebrid API is a RESTful interface returning JSON over HTTPS. Most endpoints accept both GET and POST and can receive parameters via query string or request body.
Technical tables (parameters, fields, code samples) are in English.
Base URL
Copy https://bestdebrid.com/api/v1 Response envelope
Every endpoint returns a JSON object with an error integer (0 means success) and a message — either a human-readable string on failure, or a payload (string, array, object) on success. Richer endpoints add their own top-level fields alongside error.
Copy {
"error" : 0 ,
"message" : "OK"
// additional fields depending on the endpoint
}
Authentication
Every endpoint except /, /time and /regex requires your API key. Pass it one of two ways:
Option 1 — HTTP header (recommended)
Copy Authorization: YOUR_API_KEY Option 2 — query string
Where to find your key: sign in, it is shown in your profile (API section). Rotate it any time with /newkey.
/newkey Keep your key secret. Never expose it in client-side code, public repositories or shipped extensions. If it leaks, rotate it immediately.
Your API key for the examples
Used by the "Try it" blocks on this page, never stored.
Error handling
The error field indicates the outcome. A non-zero value comes with a descriptive message. Codes are reused across endpoints; the meaning is always carried by the message.
0 Success — the request completed.
1 Missing or invalid parameter (empty link, bad API key, missing password).
2 Invalid URL format — link must start with http:// or https://.
3 Unsupported link, invalid magnet, or user not logged in.
4 Free users cannot unrestrict this hoster (premium-only host).
5 Too many active torrents (max 5 at a time) or torrent server error.
6 Free daily limit reached, duplicate torrent, or host under maintenance.
7 File size exceeds the free-user limit, or link-generation error.
8 Torrent size could not be determined, or torrent exceeds the 90 GiB limit.
9 Hoster pre-flight quota reached (daily links on this host).
10 Generation failed — the hoster returned an error.
19 Hoster limit reached after the link was already generated.
21 Premium plan required for API access.
22 API access is banned on this account.
55 Service under maintenance, or invalid parameter type (e.g. non-numeric isFile).
56 Invalid IP address, waiting time not elapsed, or free-user daily quota.
121 Daily download quota reached (70 unique links / 24h).
122 Too many unrestricts in progress — retry in ~1 min.
632 VPN/proxy detected (forbidden for free users).
Daily quota: each account is limited to 70 unique files every 24 hours across web + API (error 121). In-progress unrestricts count against the quota too (error 122).
Root — list endpoints
Returns a JSON array of strings describing every endpoint of the current build. Useful for sanity checks.
GET https://bestdebrid.com/api/v1 /
No authentication required. Example response
Copy [
"time ( function : time of bestdebrid.com )" ,
"newkey ( function : renew api key, params [ auth=apikey, pass=password of account ] )" ,
"user ( function : user infos, params [ auth=apikey ] )" ,
"..." ,
"** api build [1.07] **"
] Code samples
cURL PHP JS
Copy curl https://bestdebrid.com/api/v1/ <?php
$data = json_decode(file_get_contents('https://bestdebrid.com/api/v1/'), true);
print_r($data); const res = await fetch('https://bestdebrid.com/api/v1/');
const data = await res.json();
console.log(data);
Server time
Returns the current server time. Handy to sync clients or detect clock drift.
GET https://bestdebrid.com/api/v1 /time
No authentication required. Example response
Copy {
"error" : 0 ,
"message" : "2025-04-19 14: 22 : 03 "
} Code samples
cURL PHP JS
Copy curl https://bestdebrid.com/api/v1/time <?php
$res = file_get_contents('https://bestdebrid.com/api/v1/time');
echo json_decode($res, true)['message']; const r = await fetch('https://bestdebrid.com/api/v1/time');
console.log((await r.json()).message);
Hoster regular expressions
Returns the list of regular expressions (PCRE) matching supported links. Lets you filter URLs client-side before calling /generateLink.
GET https://bestdebrid.com/api/v1 /regex
No authentication required. Response schema
Field Type Description [] string[] Flat JSON array of PCRE patterns (PHP preg_match syntax, with delimiters). The last pattern matches base64-encoded http(s):// links.
Example response
Copy [
"/(http|https):\\/\\/(\\w+\\.)?rapidgator\\.net\\/file\\/[0-9a-z]+/" ,
"/(http|https):\\/\\/(\\w+\\.)?gofile\\.io\\/d\\/[0-9A-Za-z]+/" ,
"..."
] Client-side filtering: patterns use PHP delimiters (/…/). Strip the leading and trailing slash before feeding them to another regex engine.
Code samples
cURL PHP JS
Copy curl https://bestdebrid.com/api/v1/regex <?php
$patterns = json_decode(file_get_contents('https://bestdebrid.com/api/v1/regex'), true);
$supported = false;
foreach ($patterns as $re) {
if (preg_match($re, $url)) { $supported = true; break; }
} const patterns = await (await fetch('https://bestdebrid.com/api/v1/regex')).json();
const supported = patterns.some(p => new RegExp(p.slice(1, -1)).test(url));
User info
Returns the profile of the authenticated user: premium status, expiry, and whether the account bypasses API limits.
GET https://bestdebrid.com/api/v1 /user
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param.
Response schema
Field Type Description error integer 0 on success, 1 if the key is invalid.username string Account username. email string Account email. credit integer Remaining credits on the account. ID integer Internal user ID. premium boolean true if the account has an active premium plan (expire in the future).expire string|null Premium expiry date in Y-m-d H:i:s, or null if not premium. bypass_api_limit boolean true for accounts allowed to bypass per-host unrestrict limits.
Example response
Copy {
"error" : 0 ,
"username" : "john_doe" ,
"email" : "john@example.com" ,
"credit" : 0 ,
"ID" : 12345 ,
"premium" : true ,
"expire" : "2026-09-14 10: 20 : 00 " ,
"bypass_api_limit" : false
} Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' \
https://bestdebrid.com/api/v1/user <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$user = json_decode(file_get_contents('https://bestdebrid.com/api/v1/user', false, $ctx), true); const res = await fetch('https://bestdebrid.com/api/v1/user', {
headers: { 'Authorization': 'YOUR_API_KEY' }
});
const user = await res.json();
Rotate API key
Generates a fresh API key. The old key is invalidated immediately. Returns the literal string true on success.
GET https://bestdebrid.com/api/v1 /newkey
Parameters
Parameter Type Description authrequired string Your current API key (or Authorization header). passrequired string Your account password (or Password-X header). Confirms the rotation.
Example responses
Copy // Success (plain text, not JSON)
true
// Failure
{
"error" : 0 ,
"message" : "Invalid credentials"
} Headers alternative: the key is also accepted as Authorization and the password as Password-X. When both headers and query params are present, headers win.
Note: on failure the envelope currently returns "error": 0 with an error message — test the body for the literal true rather than the error field.
Irreversible action: no "Try it" block for this endpoint. Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' -H 'Password-X: YOUR_PASSWORD' \
https://bestdebrid.com/api/v1/newkey <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\nPassword-X: YOUR_PASSWORD\r\n"]]);
$res = file_get_contents('https://bestdebrid.com/api/v1/newkey', false, $ctx);
if (trim($res) === 'true') {
// success — read the new key from your profile page
} const res = await fetch('https://bestdebrid.com/api/v1/newkey', {
headers: { 'Authorization': 'YOUR_API_KEY', 'Password-X': 'YOUR_PASSWORD' }
});
const ok = (await res.text()).trim() === 'true';
Downloads history
Returns the user's most recent unrestricted links as an object keyed from "1" (not a flat JSON array).
GET https://bestdebrid.com/api/v1 /downloadsHistory
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param. numoptional integer Number of entries to return. Default 10, capped at 300.
Response schema (each entry)
Field Type Description name string Filename of the downloaded file. link string Generated unrestricted download link. original string Original hoster URL you submitted. ip string Client IP that triggered the download. date string Timestamp Y-m-d H:i:s.
Example response
Copy {
"1" : {
"name" : "Video.mkv" ,
"link" : "https://debrid2.bestdebrid.com/dl/TY/abc.../Video.mkv" ,
"original" : "https://rapidgator.net/file/abc123" ,
"ip" : "1.2.3.4" ,
"date" : "2025-04-18 22: 13 : 07 "
},
"2" : {
"name" : "Archive.zip" ,
"link" : "https://debrid1.bestdebrid.com/dl/TY/def.../Archive.zip" ,
"original" : "https://k2s.cc/file/def456" ,
"ip" : "1.2.3.4" ,
"date" : "2025-04-18 21: 02 : 55 "
}
} Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' \
'https://bestdebrid.com/api/v1/downloadsHistory?num=20' <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$history = json_decode(file_get_contents('https://bestdebrid.com/api/v1/downloadsHistory?num=20', false, $ctx), true);
foreach ($history as $entry) {
echo $entry['name'] . "\n";
} const res = await fetch('https://bestdebrid.com/api/v1/downloadsHistory?num=20', {
headers: { 'Authorization': 'YOUR_API_KEY' }
});
const history = await res.json();
Object.values(history).forEach(e => console.log(e.name));
Supported hosters
Full list of premium hosters with status, icons, domains and a hostfolder flag telling which ones can be expanded via /hostfolder.
GET https://bestdebrid.com/api/v1 /hosts
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param.
Response schema (each entry)
Field Type Description name string Hoster identifier (e.g. rapidgator, mega). status string up or down.picture string Relative path to the standard icon (img/hosters/name .png). picture_100_100 string Relative path to the 100×100 icon. lastcheck string Timestamp of the last availability check. downsincedate string Timestamp since the hoster is down (empty string if up). hostfolder boolean true if the hoster supports folder/playlist expansion via /hostfolder (gofile, youtube, mega, terabox).domains string[] Domain aliases handled as this hoster (e.g. rapidgator.net, rg.to).
Example response
Copy [
{
"name" : "rapidgator" ,
"status" : "up" ,
"picture" : "img/hosters/rapidgator.png" ,
"picture_100_100" : "img/hosters/100_100/rapidgator.png" ,
"lastcheck" : "2025-04-19 14: 00 : 12 " ,
"downsincedate" : "" ,
"hostfolder" : false ,
"domains" : ["rapidgator.net" , "rg.to" ]
},
{
"name" : "mega" ,
"status" : "up" ,
"picture" : "img/hosters/mega.png" ,
"picture_100_100" : "img/hosters/100_100/mega.png" ,
"lastcheck" : "2025-04-19 14: 00 : 14 " ,
"downsincedate" : "" ,
"hostfolder" : true ,
"domains" : ["mega.io" , "mega.nz" , "mega.co.nz" ]
}
] Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' https://bestdebrid.com/api/v1/hosts <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$hosts = json_decode(file_get_contents('https://bestdebrid.com/api/v1/hosts', false, $ctx), true);
// Quick lookup: domain -> hoster entry
$byDomain = [];
foreach ($hosts as $h) {
foreach ($h['domains'] as $d) $byDomain[$d] = $h;
} const hosts = await (await fetch('https://bestdebrid.com/api/v1/hosts', {
headers: { 'Authorization': 'YOUR_API_KEY' }
})).json();
const expandable = hosts
.filter(h => h.hostfolder && h.status === 'up')
.map(h => h.name);
Hoster counts
Number of premium hosters currently up and down. Useful for status dashboards.
GET https://bestdebrid.com/api/v1 /hostscount
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param.
Response schema
Field Type Description totalhosts integer Total number of premium hosters. hostsup integer Hosters currently marked up. hostsdown integer Hosters currently marked down.
Example response
Copy {
"totalhosts" : 87 ,
"hostsup" : 81 ,
"hostsdown" : 6
} Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' https://bestdebrid.com/api/v1/hostscount <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$counts = json_decode(file_get_contents('https://bestdebrid.com/api/v1/hostscount', false, $ctx), true); const counts = await (await fetch('https://bestdebrid.com/api/v1/hostscount', {
headers: { 'Authorization': 'YOUR_API_KEY' }
})).json();
Hoster limits
Per-hoster daily limits (number of downloads and bandwidth) as advertised to end users.
GET https://bestdebrid.com/api/v1 /hostslimits
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param.
Response schema (each entry)
Field Type Description name string Hoster identifier. linksperday integer Max daily unrestricts visible to users. bandwidth string Daily bandwidth cap with units (e.g. "150 GB"); "∞" when unlimited. picture string Relative path to the standard icon. picture_100_100 string Relative path to the 100×100 icon.
Example response
Copy [
{
"name" : "rapidgator" ,
"linksperday" : 25 ,
"bandwidth" : "150 GB" ,
"picture" : "img/hosters/rapidgator.png" ,
"picture_100_100" : "img/hosters/100_100/rapidgator.png"
},
{
"name" : "k2s" ,
"linksperday" : 50 ,
"bandwidth" : "∞" ,
"picture" : "img/hosters/k2s.png" ,
"picture_100_100" : "img/hosters/100_100/k2s.png"
}
] Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' https://bestdebrid.com/api/v1/hostslimits <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$limits = json_decode(file_get_contents('https://bestdebrid.com/api/v1/hostslimits', false, $ctx), true); const limits = await (await fetch('https://bestdebrid.com/api/v1/hostslimits', {
headers: { 'Authorization': 'YOUR_API_KEY' }
})).json();
Unrestrict a link
The main endpoint. Takes a hoster link (up to 5, separated by newlines) and returns unrestricted URLs you can hand to any HTTP client.
POST https://bestdebrid.com/api/v1 /generateLink
Works as both GET and POST. Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param. linkrequired string The hoster URL (or up to 5 URLs separated by \n). passoptional string Password protecting the file on the hoster, if any. ipoptional string IP allowed to download the unrestricted URL. Defaults to the caller's IP. Must be a valid IPv4/IPv6. redirectoptional string If set to yes, returns a 302 to the unrestricted URL instead of JSON.
Response schema
Field Type Description error integer 0 on success, non-zero otherwise (see error table).message string "OK" on success, human-readable otherwise.original_link string Original hoster URL submitted. servId string Internal ID of the generation server that processed the link. hoster string Detected hoster name. hoster-icon string Relative path to the hoster icon. filename string Name of the file. link string The unrestricted download URL. size string Human-readable file size (e.g. "1.35 GiB").
Additional fields — streamable files
When the file extension matches the stream whitelist (mp4, mkv, avi, …), extra fields are added:
Field Type Description stream string Query-string suffix for the web stream player. streammp4 string Direct MP4 transcode URL (when the stream system is enabled). streaminfo string Endpoint returning media metadata.
Additional fields — YouTube
Field Type Description mp3 string Audio-only (MP3) conversion endpoint. mp4 string Video (MP4) conversion endpoint.
Example responses
Copy // Regular file
{
"error" : 0 ,
"message" : "OK" ,
"original_link" : "https://rapidgator.net/file/abc123def456" ,
"servId" : "15" ,
"hoster" : "rapidgator" ,
"hoster-icon" : "../img/hosters/rapidgator.png" ,
"filename" : "Archive.zip" ,
"link" : "https://debrid2.bestdebrid.com/dl/TY/abc.../Archive.zip" ,
"size" : "1.35 GiB"
}
// Streamable file (adds stream* fields)
{
"error" : 0 ,
"message" : "OK" ,
"original_link" : "https://k2s.cc/file/xyz789" ,
"servId" : "12" ,
"hoster" : "k2s" ,
"hoster-icon" : "../img/hosters/k2s.png" ,
"filename" : "Video.mkv" ,
"link" : "https://debrid1.bestdebrid.com/dl/.../Video.mkv" ,
"streammp4" : "https://stream.bestdebrid.com/640/<link>.mp4×tart=0&audio=0" ,
"stream" : "&link=<encrypted>&link=<b64>" ,
"streaminfo" : "https://stream.bestdebrid.com/ends/<link>.mp4" ,
"size" : "4.21 GiB"
}
// Error
{
"error" : 10 ,
"message" : "Link Dead"
} Hostname normalization: aliases are rewritten before processing — rg.to → rapidgator.net, keep2share.cc → k2s.cc, fr.scribd.com → scribd.com, mixdrop.* → mixdrop.ag, TeraBox mirrors → terabox.com, and so on.
Free-user restrictions: free accounts can only unrestrict links from hosters flagged as free where at least one free server is up. VPN/proxy usage is forbidden on free accounts (error 632). A per-file size cap may also apply.
Code samples
cURL PHP JS Python
Copy curl -X POST https://bestdebrid.com/api/v1/generateLink \
-H 'Authorization: YOUR_API_KEY' \
--data-urlencode 'link=https://rapidgator.net/file/abc123' <?php
$ch = curl_init('https://bestdebrid.com/api/v1/generateLink');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: YOUR_API_KEY'],
CURLOPT_POSTFIELDS => http_build_query([
'link' => 'https://rapidgator.net/file/abc123',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($response['error'] === 0) {
echo $response['link'];
} const body = new URLSearchParams({
link: 'https://rapidgator.net/file/abc123'
});
const res = await fetch('https://bestdebrid.com/api/v1/generateLink', {
method : 'POST',
headers: { 'Authorization': 'YOUR_API_KEY' },
body
});
const data = await res.json();
if (data.error === 0) console.log(data.link); import requests
r = requests.post('https://bestdebrid.com/api/v1/generateLink',
headers={'Authorization': 'YOUR_API_KEY'},
data={'link': 'https://rapidgator.net/file/abc123'})
data = r.json()
if data['error'] == 0:
print(data['link'])
Expand a folder / playlist
Resolves a folder, share or playlist into a flat list of file URLs to pass to /generateLink. Supports Gofile, TeraBox (and aliases), YouTube playlists and Mega folders.
POST https://bestdebrid.com/api/v1 /hostfolder
Works as both GET and POST. Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param. linkrequired string The folder / playlist URL. listoptional string YouTube playlist ID — only needed if link is a YouTube URL missing list=. diroptional string TeraBox sub-path inside the share. pathoptional string Alias for dir. fsidoptional string TeraBox file ID — filters a single file from the share. fileNameoptional string TeraBox filename filter (use with fsid).
Response schema
Field Type Description error integer 0 on success, 1 on failure.message string[] | string Array of resolved URLs on success; human-readable error message on failure.
Example responses
Copy // Gofile
{
"error" : 0 ,
"message" : [
"https://gofile.io/download/abc123?server=store1" ,
"https://gofile.io/download/def456?server=store2"
]
}
// Non-supported hoster — link echoed back
{
"error" : 0 ,
"message" : ["https://rapidgator.net/file/abc123" ]
}
// Folder with no direct files (TeraBox)
{
"error" : 1 ,
"message" : "This link contains folders only. We can only unrestrict folders that contain actual files. Please open your link and navigate through the folders until you reach a folder that contains files."
} Safe to pipe every URL through /hostfolder. If the URL isn't a known folder type, the endpoint echoes it back wrapped in the message array — your client can always expand → unrestrict without branching.
Code samples
cURL PHP JS
Copy curl -X POST https://bestdebrid.com/api/v1/hostfolder \
-H 'Authorization: YOUR_API_KEY' \
--data-urlencode 'link=https://gofile.io/d/XXXXX' <?php
$ch = curl_init('https://bestdebrid.com/api/v1/hostfolder');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: YOUR_API_KEY'],
CURLOPT_POSTFIELDS => http_build_query(['link' => $folderLink]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
$files = ($response['error'] === 0) ? $response['message'] : []; const res = await fetch('https://bestdebrid.com/api/v1/hostfolder', {
method : 'POST',
headers: { 'Authorization': 'YOUR_API_KEY' },
body : new URLSearchParams({ link: folderLink })
});
const { error, message } = await res.json();
const files = error === 0 ? message : [];
Add torrent / magnet
Queues a magnet link or an uploaded .torrent file. Downloaded files are then served over HTTPS via /gettorrentFile.
POST https://bestdebrid.com/api/v1 /torrentFile
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param. magnetrequired string Magnet URI, or base64-encoded .torrent file bytes when isFile=1. isFileoptional integer 1 if magnet is a base64 torrent file, 0 for a magnet URI (default). Must be numeric — otherwise error 55.nocheckoptional boolean Skip the duplicate check (adding the same torrent twice otherwise returns error 6). Default false. ipoptional string IP address allowed to later download the resulting files. Must be a valid IPv4/IPv6.
Response schema
Field Type Description error integer 0 on success.message string "OK" on success.torrent_id string Torrent infohash — use it with /gettorrentFile and /deltorrentFile. torrent_link string HTML-escaped torrent name.
Example response
Copy {
"error" : 0 ,
"message" : "OK" ,
"torrent_id" : "dc6521c4fec8641eaa5901164c8e57e16a790e05" ,
"torrent_link" : "Ubuntu.22.04.LTS.iso"
} Limits: premium plan required · max 5 active torrents (error 5) · max 90 GiB per torrent (error 8) · duplicate within 4 days → error 6 unless nocheck=true · if the total size can't be read from the swarm within ~30 s the torrent is removed and error 8 is returned.
Code samples
cURL PHP JS
Copy # magnet URI
curl -X POST https://bestdebrid.com/api/v1/torrentFile \
-H 'Authorization: YOUR_API_KEY' \
--data-urlencode 'magnet=magnet:?xt=urn:btih:dc6521c4fec8641eaa5901164c8e57e16a790e05' \
--data 'isFile=0' <?php
// Adding a magnet
$ch = curl_init('https://bestdebrid.com/api/v1/torrentFile');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Authorization: YOUR_API_KEY'],
CURLOPT_POSTFIELDS => http_build_query([
'magnet' => 'magnet:?xt=urn:btih:...',
'isFile' => 0,
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Adding a .torrent file
$encoded = base64_encode(file_get_contents('/path/to/file.torrent'));
// ... POST with magnet=$encoded & isFile=1 // magnet
await fetch('https://bestdebrid.com/api/v1/torrentFile', {
method : 'POST',
headers: { 'Authorization': 'YOUR_API_KEY' },
body : new URLSearchParams({ magnet: 'magnet:?xt=urn:btih:...', isFile: '0' })
});
// .torrent file
const buf = await fetch('/my.torrent').then(r => r.arrayBuffer());
const b64 = btoa(String.fromCharCode(...new Uint8Array(buf)));
await fetch('https://bestdebrid.com/api/v1/torrentFile', {
method : 'POST',
headers: { 'Authorization': 'YOUR_API_KEY' },
body : new URLSearchParams({ magnet: b64, isFile: '1' })
});
List active torrents
Returns up to the 5 most recent active torrents of the account (completed, in progress or queued — not deleted).
GET https://bestdebrid.com/api/v1 /gettorrentList
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param.
Response schema (each entry)
Field Type Description id string Torrent infohash (use as torrentid in other endpoints). name string Torrent display name. ip string IP that was locked to this torrent. date string Timestamp when the torrent was added.
Example response
Copy [
{
"id" : "dc6521c4fec8641eaa5901164c8e57e16a790e05" ,
"name" : "Ubuntu.22.04.LTS.iso" ,
"ip" : "1.2.3.4" ,
"date" : "2025-04-19 10: 12 : 34 "
}
] Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' https://bestdebrid.com/api/v1/gettorrentList <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$list = json_decode(file_get_contents('https://bestdebrid.com/api/v1/gettorrentList', false, $ctx), true); const list = await (await fetch('https://bestdebrid.com/api/v1/gettorrentList', {
headers: { 'Authorization': 'YOUR_API_KEY' }
})).json();
Get torrent details
Full details of a single torrent: progress, ratio, size, speed and — once finished — the list of downloadable files plus a ZIP archive.
GET https://bestdebrid.com/api/v1 /gettorrentFile
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param. torrentidrequired string Torrent infohash returned by /torrentFile or /gettorrentList.
Response schema
Field Type Description error integer 0 on success.id string Torrent infohash. message string "OK".filename string Torrent display name. img-progress string Relative path to a status icon (img/torrents/ok.gif, deb-loading.gif, wait.png, error.gif). progress float Percent done (0–1). ratio float | string Upload ratio; empty string when unknown. seeders integer Number of connected peers. size integer Total size in bytes. sizeString string Human-readable size (e.g. "3.2 GB"). speed string Current download speed (e.g. "4.52 MB/s"). serverID integer Internal ID of the seedbox storing the torrent. links object | string Once finished, an object with zip (URL of the full ZIP) and files (array of per-file URLs). While downloading, the literal string "Waiting...".
Example response
Copy {
"error" : 0 ,
"id" : "dc6521c4fec8641eaa5901164c8e57e16a790e05" ,
"message" : "OK" ,
"filename" : "Ubuntu.22.04.LTS.iso" ,
"img-progress" : "img/torrents/ok.gif" ,
"progress" : 1 ,
"ratio" : 1.23 ,
"seeders" : 12 ,
"size" : 3489660928 ,
"sizeString" : "3.25 GB" ,
"speed" : "0.00 MB/s" ,
"serverID" : 4 ,
"links" : {
"zip" : "https://seedbox.bestdebrid.com/index.php?zip=dc6521...&filename=Ubuntu.22.04.LTS.iso" ,
"files" : [
"https://seedbox.bestdebrid.com/index.php?filename=dc6521...&id=Ubuntu.22.04.LTS.iso"
]
}
} ZIP endpoint: links.zip downloads the whole torrent content as a single archive — convenient for multi-file releases.
Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' \
'https://bestdebrid.com/api/v1/gettorrentFile?torrentid=dc6521c4...' <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$t = json_decode(file_get_contents('https://bestdebrid.com/api/v1/gettorrentFile?torrentid=' . $hash, false, $ctx), true);
if ($t['error'] === 0 && is_array($t['links'])) {
$zip = $t['links']['zip'];
$files = $t['links']['files'];
} const t = await (await fetch('https://bestdebrid.com/api/v1/gettorrentFile?torrentid=' + hash, {
headers: { 'Authorization': 'YOUR_API_KEY' }
})).json();
if (t.error === 0 && typeof t.links === 'object') {
const zipUrl = t.links.zip;
const files = t.links.files;
}
Delete a torrent
Removes a torrent from the account. Files are wiped from the seedbox only once no other user added it in the last 4 days and its ratio is ≥ 1.
DEL https://bestdebrid.com/api/v1 /deltorrentFile
Parameters
Parameter Type Description authrequired string Your API key — as Authorization header or ?auth= query param. torrentidrequired string Torrent infohash to delete.
Example response
Copy {
"error" : 0 ,
"message" : "Torrent deleted"
} Irreversible. The torrent entry and any generated download links will no longer be accessible from your account.
Irreversible action: no "Try it" block for this endpoint. Code samples
cURL PHP JS
Copy curl -H 'Authorization: YOUR_API_KEY' \
'https://bestdebrid.com/api/v1/deltorrentFile?torrentid=dc6521c4...' <?php
$ctx = stream_context_create(['http' => ['header' => "Authorization: YOUR_API_KEY\r\n"]]);
$r = json_decode(file_get_contents('https://bestdebrid.com/api/v1/deltorrentFile?torrentid=' . $hash, false, $ctx), true); await fetch('https://bestdebrid.com/api/v1/deltorrentFile?torrentid=' + hash, {
headers: { 'Authorization': 'YOUR_API_KEY' }
});