Programmatic access to download YouTube videos and read public website statistics.
/api/ping and /api/download require Authorization: Bearer <token>. Use these from your own integration.
Website statistics, service status, and the changelog are public read-only endpoints. They do not require an account or token.
Token and account management routes use the browser session cookie. API tokens cannot be used for these website actions.
Run a real GET /api/ping request from this page. The test creates a random two-minute token for your signed-in account and deletes it immediately after the request.
Checks that an API token is valid without starting a download. This is useful for verifying a saved token during integration setup.
GET /api/ping
Authorization: Bearer <your_api_token>
A successful response includes { "status": "ok", "message": "Authenticated API request accepted" }.
This is the main endpoint to download videos or audio from YouTube.
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",
"quality": 720
}
quality is optional for MP4 and defaults to 2160 (up to 4K). Supported values are 144, 240, 360, 480, 720, 1080, 1440, and 2160. If the requested maximum is unavailable, the next lower available quality is used. Audio formats ignore this option.
Playlist URLs may contain up to 50 videos. Every video must be 3 hours or shorter. Each API token can request up to 2 playlists per hour. Requests beyond that limit receive 429 Too Many Requests with a Retry-After header.
{
"status": "ok",
"quality": 720,
"url": "/api/downloads/api_1675234.mp4"
}
The returned URL is temporary and downloads the file directly from the API. If it is unavailable, it returns a JSON error explaining whether the file has expired.
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"}'
These read-only endpoints can be used by anyone. They do not expose account details and do not accept or need an API token.
| Endpoint | What it returns | Who can use it | Try it |
|---|---|---|---|
GET /api/status |
Service availability for the database and mail service, plus server uptime and a timestamp. | Anyone. Suitable for a simple health check. | |
GET /api/download-stats |
Lifetime totalDownloads and totalBytes. |
Anyone. Suitable for a compact counter. | |
GET /api/stats |
Lifetime totals, average and largest download size, plus live activeDownloads, queuedDownloads, and maxConcurrentDownloads. |
Anyone. Suitable for the website statistics page or a status display. | |
GET /api/changelog |
The active changelog entries shown by the website. | Anyone. Suitable for a release-notes view. | |
GET /api/downloads/:fileName |
Delivers the temporary file URL returned by POST /api/download. An unavailable file returns a JSON error response. |
Anyone holding the temporary URL. It is not a general file listing. | Use the url from a successful download response. |
curl https://download4yt.live/api/stats
The live queue values can change between requests. Size values are returned in bytes.
These routes power the website controls. They require a signed-in browser session and are not endpoints for bearer-token integrations.
| Route | Use |
|---|---|
GET /api | Open the API token dashboard. |
GET /api/ses | Open the legacy API token dashboard. Use GET /api for the current page. |
POST /api/register | Create a token through the website form using its name field. |
POST /api/revoke-token | Revoke one of the signed-in user's tokens with its id. |
POST /api/cleanup-revoked-tokens | Remove revoked tokens and their associated download history for the signed-in user. |
GET /api/account/manage, GET /api/account/current-user | Read the signed-in user's account management page or current profile data. |
POST /api/account/change-username, /api/account/reset-password-request, /api/account/delete | Website account actions for the signed-in user. |
POST /api/documentation-test-token, DELETE /api/documentation-test-token/:tokenId | Internal controls used only by the “Run API test” button above. The temporary token expires after two minutes. |
POST /api/forgot-password-request starts the email recovery flow. GET /api/reset-password and POST /api/reset-password are used from the emailed reset link. They are public website flows, not bearer-token API endpoints.
format supports: mp4 (video+audio), mp3, flac (audio only).quality sets the maximum MP4 video resolution; omit it to allow up to 4K.Need help integrating? Check the FFmpeg docs for advanced format options.