# YouTube Video Downloader (`deepmine/youtube-video-downloader`) Actor

YouTube Video Downloader saves videos, Shorts and playlists as MP4 with sound (480p by default, up to 720p) or M4A audio. Billed by the second with a 60-second minimum per file. A 4-minute song costs $0.018 as audio. Failed videos are free.

- **URL**: https://apify.com/deepmine/youtube-video-downloader.md
- **Developed by:** [DeepMine](https://apify.com/deepmine) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 11 total users, 10 monthly users, 93.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.13 / 1,000 480p video seconds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Video Downloader

**YouTube Video Downloader** saves videos, Shorts and playlists as **MP4 with sound** (480p by default, up to 720p)
or **M4A audio**. Each file has a download link, title, channel and duration. Billing is per second, with a
60-second minimum per saved file. **A 4-minute song costs $0.018** as audio.

No account, no cookies and no browser extension: you only need the video links.

### What you get

- **MP4 video with sound** (H.264 + AAC), which plays on every phone, computer and editor.
- **M4A audio only** (AAC), for music, podcasts and lectures.
- **Videos, Shorts and playlists.** A playlist link adds its videos (up to 100 from one playlist).
- **One row per file** with a direct download link, ready for a spreadsheet, a script or an automation.
- **Made-for-kids videos** download too.

### How to use it

1. Paste one or more YouTube links (or bare video ids) into **YouTube URLs**.
2. Pick a **Format**: MP4 480p (the default), MP4 720p, MP4 360p, or Audio only (M4A).
3. Click **Start**. When the run ends, open the **Output** tab and click a file link to download it.

If YouTube doesn't offer a video at the height you chose, you get the tallest height it has below that, and the
row's `qualityNote` says why.

### Input example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/PxMEoQ9TXLs",
    "https://www.youtube.com/playlist?list=PLxxxxxxxxxxxxxxxx"
  ],
  "format": "video_480p",
  "maxVideos": 20
}
```

| Field | What it does |
| --- | --- |
| `urls` | Video, Short or playlist links, or bare video ids. |
| `format` | `video_480p` (the default), `video_720p`, `video_360p` or `audio_m4a`. |
| `maxVideos` | Stop after this many videos in all, playlists included (default 100). |
| `maxFileMb` | The largest file to save (default 900 MB). A bigger video is saved one height lower, with a note. |

Downloads stream through disk, so a longer video does not need more memory just to hold its file.

### Output example

These rows come from the Actor's own runs:

| title | channelName | duration | format | quality | fileSizeMb | chargedSeconds |
| --- | --- | --- | --- | --- | --- | --- |
| Baby Shark Dance | #babyshark Most Viewed Video | Baby Shark - Pinkfong Kids' Songs & Stories | 2:16 | video_720p | 720p | 19.29 | 136 |
| Stanford CS229: Machine Learning Lecture 1 - Andrew Ng (Autumn 2018) | Stanford Online | 1:15:20 | video_720p | 720p | 225.98 | 4520 |
| Philly Cheesesteak @ Jim's on South Street | Stay Eatin' Bruh | 0:12 | video_360p | 360p | 1.09 | 60 |
| Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster) | Rick Astley | 3:33 | audio_m4a | audio | 3.45 | 213 |
| Me at the zoo | jawed | 0:19 | video_720p | 240p | 0.74 | 60 |

One full row looks like this:

```json
{
  "videoId": "XqZsoesa55w",
  "title": "Baby Shark Dance | #babyshark Most Viewed Video | Animal Songs | PINKFONG Songs for Children",
  "channelName": "Baby Shark - Pinkfong Kids' Songs & Stories",
  "videoUrl": "https://www.youtube.com/watch?v=XqZsoesa55w",
  "durationSeconds": 136,
  "duration": "2:16",
  "format": "video_720p",
  "quality": "720p",
  "qualityNote": null,
  "container": "mp4",
  "fileSizeBytes": 19288126,
  "fileSizeMb": 19.29,
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<store id>/records/XqZsoesa55w-video-720p.mp4",
  "fileKey": "XqZsoesa55w-video-720p.mp4",
  "fileStorage": "Run key-value store",
  "chargedSeconds": 136,
  "downloadSeconds": 51,
  "downloadedAt": "2026-11-14T11:17:42Z"
}
```

Open the `fileUrl` in each dataset row to download your file. `fileStorage` tells you where it was saved.

Each run also writes a short summary (`OUTPUT` in the key-value store): files saved and failed, with the reason for
each failure, total MB and the seconds charged per event.

### Pricing

You pay only for the files you get, by the second and at the quality you actually get. Missing, private, removed and
failed videos cost nothing, and the dataset rows are free.

| You get | Per minute | Per hour of video |
| --- | --- | --- |
| Audio only (M4A) | $0.0045 | $0.27 |
| MP4 up to 480p | $0.008 | $0.48 |
| MP4 at 720p | $0.016 | $0.96 |

Every file counts at least one minute, so a 12-second Short at 720p costs $0.016. Past the first minute, you pay for
each second, not for each started minute.

What real files cost (lengths and formats from this Actor's own runs):

| File | Length | Saved as | Price |
| --- | --- | --- | --- |
| Rick Astley, Never Gonna Give You Up | 3:33 | audio (M4A) | $0.016 |
| the same video | 3:33 | MP4 720p | $0.057 |
| Baby Shark Dance | 2:16 | MP4 480p | $0.018 |
| A 10-minute talk | 10:00 | MP4 720p | $0.16 |
| Stanford CS229, Lecture 1 | 1:15:20 | MP4 720p | $1.20 |
| A Short | 0:12 | MP4 720p | $0.016 |

If you ask for 720p and YouTube only has 480p, you pay the 480p price. Set a maximum cost per run in the run options:
the run checks it before each video and never goes over.

### Where files are saved

Files are saved to the run’s key-value store for your plan’s data retention period. Download any files you want to keep.

### Good to know

- **A video isn't found:** links to private, removed or non-existent videos get the line "Video not found or
  unavailable" in the summary and cost nothing.
- **Nothing could be downloaded:** YouTube sometimes refuses every proxy IP a run has, most often on plans with only
  a few shared proxy IPs. The run then saves nothing, charges nothing and says so; try again later.
- **Quality:** 1080p and higher and MP3 are not offered yet.

### FAQ

**Do I need a YouTube account or cookies?** No. Paste public links and run.

**Can I download a whole playlist?** Yes, paste the playlist link. Set `maxVideos` to cap how many videos it takes.

**Can I use it from my own code?** Yes. Start runs through the Apify API or one of the Apify client libraries, then
read the dataset rows and download each `fileUrl`.

# Actor input Schema

## `urls` (type: `array`):

Video, Short or playlist URLs (or bare video ids). A playlist adds its videos, up to the maximum below.

## `format` (type: `string`):

Video as MP4 with sound (H.264 + AAC, plays everywhere), or audio only as M4A. A video that isn't offered at the chosen height comes at the tallest height below it.

## `maxVideos` (type: `integer`):

Stop after this many videos in all (playlists included).

## `maxFileMb` (type: `integer`):

The largest file to save. A bigger video is saved one height lower (with a note on its row), or skipped when even that won't fit.

## `datacenterTries` (type: `integer`):

YouTube's bot check refuses many datacenter IPs; this many are tried per video before it is skipped (not charged).

## `maxBotCheckTries` (type: `integer`):

Most datacenter tries for the whole run, so a bad hour can't use up the run's time. 0 = 100 plus 15 per video.

## `residentialMaxMb` (type: `integer`):

Files are never downloaded through residential IPs. When every datacenter IP is refused, a few small residential player checks (up to this many MB per run) tell whether the video can be had at all. 0 turns them off.

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy is the default and the cheapest.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "format": "video_480p",
  "maxVideos": 100,
  "maxFileMb": 900,
  "datacenterTries": 40,
  "maxBotCheckTries": 0,
  "residentialMaxMb": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/youtube-video-downloader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("deepmine/youtube-video-downloader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call deepmine/youtube-video-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,deepmine/youtube-video-downloader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gddzaGXGVpdlohUAf/builds/TbHUmt6w5OV9uY5bH/openapi.json
