A high-performance YouTube video download API built with yt-dlp, featuring a retro terminal-style dashboard.
- Maximum Quality: Downloads videos in highest available h.264 quality
- Audio + Video: Automatically merges audio and video using ffmpeg
- Safari Emulation: Uses Safari user-agent to avoid blocks
- Live Progress: WebSocket support for real-time download progress
- Webhook Notifications: HMAC-signed webhook callbacks
- Retro Terminal UI: Dark terminal-style dashboard
- 1000+ Sites: Supports all sites yt-dlp supports
- Railway account
- GitHub account
- Fork/clone this repository to your GitHub
- Create a new Railway project
- Connect your GitHub repository
- Mount a volume at
/data - Set environment variable:
ADMIN_PASSWORD=your_secure_password - Deploy!
| Variable | Required | Description |
|---|---|---|
ADMIN_PASSWORD |
Yes | Password for dashboard access |
PORT |
No | Server port (default: 3000) |
DATA_DIR |
No | Data directory (default: /data) |
All requests require an X-API-Key header:
curl -H "X-API-Key: yt_your_key_here" ...curl -X POST https://your-api.com/api/download/direct \
-H "X-API-Key: yt_your_key_here" \
-H "Content-Type: application/json" \
-d '{"url": "https://youtube.com/watch?v=..."}' \
--output video.mp4const ws = new WebSocket('wss://your-api.com/ws/start?apiKey=yt_key&url=video_url');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Progress:', data.data.progress);
};Configure webhooks to receive notifications:
curl -X POST https://your-api.com/api/download/direct \
-H "X-API-Key: yt_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://youtube.com/watch?v=...",
"webhook_url": "https://your-site.com/webhook",
"webhook_secret": "your-secret-key"
}'Verify webhook signatures:
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Access the dashboard at / (root path):
- Enter your admin password
- Generate API keys
- View recent requests
- Download documentation
| Endpoint | Method | Description |
|---|---|---|
/api/download |
POST | Start download |
/api/download/direct |
POST | Direct streaming download |
/api/download/:id/status |
GET | Check download status |
/api/keys |
GET/POST | Manage API keys |
/api/keys/stats |
GET | Get system stats |
/ws/start |
WS | WebSocket for live progress |
/docs/ |
GET | Documentation page |
| Code | Status | Description |
|---|---|---|
MISSING_API_KEY |
401 | No API key provided |
INVALID_API_KEY |
401 | Invalid or revoked key |
MISSING_URL |
400 | No URL provided |
INVALID_URL |
400 | URL format invalid |
NOT_FOUND |
404 | Download not found |
DOWNLOAD_FAILED |
500 | Download failed |
┌────────────────────────────────────────────────────────────┐
│ Railway Container │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────┐ │
│ │ Dashboard │ │ API Server │ │ /data │ │
│ │ (Next.js) │ │ (Fastify) │ │ Volume │ │
│ └──────────────┘ └──────┬───────┘ └──────────┘ │
│ │ │
│ ┌─────┴─────┐ │
│ │ yt-dlp + │ │
│ │ ffmpeg │ │
│ └───────────┘ │
└────────────────────────────────────────────────────────────┘
- API: Fastify (Node.js 20)
- Dashboard: Next.js 14 + Tailwind CSS
- Video: yt-dlp + ffmpeg
- Storage: File-based JSON
- Deployment: Railway (Docker)
Apache-2.0 Cache bust: Thu Apr 9 21:19:25 CEST 2026