Desbloquea enlaces premium, expande carpetas y listas, gestiona torrents e integra BestDebrid en tus aplicaciones. Referencia completa de los endpoints REST del build 1.07.
JSON sobre HTTPS
Clave API
70 enlaces / 24 h
Build 1.07
La API de BestDebrid es una interfaz REST que devuelve JSON sobre HTTPS. La mayoría de los endpoints aceptan GET y POST, con parámetros en la query string o en el cuerpo de la petición.
Las tablas técnicas (parámetros, campos, ejemplos de código) están en inglés.
URL base
https://bestdebrid.com/api/v1
Estructura de la respuesta
Cada endpoint devuelve un objeto JSON con un entero error (0 = éxito) y un message: texto legible en caso de fallo, o la carga útil (cadena, array, objeto) en caso de éxito. Los endpoints más completos añaden sus propios campos junto a error.
{
"error": 0,
"message": "OK"// additional fields depending on the endpoint
}
Autenticación
Todos los endpoints salvo /, /time y /regex requieren tu clave API. Dos formas de enviarla:
Opción 1 — cabecera HTTP (recomendada)
Authorization: YOUR_API_KEY
Opción 2 — query string
?auth=YOUR_API_KEY
Dónde encontrar tu clave: inicia sesión, aparece en tu perfil (sección API). Regénérala cuando quieras con /newkey. /newkey
Mantén tu clave en secreto. No la expongas en código del lado cliente, repositorios públicos ni extensiones distribuidas. Si se filtra, regénérala de inmediato.
Tu clave API para las pruebasLa usan los bloques «Probar» de esta página; nunca se guarda.
Gestión de errores
El campo error indica el resultado. Un valor distinto de cero va acompañado de un message descriptivo. Los códigos se reutilizan entre endpoints; el significado lo aporta el mensaje.
0Éxito — la petición se completó.
1Parámetro ausente o no válido (enlace vacío, clave API incorrecta, contraseña ausente).
2Formato de URL no válido — el enlace debe empezar por http:// o https://.
3Enlace no soportado, magnet no válido o usuario no conectado.
4Las cuentas gratuitas no pueden desbloquear este alojamiento (solo premium).
5Demasiados torrents activos (máx. 5) o error del servidor de torrents.
6Límite diario gratuito alcanzado, torrent duplicado o alojamiento en mantenimiento.
7Tamaño de archivo superior al límite gratuito, o error al generar el enlace.
8No se pudo determinar el tamaño del torrent, o supera los 90 GiB.
9Cuota del alojamiento alcanzada antes de generar (enlaces diarios en este alojamiento).
10Generación fallida — el alojamiento devolvió un error.
19Límite del alojamiento alcanzado después de generar el enlace.
21Se requiere plan premium para acceder a la API.
22Acceso a la API bloqueado en esta cuenta.
55Servicio en mantenimiento, o tipo de parámetro no válido (p. ej. isFile no numérico).
56Dirección IP no válida, tiempo de espera no transcurrido, o cuota diaria gratuita.
121Cuota diaria de descarga alcanzada (70 enlaces únicos / 24 h).
122Demasiados desbloqueos en curso — reintenta en ~1 min.
632VPN/proxy detectado (prohibido para cuentas gratuitas).
Cuota diaria: cada cuenta está limitada a 70 archivos únicos cada 24 h, web y API incluidos (error 121). Los desbloqueos en curso también cuentan (error 122).
Raíz — lista de endpoints
Devuelve un array JSON de cadenas que describen cada endpoint del build actual. Útil para comprobaciones.
GEThttps://bestdebrid.com/api/v1/
No requiere autenticación.
Ejemplo de respuesta
[
"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] **"
]
const r = await fetch('https://bestdebrid.com/api/v1/time');
console.log((await r.json()).message);
Expresiones regulares de alojamientos
Devuelve la lista de expresiones regulares (PCRE) que reconocen los enlaces soportados. Permite filtrar URLs en el cliente antes de llamar a /generateLink.
GEThttps://bestdebrid.com/api/v1/regex
No requiere autenticación.
Esquema de respuesta
Campo
Tipo
Descripción
[]
string[]
Flat JSON array of PCRE patterns (PHP preg_match syntax, with delimiters). The last pattern matches base64-encoded http(s):// links.
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.
Acción irreversible: sin bloque «Probar» para este endpoint.
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));
Alojamientos soportados
Lista completa de alojamientos premium con estado, iconos, dominios y un indicador hostfolder que señala cuáles admiten expansión de carpetas vía /hostfolder.
GEThttps://bestdebrid.com/api/v1/hosts
Parámetros
Parámetro
Tipo
Descripción
authobligatorio
string
Your API key — as Authorization header or ?auth= query param.
Esquema de respuesta (por entrada)
Campo
Tipo
Descripción
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).
El endpoint principal. Recibe un enlace de alojamiento (hasta 5, separados por saltos de línea) y devuelve URLs desbloqueadas para cualquier cliente HTTP.
POSThttps://bestdebrid.com/api/v1/generateLink
Funciona con GET y con POST.
Parámetros
Parámetro
Tipo
Descripción
authobligatorio
string
Your API key — as Authorization header or ?auth= query param.
linkobligatorio
string
The hoster URL (or up to 5 URLs separated by \n).
passopcional
string
Password protecting the file on the hoster, if any.
ipopcional
string
IP allowed to download the unrestricted URL. Defaults to the caller's IP. Must be a valid IPv4/IPv6.
redirectopcional
string
If set to yes, returns a 302 to the unrestricted URL instead of JSON.
Esquema de respuesta
Campo
Tipo
Descripción
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:
Campo
Tipo
Descripción
stream
string
Query-string suffix for the web stream player.
streammp4
string
Direct MP4 transcode URL (when the stream system is enabled).
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.
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'])
Expandir una carpeta / lista
Resuelve una carpeta, un recurso compartido o una lista en URLs de archivo para pasar a /generateLink. Soporta Gofile, TeraBox (y alias), listas de YouTube y carpetas de Mega.
POSThttps://bestdebrid.com/api/v1/hostfolder
Funciona con GET y con POST.
Parámetros
Parámetro
Tipo
Descripción
authobligatorio
string
Your API key — as Authorization header or ?auth= query param.
linkobligatorio
string
The folder / playlist URL.
listopcional
string
YouTube playlist ID — only needed if link is a YouTube URL missing list=.
diropcional
string
TeraBox sub-path inside the share.
pathopcional
string
Alias for dir.
fsidopcional
string
TeraBox file ID — filters a single file from the share.
fileNameopcional
string
TeraBox filename filter (use with fsid).
Esquema de respuesta
Campo
Tipo
Descripción
error
integer
0 on success, 1 on failure.
message
string[] | string
Array of resolved URLs on success; human-readable error message on failure.
Ejemplos de respuesta
// 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.
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.
Ejemplos de código
# 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'