# YouTube Video Downloader: MP4, MP3, Subtitles, Whole Channels (`first-penguin/youtube-video-downloader`) Actor

Save YouTube videos, Shorts, playlists and whole channels as MP4 (360p to 1080p), MP3 or M4A, with subtitles as VTT and plain text. Pay per minute of the quality delivered; failed videos are free. Clip only the part you need, or save only new videos each day with Slack or webhook alerts.

- **URL**: https://apify.com/first-penguin/youtube-video-downloader.md
- **Developed by:** [First Penguin](https://apify.com/first-penguin) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 video minute 720ps

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: MP4, MP3, Subtitles, Whole Channels

Paste YouTube links and get the files: **MP4 video (360p to 1080p), MP3 or M4A audio, subtitles as VTT and plain text**, or just the video details. Works with single videos, Shorts, YouTube Music links, **playlists and whole channels**.

**You pay per minute of what was actually delivered**, at the quality you actually got. Videos that fail are free. Residential connection and compute are included in the price: there is no proxy bill on top.

### What it does

- **Any YouTube link**: video URLs or IDs, Shorts, youtu.be, YouTube Music, playlists, channels (`@handle`, `/channel/UC…`). Duplicates are removed so you never pay twice.
- **MP4 with sound, MP3 or M4A**. Pick the maximum quality (360p, 480p, 720p, 1080p); the best available up to that limit is downloaded. Vertical videos and Shorts count by their short side, so 720p means 720×1280.
- **Small files by default**: video is saved as AV1 or VP9 when YouTube offers it, often half the size of H.264. Need it to play on older Apple devices or in editing software? Choose H.264. Same price either way.
- **Clip only the part you need**: set start and end seconds. You pay only for the length of the clip, and less data is transferred.
- **Subtitles in two forms**: the VTT file and the readable plain text in the row, ready for AI, search or notes. Uploaded subtitles are used first, then YouTube's automatic captions.
- **Only new videos + alerts**: run a channel on a schedule and only videos published since the last run are saved. Get a Slack message or a webhook with the file links.
- **Where files go**: a download link in Apify storage, or straight into your own S3-compatible bucket (AWS S3, Cloudflare R2, Backblaze B2, Wasabi, MinIO…).
- **Age-restricted videos**: add your own YouTube cookies.

### Coming from another YouTube downloader?

| Problem people report | What this Actor does |
|---|---|
| "Sign in to confirm you're not a bot" and the run dies | Residential connection is included. When YouTube asks, the video is retried from a different IP automatically |
| Runs that hang at 100% and keep charging | Every video has a time limit. A video that runs over is stopped and returned as a free error row, and the run moves on |
| "Succeeded" with an empty result | If not a single video could be delivered, the run ends as **failed**, so your automation notices |
| A bill bigger than expected | The length is checked **before** downloading. Videos over your length limit, or over the maximum cost you set for the run, are not started and not charged |
| Proxy traffic billed separately | No proxy bill. One price per delivered minute |

### Who uses it

| Who | For what |
|---|---|
| AI and machine-learning developers | Audio for transcription (Whisper and others), video, audio and subtitle datasets |
| Social media and content teams | Archive your own videos, repurpose them for other platforms, save reference clips and Shorts in bulk |
| Journalists and researchers | Keep a copy of a source before it disappears, with the time it was taken |
| Agencies and marketers | Study competitors' ad videos, build swipe files, monitor videos that show a brand |
| Podcast and audio production | Pull the audio of interviews and talks for editing and transcripts |
| Course creators and education | Export your own course videos with subtitles, take lectures offline |
| Automation and AI agents | From n8n, Make, Zapier or MCP: send a link, get a file link back |

### Pricing

| What you get | Price |
|---|---|
| Audio (MP3 or M4A) | **$0.005 per minute** |
| Video up to 480p (360p, 480p) | **$0.008 per minute** |
| Video 720p | **$0.015 per minute** |
| Video 1080p | **$0.025 per minute** |
| Details only, or subtitles only | **$0.001 per video** |
| Actor start | $0.00005 per run |
| Failed, skipped, too long, over your budget | **Free** |

- Minutes are rounded up per video (a 30-second Short is 1 minute). With a clip, the clip length is billed.
- You are charged for the quality delivered: if you ask for 1080p and the video only exists in 720p, you pay the 720p price.
- Subtitles are free when added to an MP4, MP3 or M4A download.
- Examples: a 4-minute video in 720p costs **$0.06**. A 4-minute song as MP3 costs **$0.02**. 100 Shorts in 720p cost $1.50.

### Input

| Field | What it does | Default |
|---|---|---|
| `urls` | Video, Short, playlist or channel links, or video IDs | — |
| `outputFormat` | `mp4`, `mp3`, `m4a`, `info` (details only), `subtitles` | `mp4` |
| `maxQuality` | `360`, `480`, `720`, `1080` | `720` |
| `videoCodec` | `smallest` (AV1 or VP9 when available) or `h264` (plays everywhere) | `smallest` |
| `maxVideosPerSource` | Newest videos per playlist or channel | 20 |
| `sectionStartSeconds`, `sectionEndSeconds` | Download only this part | whole video |
| `includeSubtitles`, `subtitleLanguages` | Add subtitles (`original` = the video's language, or codes like `en`, `es`) | off, `original` |
| `onlyNewVideos`, `monitorName`, `skipExistingOnFirstRun` | Save only videos that are new since the last run | off |
| `slackWebhookUrl`, `webhookUrl` | One message per run with the saved videos | — |
| `s3Bucket`, `s3Endpoint`, `s3Region`, `s3Prefix`, `s3AccessKeyId`, `s3SecretAccessKey` | Upload to your own bucket instead of Apify storage | — |
| `cookies` | Your own cookies.txt, for age-restricted videos | — |
| `maxVideoMinutes` | Longer videos are skipped before downloading (free) | 180 |
| `perVideoTimeoutSecs` | Time limit per video (0 = automatic) | 0 |
| `botRetries` | Retries from a different IP when YouTube asks to confirm you are not a bot | 2 |
| `maxConcurrency` | Videos processed at the same time (1 to 5) | 3 |

Smallest input:

```json
{ "urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }
```

Archive a channel's new uploads every day as MP3, with a Slack message:

```json
{
  "urls": ["https://www.youtube.com/@YourChannel"],
  "outputFormat": "mp3",
  "onlyNewVideos": true,
  "skipExistingOnFirstRun": true,
  "slackWebhookUrl": "https://hooks.slack.com/services/..."
}
```

### Output

One row per video. Files are in the run's key-value store; `fileUrl` is a direct download link.

```json
{
  "status": "ok",
  "videoId": "aaaaaaaaaaa",
  "url": "https://www.youtube.com/watch?v=aaaaaaaaaaa",
  "title": "Example video",
  "channel": "Example Channel",
  "durationSeconds": 241,
  "uploadDate": "2026-11-18",
  "viewCount": 12030,
  "categories": ["Education"],
  "outputFormat": "mp4",
  "quality": "720p",
  "width": 1280,
  "height": 720,
  "fileSizeBytes": 27310455,
  "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/aaaaaaaaaaa.mp4?signature=…",
  "storage": "apify",
  "billedMinutes": 5,
  "chargedEvent": "video-720p-minute",
  "subtitles": [{ "language": "en", "automatic": true, "vttUrl": "https://api.apify.com/…/aaaaaaaaaaa.en.vtt?signature=…" }],
  "transcriptText": "Hello and welcome…",
  "scrapedAt": "2026-11-21T10:00:00Z"
}
```

A video that could not be delivered is a free row with the reason:

```json
{ "status": "failed", "videoId": "bbbbbbbbbbb", "reason": "private", "reasonText": "Private video" }
```

Reasons include `private`, `unavailable`, `removed`, `members_only`, `age_restricted` (add cookies), `live`, `not_started`, `blocked`, `timeout`, `too_long`, `over_budget`, `no_subtitles`, `invalid_input`, `service_unavailable` (our connection is temporarily down: try again later).

With **Video details only**, each row also lists `availableFormats`: every quality YouTube offers for that video, with codec, frame rate and approximate MB per minute.

A run summary (`RUN_SUMMARY` in the key-value store) lists delivered and failed videos by reason, and the minutes charged per quality.

### Good to know

- **Quality**: up to 1080p. 1440p and 4K are not offered.
- **How long files stay**: files in Apify storage follow your plan's data retention. For long-term storage, use your own S3-compatible bucket.
- **Live streams** cannot be downloaded while they are live; try again after the stream ends.
- **Speed**: most videos take seconds to a few minutes, depending on length and quality.

### Responsible use

Download only videos you own, have permission to use, or that are licensed for reuse (for example Creative Commons). You are responsible for how you use downloaded content and for following YouTube's Terms of Service and copyright law in your country.

**Rights holders**: to ask for content to be blocked from this Actor, open an issue in the **Issues** tab with the video or channel link. We respond within 14 days.

### Related Actors

- [YouTube Transcript Scraper](https://apify.com/first-penguin/youtube-transcript-scraper)
- [YouTube Channel Scraper](https://apify.com/first-penguin/youtube-channel-scraper)

# Actor input Schema

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

Video URLs or 11-character IDs, Shorts, youtu.be links, YouTube Music links, playlists and channels (@handle, /channel/UC…). Duplicates are removed.

## `outputFormat` (type: `string`):

MP4, MP3 and M4A are charged per minute of what was delivered. Details only and subtitles only are charged per video.

## `maxQuality` (type: `string`):

The best quality up to this limit is downloaded. You are charged for the quality actually delivered (360p and 480p share the lower price).

## `videoCodec` (type: `string`):

Same price either way. AV1/VP9 files are often half the size and play in browsers, VLC, Android and recent Windows, Mac and iPhone. Choose H.264 for older Apple devices and editing software.

## `maxVideosPerSource` (type: `integer`):

Newest videos taken from each playlist or channel link.

## `sectionStartSeconds` (type: `integer`):

Download only part of each video, starting here. You pay only for the length of the clip.

## `sectionEndSeconds` (type: `integer`):

End of the clip. Leave empty to go to the end of the video.

## `includeSubtitles` (type: `boolean`):

Also save subtitles as VTT and put the plain text in the row. Free with MP4, MP3 and M4A downloads.

## `subtitleLanguages` (type: `array`):

Language codes such as en, es, ja. "original" means the language of the video. Uploaded subtitles are used first, then automatic captions.

## `onlyNewVideos` (type: `boolean`):

Remember what was saved and, on the next run, save only videos that are new since then. Run it on a schedule to archive a channel every day.

## `monitorName` (type: `string`):

Separate memory for separate monitors (for example one per client).

## `skipExistingOnFirstRun` (type: `boolean`):

Turn on to start from today: the first run only remembers the current videos (free), later runs save what is new.

## `slackWebhookUrl` (type: `string`):

One Slack message per run listing the saved videos with their file links.

## `webhookUrl` (type: `string`):

POST with JSON {event, count, videos\[]} once per run when videos were saved.

## `s3Bucket` (type: `string`):

Leave empty to keep files in Apify storage with a download link. Works with AWS S3, Cloudflare R2, Backblaze B2, Wasabi, MinIO and others.

## `s3Endpoint` (type: `string`):

Leave empty for AWS. For R2: https://<account>.r2.cloudflarestorage.com

## `s3Region` (type: `string`):

For example us-east-1. "auto" for R2.

## `s3Prefix` (type: `string`):

Optional folder inside the bucket.

## `s3AccessKeyId` (type: `string`):

Stored encrypted.

## `s3SecretAccessKey` (type: `string`):

Stored encrypted.

## `cookies` (type: `string`):

Netscape cookies.txt from your own browser, only needed for age-restricted videos. Stored encrypted.

## `maxVideoMinutes` (type: `integer`):

Checked before downloading: longer videos are not started and not charged. 0 = no limit.

## `perVideoTimeoutSecs` (type: `integer`):

0 = automatic, based on length and quality. A video that runs over is stopped and returned as a free error row.

## `botRetries` (type: `integer`):

When YouTube asks to confirm you are not a bot, try again from a different residential IP.

## `maxConcurrency` (type: `integer`):

How many videos are processed in parallel.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "outputFormat": "mp4",
  "maxQuality": "720",
  "videoCodec": "smallest",
  "maxVideosPerSource": 20,
  "includeSubtitles": false,
  "subtitleLanguages": [
    "original"
  ],
  "onlyNewVideos": false,
  "monitorName": "default",
  "skipExistingOnFirstRun": false,
  "maxVideoMinutes": 180,
  "perVideoTimeoutSecs": 0,
  "botRetries": 2,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `videos` (type: `string`):

One row per video: download link, delivered quality, size, details, billed minutes, or the reason it was not delivered.

## `files` (type: `string`):

Downloaded files (MP4, MP3, M4A, VTT) in the run storage.

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

Delivered, not delivered by reason, charged minutes per quality, sources listed.

# 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=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("first-penguin/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=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("first-penguin/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=jNQXAC9IVRw"
  ]
}' |
apify call first-penguin/youtube-video-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,first-penguin/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/wtul44lImHZzl6Yom/builds/cTGQD9Rm8VxkTiUp0/openapi.json
