loading…
Checking server…
Paste YouTube URL
Look Up Formats
Your API Key
How to Use Your Key

Include your key as the X-API-Key header in all API requests:

# Fetch video info with your key
curl -s -X POST "http://localhost:5000/api/info" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{"url":"https://youtu.be/dQw4w9WgXcQ"}'
🔐
Admin Area
Cookie management is password protected.
Enter the admin password to continue.
Why Cookies Are Needed

YouTube blocks download requests from server IPs unless they include a valid user session cookie. Export your browser's YouTube cookies in Netscape format and paste them below.

1
Install "Get cookies.txt LOCALLY" browser extension (Chrome or Firefox).
2
Go to youtube.com while signed into your Google account.
3
Click the extension → Export cookies for youtube.com → copy the full text.
4
Paste below and click Save Cookies.
Set Cookies
Documentation
YouTube Downloader — REST API Reference
BASE_URL=http://localhost:5000 ENGINE=Download Engine MERGER=ffmpeg
Live API Tester
// request
// response
— press Run —
Endpoint Reference
GET /health Server health + cookie status
Returns server status and whether YouTube cookies are currently loaded.
# Check server health
curl -s "http://localhost:5000/health" | jq

# Example response:
{ "ok": true, "hasCookies": true }
GET /api/version Engine version info
Returns the download engine version currently running on the server.
curl -s "http://localhost:5000/api/version" | jq

# Example response:
{ "version": "2026.07.04", "engine": "YouTube Download Engine" }
POST /api/info Full metadata + all formats
Extracts complete video metadata and every available format (video-only, combined, audio-only). No URL resolution — fast, no download.
# Get full info for a video
curl -s -X POST "http://localhost:5000/api/info" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtu.be/dQw4w9WgXcQ"}' \
  | jq '{title, duration, view_count, format_count}'

# List only 1080p formats
curl -s -X POST "http://localhost:5000/api/info" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtu.be/dQw4w9WgXcQ"}' \
  | jq '.formats[] | select(.height==1080) | {format_id, label, vcodec, acodec, filesize_human}'

# Response fields:
#   id, title, description, thumbnail, duration, duration_string
#   channel, uploader, channel_follower_count, view_count, like_count
#   upload_date, age_limit, tags[], chapters[], subtitles[]
#   format_count, formats[] (sorted best-first)
POST /api/download Resolve direct stream URL(s)
Resolves the actual CDN stream URL(s) for a format. Returns stream_type: "single" for combined streams or "merged" when video and audio are separate (720p+). For merged types, use /api/stream to download.
# Resolve best available quality
curl -s -X POST "http://localhost:5000/api/download" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtu.be/dQw4w9WgXcQ"}'

# Resolve a specific format by ID (get IDs from /api/info)
curl -s -X POST "http://localhost:5000/api/download" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtu.be/dQw4w9WgXcQ","format_id":"137"}'

# Resolve by quality index (0 = best from /api/info formats[])
curl -s -X POST "http://localhost:5000/api/download" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtu.be/dQw4w9WgXcQ","quality_index":0}'
GET /api/stream?url=&format_id=&title= Download + merge to MP4
Full pipeline: server downloads video + best audio, ffmpeg merges them into a single MP4, streams it to the client. Works for all qualities (360p through 4K). Audio is copied losslessly when possible.
# Download best quality as MP4
curl -L -o "video.mp4" \
  "http://localhost:5000/api/stream?url=https://youtu.be/dQw4w9WgXcQ"

# Download specific format (1080p = format_id 137)
curl -L -o "video_1080p.mp4" \
  "http://localhost:5000/api/stream?url=https://youtu.be/dQw4w9WgXcQ&format_id=137&title=RickRoll"

# Stream directly into ffplay (watch without saving)
curl -sL \
  "http://localhost:5000/api/stream?url=https://youtu.be/dQw4w9WgXcQ" \
  | ffplay -

# Query parameters:
#   url        (required)  YouTube video URL
#   format_id  (optional)  format ID from /api/info
#   title      (optional)  Output filename hint
GET /api/getdls?url=&format_id= Upload to Catbox & get CDN URL
Resolves a YouTube video's formats and uploads them to catbox.moe for a permanent CDN link.

With format_id — downloads that exact format via yt-dlp, uploads the file to Catbox (or Litterbox for anonymous uploads), and returns the CDN URL as stream_url. Also returns video_url / audio_url (direct Google CDN links, expire ~6 h).

Without format_id — returns metadata + all available formats with proxy stream_url values (use a specific format_id call to get the Catbox link for one format).

Catbox vs Litterbox: set the CATBOX_USERHASH env var for a registered catbox.moe account (permanent links). Without it, files are uploaded to Litterbox with a 72-hour expiry. Files over 200 MB fall back to the proxy stream_url automatically.
Param Required Description
url ✅ Yes YouTube video URL
format_id Optional Format ID from /api/info. When provided, downloads & uploads that format to Catbox and returns its CDN URL as stream_url.
# Get all formats (metadata listing, no Catbox upload)
curl -s \
  "http://localhost:5000/api/getdls?url=https://youtu.be/dQw4w9WgXcQ" \
  | jq '{title,format_count,formats:[.formats[]|{format_id,label,stream_url}]}'

# Upload format 18 (360p combined) to Catbox → get permanent CDN stream_url
curl -s \
  "http://localhost:5000/api/getdls?url=https://youtu.be/dQw4w9WgXcQ&format_id=18" \
  | jq '{title,stream_type,stream_url}'

# Example response (with format_id)
# {
#   "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
#   "stream_type": "single",
#   "stream_url": "https://litter.catbox.moe/uaslk2.mp4"
# }

# Full pipeline: pick 360p format, get Catbox link, download from CDN
FMT=18
CDN=$(curl -s \
  "http://localhost:5000/api/getdls?url=https://youtu.be/dQw4w9WgXcQ&format_id=$FMT" \
  | jq -r '.stream_url')
curl -L -o "video.mp4" "$CDN"
GET /api/media-items?url= Flat format list
Returns all formats as a flat array, each with an index field. Compatible with older API clients.
curl -s \
  "http://localhost:5000/api/media-items?url=https://youtu.be/dQw4w9WgXcQ" \
  | jq '.[0:3]'   # first 3 formats
Full Workflow Example
Complete shell script: discover formats, pick 1080p, download merged MP4.
#!/usr/bin/env bash
# Full YouTube download workflow using the API

BASE="http://localhost:5000"
URL="https://youtu.be/dQw4w9WgXcQ"

# 1. Fetch all format metadata
INFO=$(curl -s -X POST "$BASE/api/info" \
  -H "Content-Type: application/json" \
  -d "{\"url\":\"$URL\"}")

TITLE=$(echo "$INFO" | jq -r '.title')
echo "Video: $TITLE"

# 2. List available resolutions
echo "$INFO" | jq -r \
  '.formats[] | "\(.label)\t\(.ext)\t\(.filesize_human // "?")"'

# 3. Get the format_id for 1080p
FMT=$(echo "$INFO" | jq -r \
  '.formats[] | select(.height==1080 and .kind=="video") | .format_id' \
  | head -1)
echo "Using format_id: $FMT"

# 4. Download merged 1080p MP4
SAFE=$(echo "$TITLE" | tr -d '[/\\:*?"<>|]')
curl -L -o "${SAFE}.mp4" \
  "$BASE/api/stream?url=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$URL")&format_id=$FMT&title=$SAFE"

echo "Saved: ${SAFE}.mp4"
Preparing…