YouTube video downloader API
Download a public YouTube video as MP4 with one POST. The response returns a permanent download URL plus video metadata.
- One POST, One MP4
- Quality Parameter
- Permanent Download URLs
- Every Public Link Shape
- Idempotency Key Support
- Server-Side Key Required
Request examples
curl -X POST "https://api.agentbody.io/v1/youtube/video/download" \
-H "Authorization: Bearer <YOUR_AGENTBODY_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"quality":"144p","url":"YOUR_URL"}'Response examples
Documented responses from the OpenAPI specification.
Downloaded YouTube media link and normalized public video metadata.
{
"duration_seconds": 180,
"format": "mp4",
"quality": "720p",
"size_mb": 15.2,
"title": "Example Video",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"video_content_type": "video/mp4",
"video_id": "dQw4w9WgXcQ",
"video_url": "https://api.apify.com/v2/key-value-stores/example/records/dQw4w9WgXcQ.mp4"
}Features
The youtube.video_download operation saves one public YouTube video as an MP4 file. Your server holds the API key; the endpoint returns a permanent download URL in a single call.
One POST, One MP4
Send POST /v1/youtube/video/download with a public video URL and a quality preference. A successful 200 returns the video title, duration, thumbnail, file size, and a permanent download URL — everything a pipeline needs.
Quality Parameter
Request the resolution your use case needs. The API serves what the source video makes available at the quality you choose, without re-encoding the file on the way out.
Permanent Download URLs
The URL points to a fully saved file, not an expiring CDN redirect. Download from any server, any IP, at any time — safe to hand to queue workers or media servers.
Every Public Link Shape
Watch pages, youtu.be short links, Shorts URLs, and embeds all resolve to the same video. Private, deleted, and age-restricted videos return a structured error.
Idempotency Key Support
Pass an Idempotency-Key header so network retries never trigger a second download or charge. The gateway deduplicates by key.
Server-Side Key Required
The endpoint requires an AgentBody API key held on your server. Route calls through your backend; never ship the key to a client bundle.
How to use
Integrate YouTube video downloads in three API steps.
Get Your API Key
Create a free AgentBody account and generate an API key from the dashboard.
POST The Video URL
Send POST /v1/youtube/video/download with the public video URL and quality preference. Include an Idempotency-Key header for safe retries.
Receive The Download Link
A 200 returns the permanent MP4 URL plus title, duration, thumbnail, and file size. Download directly or hand the URL to your storage pipeline.
Frequently asked questions
How does the YouTube video downloader API work?
Send POST /v1/youtube/video/download with a public video URL and a quality preference. The API saves the video as an MP4 file and returns a permanent download URL with title, duration, thumbnail, and file size.
What quality options are available?
The API serves the resolutions the source video makes available, at the quality you request. Not every video has every resolution — the response reflects what the upload actually contains.
Does the download URL expire?
No. The URL points to a fully saved file rather than a temporary CDN redirect, so it works from any server and any network at any time after the call.
Which videos can be downloaded?
Public videos only. Private, deleted, age-restricted, and region-blocked videos return an error and are not billed.
How am I billed?
Each successful download draws a fixed amount from your AgentBody balance at the gateway-governed price. Failures are not billed; use the Idempotency-Key header to avoid duplicate charges on retries.
Is there a file size or length limit?
Very long videos may be declined by an upstream cost guard that keeps each download at a predictable fixed price. Typical uploads and Shorts process without issue.