YouTube Downloader API Documentation

Programmatic access to download YouTube videos.
All requests require a valid API token in the Authorization header.

POST /api/download

This is the main endpoint to download videos or audio from YouTube.

Request

URL: /api/download

Method: POST

Headers:

Authorization: Bearer <your_api_token>
Content-Type: application/json
    

Body (JSON):

{
  "url": "https://www.youtube.com/watch?v=cNMXSKfWfLQ",
  "format": "mp4"   // Optional. "mp4" (default), "mp3", "flac"
}
    

Response (Success)

{
  "status": "ok",
  "url": "/downloads/api_1675234.mp4"
}
    

The returned URL is temporary and the file is deleted after ~2 minutes.

Example cURL Request

curl -X POST https://download4yt.live/api/download \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=cNMXSKfWfLQ","format":"flac"}'
    

Notes & Limitations

Back to API Tokens Page

Need help integrating? Check the FFmpeg docs for advanced format options.