API Reference Markdown Get free API key

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.

Build with AI Copy this reference as a prompt for your coding agent, or give your agent the plain-text version at /docs.md.

Service endpoint

All URIs below are relative to:

https://api.videodl.app

Methods

MethodDescription
POST /api/start-downloadCreates a download job and returns its ID.
GET /api/download-statusGets the status, progress and result of a job.
GET /api/usageGets your plan limits and usage for the current billing period.

How it works

  1. Create a job. Send the video URL to start-download. The response contains a worker_id, which identifies the job.
  2. Poll the job. Call download-status with that ID until status is downloaded or error.
  3. Fetch the file. Download download_url (and any extras) 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 };
Keep your API key secret. Call the API from your server, not from code that runs in your visitors' browsers. Anyone who has the key can use your quota.

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

POST/api/start-download

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.

Easiest way: set your preferences once in the dashboard. Choose resolution, format, audio, captions, file names and fallbacks under Download Settings in your dashboard. After that, every request only needs the URL, and each video downloads with your saved settings. You can change them any time; new jobs use whatever is saved when they start.
{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}
FieldTypeDescription
url RequiredstringThe 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
resolutionstringMaximum 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.
containerstringOutput 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_codecarray (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_onlybooleanIf true, downloads video without an audio track. Can't be combined with audio_only.
formatstringA raw yt-dlp format selector, for example bestvideo[height<=720]+bestaudio. Requires the Custom formats plan feature.
Audio
audio_onlybooleanIf true, downloads audio only. The file is MP3 unless you set audio_format.
audio_formatstringAudio format when audio_only is true. One of mp3, m4a, opus, flac, wav, or original to keep the source audio without converting.
voice_boostbooleanIf true, prefers YouTube's volume-normalized ("stable volume") audio track when one exists.
Extra files
info_jsonbooleanIf true, also returns the video metadata as .info.json. Available on every plan.
captionsbooleanIf true, also returns subtitles. Requires the Captions plan feature.
caption_langsstring1 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_formatstringCaption file format. One of srt, vtt, ass. Default: srt.
commentsbooleanIf true, also returns the comments as .comments.json. Requires the Comments plan feature.
comments_decodedbooleanIf true, also returns an indented, readable comments file. Needs comments. Requires the Comments plan feature.
live_chatbooleanIf true, also returns the chat replay of a past live stream. Requires the Comments plan feature.
skip_downloadbooleanIf true, skips the media and returns only the requested metadata files.
File output
filenamestringFile 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_metadatabooleanIf true, writes the title, uploader and date into the file.
embed_thumbnailbooleanIf true, embeds the thumbnail as cover art.
thumbnail_formatstringFormat of the embedded thumbnail. One of jpg, png, webp. Needs embed_thumbnail.
Limits
max_video_size_gbintegerSkips video streams larger than this many GB. Can't exceed your plan's file-size limit.
max_audio_size_gbintegerSkips audio streams larger than this many GB. Can't exceed your plan's file-size limit.
max_duration_minutesintegerRejects videos longer than this. Can't exceed your plan's duration limit.
Fallbacks
fallbacksarray (object) | booleanUp 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.
Plan limits always apply. A value above your plan returns 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:

FieldTypeDescription
worker_idstringThe job ID. Pass it to download-status.
statusstringAlways queued.
appliedobjectThe 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

GET/api/download-status?worker_id={worker_id}

Query parameters

ParameterTypeDescription
worker_id RequiredstringThe 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

GET/api/usage

Response body

FieldTypeDescription
planstringYour plan name.
video_limitintegerDownloads allowed per billing period. 0 means unlimited.
videos_usedintegerCompleted 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_gbintegerData allowed per billing period, in GB. 0 means unlimited.
bandwidth_used_bytesintegerTotal size of completed downloads in this period, in bytes.
rate_per_minintegerstart-download requests allowed per minute. 0 means no limit.
period_startstringStart 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

FieldTypeDescription
worker_idstringThe job ID.
statusenumThe job status. See Status.
updated_atstringWhen the job last changed, in ISO 8601 format.
titlestringThe video title, once known.
progressobjectProgress of the job. See Progress.
retry_afterintegerWhile the job is running: the minimum number of seconds to wait before polling again.
download_urlstringWhen downloaded: the link to the file. Empty for metadata-only jobs.
typeenumWhen downloaded: video, audio or metadata.
containerstringWhen downloaded: the file format, for example mp4, mkv or mp3.
codecsobjectWhen downloaded: the codecs in the file, for example {"video": "av1", "audio": "opus"}.
resolutionstringWhen downloaded: the resolution of the file. Can be lower than requested when the video isn't available higher.
sizeintegerWhen downloaded: the file size in bytes. size_human gives the same value as text.
expires_atstringWhen 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.
extrasobjectWhen downloaded: links to the extra files you requested. captions is an array with one link per language; the others are single links.
extras_statusobjectWhen 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.
partialbooleanSent 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.
warningsarrayWhen partial: the same problems as short messages you can show to your users.
metadata_onlybooleanWhen downloaded: true for jobs created with skip_download.
errorstringWhen error: a message you can show to your users.
error_codeintegerWhen error: the error code. See Errors.
error_labelstringWhen error: the error name, for example VIDEO_PRIVATE.
error_typeenumWhen 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

ValueDescription
queuedThe job is waiting to start.
assignedThe job has started and is reading the video's details.
downloadingThe job is running. See progress for details.
downloadedThe job finished. The file links are ready.
errorThe job failed. See error, error_code and error_type.

Progress

FieldTypeDescription
stageenumThe 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.
percentnumberProgress 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_bytesintegerBytes downloaded so far.
total_bytesintegerExpected total size in bytes, when known.
speed_bpsintegerCurrent download speed in bytes per second.
eta_secondsintegerEstimated seconds left. null when it can't be estimated reliably.
attemptintegerThe 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%.
messagestringA 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
Run these on your server. The JavaScript version needs Node.js 18 or later, and the curl version needs jq. To show progress in a web page, have the page ask your own backend for the status instead of sending your API key to the browser.

Errors

The API reports problems in two ways.

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.

Request rejected — 403
{
  "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
}
Job failed — 200
{
  "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 }
}
Temporary problems are retried for you. A job only fails after the automatic retries are used up. Problems on our side are all reported as 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

CodeLabelDescription
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.

CodeLabelDescription
70CAPTIONS_RATE_LIMITEDYouTube 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.
71CAPTIONS_NOT_AVAILABLEThe 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.
72COMMENTS_UNAVAILABLEThe video has no comments, or comments are turned off.
73LIVE_CHAT_UNAVAILABLEThe video has no live chat replay.
74EXTRA_FAILEDThe extra file couldn't be fetched this time because of a temporary problem. Try again later.

HTTP status codes

StatusDescription
200Success. For download-status, check status to see whether the job failed.
202The job was created.
400The request is invalid, for example a bad field value or a missing or malformed worker_id. The body says which field.
401The X-API-Key header is missing.
403The key isn't valid, the account is suspended or expired, or the request exceeds your plan.
404The 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.
405start-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.
410A file link has expired. Code 69.
413The request body is larger than 64 KB. Code 65, with field set to body.
429Too many requests, or your quota is used up. Wait for retry_after seconds when it's present.
503The API is paused for maintenance. The body includes a message.

Rate limits

MethodLimit
POST /api/start-downloadYour plan's requests per minute, per key
GET /api/download-status300 requests per minute, per key
GET /api/usage60 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.

Download links expire. Links to files we host stop working when 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.
Live streams can't be downloaded while they're live. Ended live streams work like regular videos. A stream that is still live fails with 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.