API Reference
Download YouTube videos, audio, captions and metadata, and customize the output, over a simple REST API. All requests and responses use JSON over HTTPS.
Service endpoint
All URIs below are relative to:
https://api.videodl.app
Methods
| Method | Description |
|---|---|
POST /api/start-download | Creates a download job and returns its ID. |
GET /api/download-status | Gets the status, progress and result of a job. |
GET /api/usage | Gets your plan limits and usage for the current billing period. |
How it works
- Create a job. Send the video URL to
start-download. The response contains aworker_id, which identifies the job. - Poll the job. Call
download-statuswith that ID untilstatusisdownloadedorerror. - Fetch the file. Download
download_url(and anyextras) before the link expires.
Authentication
Every request must include your API key in the X-API-Key header. Your key is on the Account page of your dashboard, where you can also reset it; resetting stops the old key immediately. A key can only read jobs created by its own account (a new key after a reset still reads the account's earlier jobs).
File links returned in download_url and extras don't need the key. Each link is unguessable and stops working when it expires.
import os
import requests
API_BASE = "https://api.videodl.app"
HEADERS = {"X-API-Key": os.environ["VIDEODL_API_KEY"]}
export API_BASE="https://api.videodl.app" export VIDEODL_API_KEY="your-api-key"
const API_BASE = "https://api.videodl.app";
const HEADERS = { "X-API-Key": process.env.VIDEODL_API_KEY };
start-download
Creates a download job. The job runs in the background; use the returned worker_id with download-status to follow it.
HTTP request
Request body
Only url is required. Every other field is optional. Leave a field out and the job uses your saved Download Settings. Send a field and it applies to this request only; your saved settings don't change.
{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}
| Field | Type | Description |
|---|---|---|
url
Required | string | The YouTube video URL. Accepted forms: youtube.com/watch?v=, youtu.be/, /shorts/, /embed/, /v/, or the 11-character video ID. Playlist parameters are ignored; only the video is downloaded. |
| Video | ||
resolution | string | Maximum video height. One of 240, 360, 480, 720, 1080, 2160 (4k), 4320 (8k). 4K and 8K need the matching plan feature; higher values are lowered to your plan's maximum. |
container | string | Output container. One of mp4, mkv, webm, mov. If the selected streams can't be stored in that container, the file is delivered as MKV (or MP4 for MOV) instead of failing. |
video_codec | array (string) | Accepted video codecs in order of preference, for example ["vp9", "avc1"]. Values: vp9, av1, avc1 (alias h264). Add "any" as the last item to accept any codec when none of the listed ones is available. |
video_only | boolean | If true, downloads video without an audio track. Can't be combined with audio_only. |
format | string | A raw yt-dlp format selector, for example bestvideo[height<=720]+bestaudio. Requires the Custom formats plan feature. |
| Audio | ||
audio_only | boolean | If true, downloads audio only. The file is MP3 unless you set audio_format. |
audio_format | string | Audio format when audio_only is true. One of mp3, m4a, opus, flac, wav, or original to keep the source audio without converting. |
voice_boost | boolean | If true, prefers YouTube's volume-normalized ("stable volume") audio track when one exists. |
| Extra files | ||
info_json | boolean | If true, also returns the video metadata as .info.json. Available on every plan. |
captions | boolean | If true, also returns subtitles. Requires the Captions plan feature. |
caption_langs | string | 1 to 5 comma-separated language codes, for example "en" or "en,es,pt-PT". Default: "en". Each language is fetched and reported on its own, so one refused language doesn't stop the others. A video's original language downloads most reliably; YouTube often refuses auto-translated subtitles. |
caption_format | string | Caption file format. One of srt, vtt, ass. Default: srt. |
comments | boolean | If true, also returns the comments as .comments.json. Requires the Comments plan feature. |
comments_decoded | boolean | If true, also returns an indented, readable comments file. Needs comments. Requires the Comments plan feature. |
live_chat | boolean | If true, also returns the chat replay of a past live stream. Requires the Comments plan feature. |
skip_download | boolean | If true, skips the media and returns only the requested metadata files. |
| File output | ||
filename | string | File name template, up to 150 characters, for example "{title} [{id}]". Placeholders: {id}, {title}, {uploader}, {channel}, {channel_id}, {upload_date}, {duration}, {view_count}, {like_count}, {resolution}, {ext}, {lang}. These characters aren't allowed: / \ : * ? " < > | %. |
embed_metadata | boolean | If true, writes the title, uploader and date into the file. |
embed_thumbnail | boolean | If true, embeds the thumbnail as cover art. |
thumbnail_format | string | Format of the embedded thumbnail. One of jpg, png, webp. Needs embed_thumbnail. |
| Limits | ||
max_video_size_gb | integer | Skips video streams larger than this many GB. Can't exceed your plan's file-size limit. |
max_audio_size_gb | integer | Skips audio streams larger than this many GB. Can't exceed your plan's file-size limit. |
max_duration_minutes | integer | Rejects videos longer than this. Can't exceed your plan's duration limit. |
| Fallbacks | ||
fallbacks | array (object) | boolean | Up to 5 alternatives, tried in order when the main choice isn't available. Each item can set resolution, video_codec, audio_only, video_only, max_video_size_gb, max_audio_size_gb and voice_boost, for example [{"resolution": "720"}, {"audio_only": true}]. Set to false to turn off the fallbacks saved in your dashboard. |
403 with ERR_PLAN_LIMIT. A feature that isn't on your plan returns 403 with ERR_FEATURE_LOCKED. An unknown field or a value of the wrong type returns 400 with ERR_INVALID_PARAMETER, and the message names the field.Response body
If successful, the response is 202 Accepted with this body:
| Field | Type | Description |
|---|---|---|
worker_id | string | The job ID. Pass it to download-status. |
status | string | Always queued. |
applied | object | The settings used for this job after your request, your saved settings and your plan were combined. max_resolution is an upper limit; the result can be lower when the video isn't available that high. |
{
"worker_id": "d5bddfc8f915",
"status": "queued",
"applied": {
"audio_only": false,
"max_resolution": "720",
"container": "mp4",
"max_video_size_gb": 20
}
}
Examples
Download a video at up to 720p
r = requests.post(
f"{API_BASE}/api/start-download",
headers=HEADERS,
json={"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "resolution": "720"},
timeout=60,
)
r.raise_for_status()
worker_id = r.json()["worker_id"]
curl -X POST "$API_BASE/api/start-download" \
-H "X-API-Key: $VIDEODL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "resolution": "720"}'
const res = await fetch(`${API_BASE}/api/start-download`, {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ", resolution: "720" }),
});
if (!res.ok) throw new Error((await res.json()).error);
const { worker_id } = await res.json();
Download audio as MP3
r = requests.post(
f"{API_BASE}/api/start-download",
headers=HEADERS,
json={"url": "https://youtu.be/dQw4w9WgXcQ", "audio_only": True},
timeout=60,
)
curl -X POST "$API_BASE/api/start-download" \
-H "X-API-Key: $VIDEODL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://youtu.be/dQw4w9WgXcQ", "audio_only": true}'
const res = await fetch(`${API_BASE}/api/start-download`, {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://youtu.be/dQw4w9WgXcQ", audio_only: true }),
});
Download with captions and metadata
r = requests.post(
f"{API_BASE}/api/start-download",
headers=HEADERS,
json={
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"resolution": "1080",
"info_json": True,
"captions": True,
"caption_langs": "en,es",
},
timeout=60,
)
curl -X POST "$API_BASE/api/start-download" \
-H "X-API-Key: $VIDEODL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "resolution": "1080",
"info_json": true, "captions": true, "caption_langs": "en,es"}'
const res = await fetch(`${API_BASE}/api/start-download`, {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
resolution: "1080",
info_json: true,
captions: true,
caption_langs: "en,es",
}),
});
download-status
Gets a job: its status, progress while it runs, and the file links when it finishes.
HTTP request
Query parameters
| Parameter | Type | Description |
|---|---|---|
worker_id
Required | string | The job ID returned by start-download. |
Response body
If successful, the response is 200 OK with a Job. A job that failed still returns 200: check status.
Example
job = requests.get(
f"{API_BASE}/api/download-status",
headers=HEADERS,
params={"worker_id": worker_id},
timeout=30,
).json()
print(job["status"])
curl "$API_BASE/api/download-status?worker_id=d5bddfc8f915" \ -H "X-API-Key: $VIDEODL_API_KEY"
const job = await fetch(
`${API_BASE}/api/download-status?worker_id=${encodeURIComponent(worker_id)}`,
{ headers: HEADERS },
).then((r) => r.json());
console.log(job.status);
usage
Gets your plan limits and what you've used in the current billing period.
HTTP request
Response body
| Field | Type | Description |
|---|---|---|
plan | string | Your plan name. |
video_limit | integer | Downloads allowed per billing period. 0 means unlimited. |
videos_used | integer | Completed downloads in this period. Jobs that are still running also count toward video_limit when you start a new one; failed jobs don't count. |
bandwidth_gb | integer | Data allowed per billing period, in GB. 0 means unlimited. |
bandwidth_used_bytes | integer | Total size of completed downloads in this period, in bytes. |
rate_per_min | integer | start-download requests allowed per minute. 0 means no limit. |
period_start | string | Start of the current billing period, in ISO 8601 format. |
{
"plan": "enterprise",
"video_limit": 10000,
"videos_used": 128,
"bandwidth_gb": 0,
"bandwidth_used_bytes": 39845888,
"rate_per_min": 10,
"period_start": "2026-11-01T00:00:00+00:00"
}
Job
A download job, as returned by download-status. Fields appear only when they apply to the job's current status.
JSON representation
{
"worker_id": "d5bddfc8f915",
"status": "downloaded",
"updated_at": "2026-11-14T05:24:58.916350+00:00",
"title": "Rick Astley - Never Gonna Give You Up",
"download_url": "https://api.videodl.app/api/file/5f0c2b7e9a1d4c3b8e6f2a9d1c7b4e0a.mp4",
"resolution": "1280x720",
"size": 39845888,
"size_human": "38.0 MB",
"expires_in": "1h",
"expires_at": "2026-11-14T06:24:58.916273+00:00",
"type": "video",
"container": "mp4",
"codecs": { "video": "h264", "audio": "aac" },
"extras": {
"info_json": "https://api.videodl.app/api/file/5f0c2b7e9a1d4c3b8e6f2a9d1c7b4e0a.info.json",
"captions": ["https://api.videodl.app/api/file/5f0c2b7e9a1d4c3b8e6f2a9d1c7b4e0a.en.srt"]
},
"extras_status": {
"info_json": { "status": "ok" },
"captions": {
"status": "partial",
"languages": {
"en": { "status": "ok", "url": "https://api.videodl.app/api/file/5f0c2b7e9a1d4c3b8e6f2a9d1c7b4e0a.en.srt" },
"es": { "status": "failed", "error_code": 70, "error_label": "CAPTIONS_RATE_LIMITED",
"error": "YouTube isn't allowing the 'es' subtitles to be downloaded right now. Try again later or use a different language." }
}
}
},
"partial": true,
"warnings": ["YouTube isn't allowing the 'es' subtitles to be downloaded right now. Try again later or use a different language."],
"progress": { "stage": "done", "percent": 100, "eta_seconds": 0, "attempt": 1 }
}
Fields
| Field | Type | Description |
|---|---|---|
worker_id | string | The job ID. |
status | enum | The job status. See Status. |
updated_at | string | When the job last changed, in ISO 8601 format. |
title | string | The video title, once known. |
progress | object | Progress of the job. See Progress. |
retry_after | integer | While the job is running: the minimum number of seconds to wait before polling again. |
download_url | string | When downloaded: the link to the file. Empty for metadata-only jobs. |
type | enum | When downloaded: video, audio or metadata. |
container | string | When downloaded: the file format, for example mp4, mkv or mp3. |
codecs | object | When downloaded: the codecs in the file, for example {"video": "av1", "audio": "opus"}. |
resolution | string | When downloaded: the resolution of the file. Can be lower than requested when the video isn't available higher. |
size | integer | When downloaded: the file size in bytes. size_human gives the same value as text. |
expires_at | string | When downloaded: when the links stop working, in ISO 8601 format. expires_in gives the time left as text, or expired once it has passed. For S3, GCS and S3-compatible storage, the download_url is a signed link that stops working after 7 days, so expires_at is that time; the file itself stays in your bucket. If the job also has extras (which we host), expires_at is the earlier of the two, so fetching everything before it is always safe. For Google Drive, expires_at is absent and expires_in is an empty string. |
extras | object | When downloaded: links to the extra files you requested. captions is an array with one link per language; the others are single links. |
extras_status | object | When downloaded and you asked for extras: the result for each one. status is ok or failed; failed items carry error_code, error_label and error. captions is ok, partial or failed, with a result per language under languages (each ok language has its url); when every language failed, captions also carries one combined error_code, error_label and error. See Extra file errors. |
partial | boolean | Sent together with extras_status: true when the main file is ready but at least one extra couldn't be fetched, false when every extra was delivered. |
warnings | array | When partial: the same problems as short messages you can show to your users. |
metadata_only | boolean | When downloaded: true for jobs created with skip_download. |
error | string | When error: a message you can show to your users. |
error_code | integer | When error: the error code. See Errors. |
error_label | string | When error: the error name, for example VIDEO_PRIVATE. |
error_type | enum | When error: video_unavailable (the video can't be downloaded), video_error (the video doesn't match your request or plan), or download_error (anything else, usually a temporary problem worth retrying later; check error_code for the exact reason). |
Status
| Value | Description |
|---|---|
queued | The job is waiting to start. |
assigned | The job has started and is reading the video's details. |
downloading | The job is running. See progress for details. |
downloaded | The job finished. The file links are ready. |
error | The job failed. See error, error_code and error_type. |
Progress
| Field | Type | Description |
|---|---|---|
stage | enum | The current step: queued, starting (reading the video's details, usually a few seconds), downloading, processing (merging, converting or embedding), uploading (to your storage), retrying, done or failed. |
percent | number | Progress of the whole job from 0 to 100, covering video and audio together. Never goes down within an attempt, and stays at 99 until the file is ready. null when the size isn't known yet. |
downloaded_bytes | integer | Bytes downloaded so far. |
total_bytes | integer | Expected total size in bytes, when known. |
speed_bps | integer | Current download speed in bytes per second. |
eta_seconds | integer | Estimated seconds left. null when it can't be estimated reliably. |
attempt | integer | The attempt number, starting at 1. If an attempt hits a temporary error, the job is retried automatically: stage is retrying while it waits, then the next attempt starts again from 0%. |
message | string | A short description of the current step, for example "Merging video and audio". |
{
"worker_id": "d5bddfc8f915",
"status": "downloading",
"updated_at": "2026-11-14T05:24:57.851374+00:00",
"title": "Rick Astley - Never Gonna Give You Up",
"progress": {
"stage": "downloading",
"percent": 42.0,
"downloaded_bytes": 108003328,
"total_bytes": 256901120,
"speed_bps": 41943040,
"eta_seconds": 4,
"attempt": 1
},
"retry_after": 3
}
Track progress
These functions poll a job and report its progress until it finishes. They handle every outcome: each stage, success, failure, rate limits (429), a rejected key (401, 403), an unknown, expired or malformed job ID (404, 400), and server or network errors, which are retried with increasing delays, giving up after 5 failures in a row. Set every to how often to check, in seconds; they never check sooner than retry_after.
Example display, drawn from stage, percent, downloaded_bytes, total_bytes, speed_bps, eta_seconds and message.
import sys, time, requests
STAGES = {"queued": "Queued", "starting": "Getting ready", "downloading": "Downloading",
"processing": "Processing", "uploading": "Uploading", "retrying": "Retrying",
"done": "Done", "failed": "Failed"}
def human(n):
for unit in ("B", "KB", "MB", "GB"):
if n < 1024: return f"{n:.0f} {unit}" if unit == "B" else f"{n:.1f} {unit}"
n /= 1024
return f"{n:.1f} TB"
def draw(data):
p = data.get("progress") or {}
stage = p.get("stage") or {"assigned": "starting"}.get(data["status"], data["status"])
pct = None if stage in ("queued", "starting") else p.get("percent")
bar = ("#" * int(pct / 5)).ljust(20, ".") if pct is not None else "~" * 20
bits = [STAGES.get(stage, stage), f"[{bar}]", f"{pct:.0f}%" if pct is not None else ""]
if p.get("total_bytes"): bits.append(f"{human(p.get('downloaded_bytes') or 0)} of {human(p['total_bytes'])}")
if p.get("speed_bps"): bits.append(f"{human(p['speed_bps'])}/s")
if p.get("eta_seconds") is not None: bits.append(f"ETA {p['eta_seconds']}s")
if (p.get("attempt") or 1) > 1: bits.append(f"try {p['attempt']}")
if p.get("message"): bits.append(p["message"])
sys.stdout.write("\r" + " ".join(b for b in bits if b).ljust(100)[:100])
sys.stdout.flush()
def watch(worker_id, every=30, timeout=3600):
deadline, fails = time.monotonic() + timeout, 0
while time.monotonic() < deadline:
try:
r = requests.get(f"{API_BASE}/api/download-status", headers=HEADERS,
params={"worker_id": worker_id}, timeout=30)
except requests.RequestException as e:
r, err = None, str(e)
if r is not None and r.status_code == 200:
fails, data = 0, r.json()
draw(data)
if data["status"] == "downloaded":
print("\nDone:", data["download_url"]); return data
if data["status"] == "error":
print(); raise RuntimeError(f"{data.get('error_label')} (#{data.get('error_code')}): {data.get('error')}")
time.sleep(max(every, data.get("retry_after") or 0)); continue
if r is not None and r.status_code in (401, 403): raise PermissionError("API key not accepted")
if r is not None and r.status_code in (400, 404): raise LookupError(r.json().get("error") or "No such job")
if r is not None and r.status_code == 429:
time.sleep(max(every, (r.json() or {}).get("retry_after", 10))); continue
fails += 1
if fails >= 5: raise ConnectionError(err if r is None else f"HTTP {r.status_code}")
time.sleep(min(60, max(every, 5) * 2 ** (fails - 1)))
raise TimeoutError(f"gave up after {timeout}s")
watch(worker_id, every=5)
watch_download() {
local id="$1" every="${2:-30}" fails=0 out code json wait
while true; do
out=$(curl -s -w '\n%{http_code}' "$API_BASE/api/download-status?worker_id=$id" \
-H "X-API-Key: $VIDEODL_API_KEY")
code=${out##*$'\n'}; json=${out%$'\n'*}
case "$code" in
200)
fails=0
printf '\r%-90s' "$(jq -r '.progress as $p | [($p.stage // .status),
(if ($p.stage | IN("downloading","processing","uploading")) and $p.percent != null
then "\($p.percent | floor)%" else empty end),
(if $p.eta_seconds != null and $p.stage != "done" then "ETA \($p.eta_seconds)s" else empty end),
($p.message // empty)] | join(" ")' <<<"$json")"
case "$(jq -r .status <<<"$json")" in
downloaded) echo; jq -r .download_url <<<"$json"; return 0 ;;
error) echo; jq -r '"\(.error_label) (#\(.error_code)): \(.error)"' <<<"$json" >&2; return 1 ;;
esac
wait=$(jq -r '.retry_after // 0' <<<"$json"); sleep $(( wait > every ? wait : every )) ;;
401|403) echo "API key not accepted" >&2; return 1 ;;
400|404) jq -r '.error // "No such job"' <<<"$json" >&2; return 1 ;;
429) wait=$(jq -r '.retry_after // 10' <<<"$json"); sleep $(( wait > every ? wait : every )) ;;
*)
fails=$((fails + 1))
[ "$fails" -ge 5 ] && { echo "Can't reach the server (HTTP $code)" >&2; return 1; }
wait=$(( (every < 5 ? 5 : every) * (1 << (fails - 1)) )); sleep $(( wait > 60 ? 60 : wait )) ;;
esac
done
}
watch_download d5bddfc8f915 5
async function watchDownload(workerId, { apiBase, apiKey, every = 30, onUpdate = () => {} }) {
const sleep = s => new Promise(r => setTimeout(r, s * 1000));
let fails = 0;
for (;;) {
let res = null, data = null;
try {
res = await fetch(`${apiBase}/api/download-status?worker_id=${encodeURIComponent(workerId)}`,
{ headers: { "X-API-Key": apiKey }, cache: "no-store" });
data = await res.json().catch(() => null);
} catch (e) { res = null; }
if (res && res.status === 200 && data) {
fails = 0;
const p = data.progress || {};
const stage = data.status === "downloaded" ? "done" : data.status === "error" ? "failed"
: p.stage || (data.status === "assigned" ? "starting" : data.status);
const waiting = stage === "queued" || stage === "starting";
onUpdate({ stage, percent: stage === "done" ? 100 : waiting ? null : p.percent ?? null, eta: p.eta_seconds ?? null,
speed: p.speed_bps ?? null, downloaded: p.downloaded_bytes ?? null, total: p.total_bytes ?? null,
attempt: p.attempt ?? 1, message: p.message || "", raw: data });
if (data.status === "downloaded") return data;
if (data.status === "error") throw new Error(`${data.error_label} (#${data.error_code}): ${data.error}`);
await sleep(Math.max(every, data.retry_after || 0)); continue;
}
if (res && (res.status === 401 || res.status === 403)) throw new Error("API key not accepted");
if (res && (res.status === 400 || res.status === 404)) throw new Error((data && data.error) || "No such job");
if (res && res.status === 429) { await sleep(Math.max(every, (data && data.retry_after) || 10)); continue; }
if (++fails >= 5) throw new Error(res ? `Server error (HTTP ${res.status})` : "Can't reach the server");
await sleep(Math.min(60, Math.max(every, 5) * 2 ** (fails - 1)));
}
}
watchDownload(worker_id, {
apiBase: API_BASE,
apiKey: process.env.VIDEODL_API_KEY,
every: 5,
onUpdate: (v) => {
const pct = v.percent != null ? `${Math.round(v.percent)}%` : "";
const eta = v.eta != null && v.stage !== "done" ? `ETA ${v.eta}s` : "";
process.stdout.write(`\r${[v.stage, pct, eta, v.message].filter(Boolean).join(" ").padEnd(80)}`);
},
}).then(
(job) => console.log(`\n${job.download_url}`),
(err) => { console.error(`\n${err.message}`); process.exitCode = 1; },
);
The Python and curl versions print one line that updates in place:
Downloading [########............] 42% 103.0 MB of 245.0 MB 38.4 MB/s ETA 4s
Errors
The API reports problems in two ways.
- Request rejected.
start-downloadanswers with a4xxor5xxstatus right away. No job is created and nothing counts toward your quota. - Job failed.
start-downloadanswered202, and the job later ended withstatus: "error".download-statusstill returns200.
Both include error, error_code and error_label. Use error_code or error_label in your code; the error text can change. Rejected requests can also include field, hint, plan_limit or retry_after.
File links use the same format. A link that has expired returns 410 with ERR_LINK_EXPIRED, a file that isn't there returns 404, and a malformed link returns 400. Opened in a browser, they show a short page that explains what happened instead of JSON.
{
"error": "`max_video_size_gb` is above your plan's 5 GB file-size limit",
"error_code": 66,
"error_label": "ERR_PLAN_LIMIT",
"field": "max_video_size_gb",
"plan_limit": 5
}
{
"worker_id": "d5bddfc8f915",
"status": "error",
"updated_at": "2026-11-14T05:31:02.118904+00:00",
"title": "Example private video",
"error": "Video is private",
"error_code": 3,
"error_label": "VIDEO_PRIVATE",
"error_type": "video_unavailable",
"progress": { "stage": "failed", "attempt": 1 }
}
22 ERR_DOWNLOAD_FAILED. The table below lists the standard codes; if you ever receive a code that isn't listed, handle it by its error_type.Error codes
| Code | Label | Description |
|---|---|---|
| 1 | VIDEO_DELETED |
Video has been removed |
| 2 | VIDEO_UNAVAILABLE |
Video is unavailable |
| 3 | VIDEO_PRIVATE |
Video is private |
| 4 | VIDEO_GEO_RESTRICTED |
Video is geo-restricted |
| 5 | VIDEO_LIVE |
Video is currently live |
| 6 | VIDEO_AGE_RESTRICTED |
Video is age-restricted |
| 7 | VIDEO_MEMBER_ONLY |
Channel members only |
| 8 | VIDEO_PREMIUM_ONLY |
Requires YouTube Premium |
| 9 | VIDEO_UPCOMING |
Scheduled live not started |
| 10 | VIDEO_TOO_LONG |
Too long to download |
| 11 | VIDEO_SIGN_IN |
Sign-in required |
| 12 | VIDEO_EMBED_DISABLED |
Playback on other websites has been disabled |
| 13 | VIDEO_LIVE_ENDED |
This live event has ended |
| 30 | ERR_RESOLUTION |
Resolution below minimum |
| 31 | ERR_DURATION_EXCEEDED |
Longer than plan's duration limit |
| 40 | ERR_AUTH_MISSING |
Missing API key |
| 41 | ERR_AUTH_INVALID |
Invalid API key |
| 51 | ERR_QUOTA_EXCEEDED |
Monthly download quota exceeded |
| 52 | ERR_FORMAT_UNAVAILABLE |
Requested format not available — check your Download settings and plan limits (resolution, max file size, codec, container) |
| 53 | ERR_INVALID_URL |
Invalid YouTube URL |
| 54 | ERR_BANDWIDTH_EXCEEDED |
Monthly bandwidth limit reached |
| 55 | ERR_RATE_LIMITED |
Too many requests |
| 56 | ERR_NO_WORKERS |
Service is busy right now — please retry shortly |
| 57 | ERR_API_PAUSED |
API temporarily on hold |
| 58 | ERR_FEATURE_LOCKED |
Feature not available on your plan |
| 59 | ERR_SUSPENDED |
Account suspended |
| 60 | ERR_NO_REGION |
This video is geo-restricted by the uploader or rights holder and is not available from any region we can reach. Retrying will not help. |
| 64 | ERR_PLAN_EXPIRED |
Your plan has expired — renew to keep downloading |
| 65 | ERR_INVALID_PARAMETER |
A request parameter is not valid |
| 66 | ERR_PLAN_LIMIT |
This request goes beyond your plan's limits |
| 67 | ERR_NOT_FOUND |
Not found |
| 68 | ERR_METHOD_NOT_ALLOWED |
This HTTP method isn't supported here |
| 69 | ERR_LINK_EXPIRED |
This download link has expired. Download the video again to get a new link |
| 22 | ERR_DOWNLOAD_FAILED |
The download couldn't be completed because of a temporary problem on our side. Try again later. |
Extra file errors
When you download a video or audio file, a problem with an extra file (subtitles, comments, live chat, metadata) doesn't fail the job: the file and every other extra are still delivered, the job is downloaded with partial: true, and the problem is reported in extras_status. These codes only appear there, never as the job's own error_code. With skip_download the metadata file is the download itself, so if it can't be fetched the job fails as usual.
| Code | Label | Description |
|---|---|---|
| 70 | CAPTIONS_RATE_LIMITED | YouTube refused that subtitle language for now (it answered "too many requests"). In our tests this happens mostly with auto-translated languages. Try again later or use a different language; when none of the languages you asked for is among the video's original-language tracks, the message suggests those tracks. |
| 71 | CAPTIONS_NOT_AVAILABLE | The video has no subtitles in that language, not even auto-generated ones. The message lists the video's original-language tracks when there are any. |
| 72 | COMMENTS_UNAVAILABLE | The video has no comments, or comments are turned off. |
| 73 | LIVE_CHAT_UNAVAILABLE | The video has no live chat replay. |
| 74 | EXTRA_FAILED | The extra file couldn't be fetched this time because of a temporary problem. Try again later. |
HTTP status codes
| Status | Description |
|---|---|
200 | Success. For download-status, check status to see whether the job failed. |
202 | The job was created. |
400 | The request is invalid, for example a bad field value or a missing or malformed worker_id. The body says which field. |
401 | The X-API-Key header is missing. |
403 | The key isn't valid, the account is suspended or expired, or the request exceeds your plan. |
404 | The job doesn't exist, its record has been deleted after the retention period, or it belongs to a different account; or there's no endpoint at that path. Code 67. A job whose links have expired still returns 200, with expires_in set to expired. |
405 | start-download, download-status or usage was called with the wrong HTTP method. The body (allowed) and the Allow header name the right one. Code 68. |
410 | A file link has expired. Code 69. |
413 | The request body is larger than 64 KB. Code 65, with field set to body. |
429 | Too many requests, or your quota is used up. Wait for retry_after seconds when it's present. |
503 | The API is paused for maintenance. The body includes a message. |
Rate limits
| Method | Limit |
|---|---|
POST /api/start-download | Your plan's requests per minute, per key |
GET /api/download-status | 300 requests per minute, per key |
GET /api/usage | 60 requests per minute, per key |
Requests over the limit return 429 with error_code 55 (ERR_RATE_LIMITED) and retry_after, the number of seconds to wait. Repeated requests with an invalid key are also limited per IP address.
expires_at passes, based on your plan's link expiry. Download the files before then. Files delivered to your own storage stay there. For S3, GCS and S3-compatible storage the signed download_url works for 7 days; Google Drive links don't expire.VIDEO_LIVE.Complete example
Creates a job, waits for it to finish, and prints the download link.
import os
import time
import requests
API_BASE = "https://api.videodl.app"
HEADERS = {"X-API-Key": os.environ["VIDEODL_API_KEY"]}
def download(url, **options):
r = requests.post(f"{API_BASE}/api/start-download", headers=HEADERS,
json={"url": url, **options}, timeout=60)
if r.status_code != 202:
raise RuntimeError(f"{r.json().get('error_label')}: {r.json().get('error')}")
worker_id = r.json()["worker_id"]
while True:
r = requests.get(f"{API_BASE}/api/download-status", headers=HEADERS,
params={"worker_id": worker_id}, timeout=30)
job = r.json()
if r.status_code == 429:
time.sleep(job.get("retry_after", 10))
continue
if r.status_code != 200:
raise RuntimeError(f"{job.get('error_label')}: {job.get('error')}")
if job["status"] == "downloaded":
return job
if job["status"] == "error":
raise RuntimeError(f"{job['error_label']} (#{job['error_code']}): {job['error']}")
time.sleep(max(5, job.get("retry_after", 3)))
if __name__ == "__main__":
job = download("https://www.youtube.com/watch?v=dQw4w9WgXcQ", resolution="720")
print(job["download_url"])
#!/usr/bin/env bash
set -euo pipefail
API_BASE="https://api.videodl.app"
worker_id=$(curl -sS -X POST "$API_BASE/api/start-download" \
-H "X-API-Key: $VIDEODL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "resolution": "720"}' \
| jq -r '.worker_id // empty')
[ -n "$worker_id" ] || { echo "start-download was refused" >&2; exit 1; }
while true; do
job=$(curl -sS "$API_BASE/api/download-status?worker_id=$worker_id" \
-H "X-API-Key: $VIDEODL_API_KEY")
case "$(jq -r '.status // empty' <<<"$job")" in
downloaded) jq -r .download_url <<<"$job"; jq -r '.warnings[]? // empty' <<<"$job" >&2; break ;;
error) jq -r '"\(.error_label) (#\(.error_code)): \(.error)"' <<<"$job" >&2; exit 1 ;;
"") jq -r '"\(.error_label // "error"): \(.error // "no reply")"' <<<"$job" >&2
sleep "$(jq -r '.retry_after // 5' <<<"$job")"; continue ;;
esac
sleep "$(jq -r '.retry_after // 5' <<<"$job")"
done
const API_BASE = "https://api.videodl.app";
const HEADERS = { "X-API-Key": process.env.VIDEODL_API_KEY };
const sleep = (s) => new Promise((r) => setTimeout(r, s * 1000));
async function download(url, options = {}) {
const res = await fetch(`${API_BASE}/api/start-download`, {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({ url, ...options }),
});
const created = await res.json();
if (res.status !== 202) throw new Error(`${created.error_label}: ${created.error}`);
for (;;) {
const r = await fetch(
`${API_BASE}/api/download-status?worker_id=${created.worker_id}`,
{ headers: HEADERS },
);
const job = await r.json();
if (r.status === 429) { await sleep(job.retry_after ?? 10); continue; }
if (!r.ok) throw new Error(`${job.error_label}: ${job.error}`);
if (job.status === "downloaded") return job;
if (job.status === "error") throw new Error(`${job.error_label} (#${job.error_code}): ${job.error}`);
await sleep(Math.max(5, job.retry_after ?? 3));
}
}
const job = await download("https://www.youtube.com/watch?v=dQw4w9WgXcQ", { resolution: "720" });
console.log(job.download_url);
Get your free API key
100 free videos to test with, or 200 with a company or university email. No credit card. Paid plans start at $12/month.