YouTube to mp4 (YouTube Downloader) with yt-dlp avatar

YouTube to mp4 (YouTube Downloader) with yt-dlp

Pricing

from $0.01 / 1,000 results

Go to Apify Store
YouTube to mp4 (YouTube Downloader) with yt-dlp

YouTube to mp4 (YouTube Downloader) with yt-dlp

Fast And Updated Youtube Video Download API

Pricing

from $0.01 / 1,000 results

Rating

5.0

(1)

Developer

Daniel Georgiev

Daniel Georgiev

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

15 hours ago

Last modified

Categories

Share

YouTube Video Downloader

Download YouTube videos using yt-dlp and receive a public download URL for every downloaded video.

This Actor downloads videos in MP4 format, uploads them to the Actor's default Key-Value Store, and returns a direct public URL that can be shared or downloaded.

Get your first video

HTML Demo

YouTube Downloader YouTube Downloader

Open Interactive Demo

With cURL

curl -s -X POST "https://api.apify.com/v2/acts/danng~youtube-to-mp4-youtube-downloader-with-yt-dlp/run-sync-get-dataset-items?token=YOUR_API_TOKEN" -H "Content-Type: application/json" -d "{\"url\":\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\"}"

Replace YOUR_API_TOKEN with your api token apify_api_asdfg...etc

On Windows

Run in Powershell

Install Apify

irm https://apify.com/install-cli.ps1 | iex

Login

apify login

Open the .mp4 in browser

Start-Process ((echo '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}' | apify call danng/youtube-to-mp4-youtube-downloader-with-yt-dlp --silent --output-dataset | ConvertFrom-Json)[0].downloadUrl)

Features

  • Download one or multiple YouTube videos
  • Supports public and age-restricted videos
  • Optional cookies support
  • Outputs MP4 files
  • Returns public download URLs
  • Simple JSON input
  • Open source

Input

Basic example

{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}

Object format

{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}

With cookies

{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"cookies": "# Netscape HTTP Cookie File\n.youtube.com\tTRUE\t/\tTRUE\t2147483647\tSID\t..."
}

Input fields

FieldTypeRequiredDescription
urlStringYesYouTube URL
cookiesStringNoContents of a Netscape cookie file. Useful for age-restricted, private, members-only, or region-restricted videos.

Output

Successful download:

{
"success": true,
"sourceUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"downloadUrl": "https://api.apify.com/v2/key-value-stores/.../records/video.mp4",
"filename": "video.mp4"
}

Failed download:

{
"success": false,
"url": "https://www.youtube.com/watch?v=...",
"error": "Video unavailable"
}

How it works

  1. Reads one or more YouTube URLs.
  2. Optionally loads the provided cookies.
  3. Downloads the video using yt-dlp.
  4. Uploads the resulting MP4 file to the Actor's default Key-Value Store.
  5. Returns a public download URL.

Supported URLs

  • Standard YouTube videos
  • youtu.be short links
  • YouTube Shorts
  • Individual playlist video URLs

API Example

curl -X POST \
"https://api.apify.com/v2/acts/danng~youtube-to-mp4-youtube-downloader-with-yt-dlp/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'

1 line

$curl -s -X POST "https://api.apify.com/v2/acts/danng~youtube-to-mp4-youtube-downloader-with-yt-dlp/run-sync-get-dataset-items?token=YOUR_API_TOKEN" -H "Content-Type: application/json" -d "{\"url\":\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\"}"

Notes

  • Videos are downloaded using yt-dlp.
  • The Actor processes multiple URLs sequentially.
  • Each downloaded file is uploaded to the Actor's Key-Value Store.
  • The returned downloadUrl is a public URL to the uploaded file.
  • Some videos may require valid cookies for access.

Limitations

  • Download availability depends on YouTube and yt-dlp.
  • Private, members-only, age-restricted, or region-restricted videos require appropriate cookies.
  • Network speed and source availability affect download time.

Disclaimer

Use this Actor only to download content that you have permission to access. You are responsible for complying with YouTube's Terms of Service and all applicable copyright laws.