# YouTube Video, Shorts, Audio & Transcript Downloader (`datapipe/youtube-video-downloader`) Actor

Download YouTube videos, Shorts, playlists, and channels in any quality (144p–4K) and format. Extract audio as MP3, M4A, or Opus. Download subtitles and transcripts in any language. Transcript-only mode at $0.001/video. Geo-restrictions handled automatically. No monthly fee.

- **URL**: https://apify.com/datapipe/youtube-video-downloader.md
- **Developed by:** [Ayoub El Haddad](https://apify.com/datapipe) (community)
- **Categories:** Videos, Social media, Agents
- **Features:** Limited permissions
- **Stats:** 895 total users, 445 monthly users, 99.9% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $6.00 / 1,000 video downloadeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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, Shorts, Audio & Transcript Downloader — Playlists & Channels

Download YouTube videos, Shorts, playlists, and entire channels in any quality and format. Extracts subtitles and transcripts in any language. Handles geo-restrictions automatically. Age-restricted videos require providing your YouTube cookies.

### Features

- **Quality selection** — 144p through 4K (2160p), or `best` for highest available
- **Video and audio formats** — MP4, WebM, MKV for video; MP3, M4A, Opus for audio-only
- **Playlist and channel downloads** — paste any playlist or channel URL; optionally cap with `maxVideosPerPlaylist`
- **Subtitles and captions** — SRT, VTT, or ASS format; manual or auto-generated; any language
- **Transcript-only mode** — returns plain text without downloading or storing the video; at $0.001/video it's the cheapest way to extract text from YouTube at scale
- **Rich optional metadata** — thumbnail URL, view/like/comment counts, description, channel info, fps/codec/bitrate, tags and categories
- **Cookie authentication** — unlocks age-restricted content using your YouTube session
- **Geo-restriction handling** — detects which country the video requires and retries through a matching residential proxy automatically

### Who uses this

**AI and LLM developers** — Batch an entire channel and get a dataset of clean transcripts ready for your RAG pipeline, fine-tuning job, or search index.

**Content creators and marketers** — Download videos in MP4 for repurposing, or pull subtitles to turn any interview into a blog post without manual transcription.

**Course creators and educators** — Download your published videos with auto-generated captions to repackage them into offline materials or captioned clips.

**SEO professionals and researchers** — Extract transcripts at scale to analyse competitor messaging, find keyword gaps, or build text datasets without touching a video file.

**Podcast and audio producers** — Pull MP3 or M4A audio from any video or playlist in one run — no browser extensions, no manual downloads.

**Data scientists and academics** — Build NLP corpora from lectures, conference talks, and interviews across multiple languages via the API.

**Developers building MCP-integrated AI tools** — Connect this actor as an MCP server so Claude, Cursor, or any MCP-compatible client can fetch YouTube content in a single tool call.

### Pricing

Pay only for what you download. No monthly fee.

| Event | Price | When it applies |
|---|---|---|
| Video downloaded | **$0.006** | Per video successfully downloaded |
| Subtitles | **$0.001** | Per video when `includeSubtitles` or `subtitlesOnly` is enabled |

These are the actor fees only. Every run also incurs **Apify platform costs** billed directly by Apify:

- **Residential proxy bandwidth** — required for YouTube to work reliably; billed by Apify at $8/GB on Free and Starter plans, $7.50/GB on Scale, and $7/GB on Business. A typical 1080p video is 200–600 MB, so proxy cost dominates for video downloads. Transcript-only mode uses negligible bandwidth since only small subtitle files are transferred.
- **Compute** — CPU and memory while the actor runs; billed by Apify based on memory allocated and runtime.

#### Examples

| Task | Actor fee | Proxy cost (approx.) |
|---|---|---|
| 100 videos at 360p | $0.60 | ~$32 (4 GB × $8) |
| 100 videos at 1080p | $0.60 | ~$160 (20 GB × $8) |
| 1,000 transcripts only | $1.00 | ~$0.10 |

Transcript-only mode is the most cost-effective option when you only need text — proxy cost is near zero since no video is transferred.

### Input

```json
{
  "videoUrls": [
    "https://youtu.be/qMquIcJWZag",
    "https://youtube.com/shorts/pRjw_XEwXX4"
  ],
  "playlistUrls": [
    "https://www.youtube.com/@Apify/",
    "https://www.youtube.com/playlist?list=PLObrtcm1Kw6Ohp5OC9ymNNBVEgTa2DZuh"
  ],
  "maxVideosPerPlaylist": 2,
  "quality": "1080p",
  "format": "mp4"
}
```

#### Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | Array | — | Individual YouTube video or Shorts URLs |
| `playlistUrls` | Array | — | Playlist or channel URLs to expand and download |
| `maxVideosPerPlaylist` | Integer | All | Max videos per playlist or channel |
| `maxConcurrency` | Integer | `5` | Number of videos to download simultaneously (1–10) |
| `quality` | String | `1080p` | Max quality: `best`, `2160p`, `1440p`, `1080p`, `720p`, `480p`, `360p`, `240p`, `144p` |
| `format` | String | `mp4` | Output format: `mp4`, `webm`, `mkv`, `mp3`, `m4a`, `opus` |
| `cookiesText` | String | — | YouTube cookies in Netscape format for age-restricted videos |
| `includeSubtitles` | Boolean | `false` | Download captions alongside the video |
| `subtitlesOnly` | Boolean | `false` | Skip video download; return captions only |
| `subtitleLanguages` | String | `"auto"` | `"auto"` to detect the video's language, or a specific code like `"en"`, `"fr"`, `"ar"` |
| `subtitleFormat` | String | `srt` | Subtitle file format: `srt`, `vtt`, `ass` |
| `captionOutput` | String | `"both"` | What to store: `"both"` (subtitle file + transcript), `"subtitleFile"`, or `"transcript"` |
| `includeThumbnail` | Boolean | `false` | Add thumbnail URL to output |
| `includeStats` | Boolean | `false` | Add view count, like count, and comment count |
| `includeDescription` | Boolean | `false` | Add full video description |
| `includeChannelInfo` | Boolean | `false` | Add channel name, channel URL, and upload date |
| `includeTechnicalInfo` | Boolean | `false` | Add codec, fps, and bitrate |
| `includeTags` | Boolean | `false` | Add tags and categories |

At least one of `videoUrls` or `playlistUrls` is required. Both can be provided together and are processed in the same run.

#### Supported URL formats

**Videos and Shorts:**

- `https://www.youtube.com/watch?v=VIDEO_ID`
- `https://youtu.be/VIDEO_ID` (sharing tokens like `?si=` are handled automatically)
- `https://youtube.com/shorts/pRjw_XEwXX4`

**Playlists and channels:**

- `https://www.youtube.com/playlist?list=PLAYLIST_ID`
- `https://www.youtube.com/@Apify`
- `https://www.youtube.com/@Apify/videos`
- `https://www.youtube.com/channel/CHANNEL_ID`

### Subtitles and transcripts

Use `subtitleLanguages: "auto"` unless you need a specific language — it detects the video's language, prefers manual tracks, falls back to auto-generated, and never hard-fails when captions are absent. Set a specific code like `"en"` or `"fr"` if you need an exact language; if unavailable the record will include `captions.subtitleError` and the list of languages that are available.

#### Transcript-only mode

Set `subtitlesOnly` to `true` to skip the video download entirely and return only transcript text. No video is stored. At $0.001 per video, this is the cheapest option for transcript extraction.

```json
{
  "videoUrls": ["https://youtu.be/qMquIcJWZag"],
  "subtitlesOnly": true,
  "subtitleLanguages": "auto",
  "captionOutput": "transcript"
}
```

### Cookie authentication

Age-restricted videos require YouTube cookies. Export them using the [Get cookies.txt LOCALLY](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc) extension while logged in, then paste the file contents into `cookiesText`.

> **Use a burner account.** YouTube can ban the account whose cookies are used. Never use your main account — create a throwaway Google account instead.

Cookies must be in Netscape format. Malformed content will cause the download to fail. Cookies are written to a temp file during the download and deleted immediately after — they are never logged or stored.

| Content type | Result |
|---|---|
| Age-restricted videos | Works with cookies, fails without |
| Geo-restricted videos | Handled automatically via residential proxy — no cookies needed |
| Private or members-only videos | Fails regardless of cookies |

### Output

Each successfully downloaded video produces one dataset record:

```json
{
  "status": "success",
  "videoId": "qMquIcJWZag",
  "title": "Apify in 100 Seconds",
  "sourceUrl": "https://youtu.be/qMquIcJWZag",
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/video_qMquIcJWZag.mp4",
  "format": "mp4",
  "quality": "360p",
  "duration": 995,
  "durationFormatted": "16:35",
  "fileSize": 21385391,
  "fileSizeMB": 20.39,
  "processingTime": 53.25,
  "timestamp": "2026-05-13 13:07:12"
}
```

For audio-only formats (`mp3`, `m4a`, `opus`), `quality` is `"audio"`.

In `subtitlesOnly` mode, `downloadUrl`, `fileSize`, and `fileSizeMB` are omitted.

When captions are enabled, a `captions` field is added:

```json
{
  "captions": {
    "language": "en",
    "isAutoGenerated": false,
    "subtitleUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/caption_qMquIcJWZag.en.srt",
    "transcriptUrl": "https://api.apify.com/v2/key-value-stores/abc123/records/caption_qMquIcJWZag.en.txt",
    "transcript": "Welcome everyone to the Apify $1 million challenge award ceremony..."
  }
}
```

If captions are requested in a specific language but unavailable:

```json
{
  "captions": {
    "subtitleError": "No 'en' subtitles available",
    "availableSubtitleLanguages": ["ar", "fr"]
  }
}
```

Failed downloads are recorded too:

```json
{
  "sourceUrl": "https://www.youtube.com/watch?v=PRIVATE_VIDEO",
  "status": "failed",
  "error": "Video unavailable",
  "errorType": "DownloadError"
}
```

Download links are valid for 7 days on the free plan and 31 days on paid plans. Named storages are retained indefinitely — you can rename a run's storage in Apify Console to prevent it from expiring.

### Troubleshooting

**Download fails** — The video may be private, deleted, or geo-restricted to a region where residential proxies are unavailable. Verify it plays in your browser. Private and members-only videos cannot be downloaded even with cookies.

**Quality lower than requested** — The actor selects the best available quality up to your maximum. Some older videos top out at 480p or 720p.

**Playlist only partially downloaded** — Private or region-locked videos fail individually and are recorded with `status: "failed"`. The rest proceed normally.

**No captions returned** — If using `"auto"` and the video has no captions at all, the record succeeds with no `captions` field. YouTube Mix playlists (`?list=RD...`) are not supported.

**Download link expired** — Re-run the actor. Links are valid for 7 days (free plan) or 31 days (paid plans). To keep a link permanently, rename the run's storage in Apify Console — named storages never expire.

### API integration

You can trigger this actor programmatically from any language or tool that can make HTTP requests. Replace `YOUR_API_TOKEN` with your Apify API token.

#### Download videos — Node.js

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('datapipe/youtube-video-downloader').call({
    videoUrls: [
        'https://youtu.be/qMquIcJWZag',
    ],
    quality: '1080p',
    format: 'mp4',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();

for (const item of items) {
    if (item.status === 'success') {
        console.log(`${item.title} — ${item.downloadUrl} (${item.fileSizeMB} MB)`);
    } else {
        console.log(`Failed: ${item.sourceUrl} — ${item.error}`);
    }
}
```

#### Bulk transcript extraction — Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')

## Transcript-only mode — no video stored, costs $0.001/video
run = client.actor('datapipe/youtube-video-downloader').call(run_input={
    'playlistUrls': ['https://www.youtube.com/@Apify/'],
    'maxVideosPerPlaylist': 200,
    'subtitlesOnly': True,
    'subtitleLanguages': 'auto',
    'captionOutput': 'transcript',
})

items = client.dataset(run['defaultDatasetId']).list_items().items
transcripts = [
    {'title': item['title'], 'text': item['captions']['transcript']}
    for item in items
    if item['status'] == 'success' and item.get('captions', {}).get('transcript')
]
## Feed into your RAG pipeline, fine-tuning job, or search index
```

#### cURL

```bash
## Start a run
curl -X POST "https://api.apify.com/v2/acts/datapipe~youtube-video-downloader/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrls": ["https://youtu.be/qMquIcJWZag"],
    "quality": "1080p",
    "format": "mp4",
    "includeSubtitles": true,
    "subtitleLanguages": "auto"
  }'

## Fetch results (replace DATASET_ID with defaultDatasetId from the response above)
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_API_TOKEN"
```

### Support

Open a ticket via Apify Console or use the Issues tab on the actor page.

# Actor input Schema

## `videoUrls` (type: `array`):

Individual YouTube video or Shorts URLs to download.

## `playlistUrls` (type: `array`):

YouTube playlist or channel URLs. All videos will be downloaded.

## `maxVideosPerPlaylist` (type: `integer`):

Maximum number of videos to download per playlist or channel. Leave empty to download all.

## `subtitlesOnly` (type: `boolean`):

Skip the video download entirely and return only subtitles/transcript text. Ideal for transcript extraction pipelines.

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

Download subtitle files alongside the video. Subtitle URLs and transcript text are added to the output.

## `subtitleLanguages` (type: `string`):

Language to download captions for. 'Auto-detect' detects the video's language and downloads whatever captions exist (manual preferred, auto-generated as fallback). A specific language code downloads captions in that exact language — if unavailable the record will include an error and the list of available languages.

## `subtitleFormat` (type: `string`):

Output format for subtitle files.

## `captionOutput` (type: `string`):

What to include in the output when captions are enabled.

## `quality` (type: `string`):

Maximum video quality to download.

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

Output format. Use mp3, m4a, or opus for audio-only extraction.

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

Number of videos to download simultaneously. Higher values are faster but use more memory.

## `includeThumbnail` (type: `boolean`):

Add the video thumbnail URL to the output.

## `includeStats` (type: `boolean`):

Add view count, like count, and comment count to the output.

## `includeDescription` (type: `boolean`):

Add the full video description to the output.

## `includeChannelInfo` (type: `boolean`):

Add channel name, channel URL, and upload date to the output.

## `includeTechnicalInfo` (type: `boolean`):

Add codec, fps, and bitrate details to the output.

## `includeTags` (type: `boolean`):

Add tags and categories to the output.

## `cookiesText` (type: `string`):

YouTube cookies in Netscape format for downloading age-restricted videos. Export using a browser extension like 'Get cookies.txt LOCALLY'.

## Actor input object example

```json
{
  "videoUrls": [
    "https://youtu.be/qMquIcJWZag",
    "https://youtube.com/shorts/pRjw_XEwXX4"
  ],
  "playlistUrls": [
    "https://www.youtube.com/@Apify/",
    "https://www.youtube.com/playlist?list=PLObrtcm1Kw6Ohp5OC9ymNNBVEgTa2DZuh"
  ],
  "maxVideosPerPlaylist": 2,
  "subtitlesOnly": false,
  "includeSubtitles": true,
  "subtitleLanguages": "auto",
  "subtitleFormat": "srt",
  "captionOutput": "both",
  "quality": "1080p",
  "format": "mp4",
  "maxConcurrency": 5,
  "includeThumbnail": false,
  "includeStats": false,
  "includeDescription": false,
  "includeChannelInfo": false,
  "includeTechnicalInfo": false,
  "includeTags": false
}
```

# Actor output Schema

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

One record per video with status, download URL, captions, and metadata

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

Downloaded video and audio files stored in the key-value store

## `subtitles` (type: `string`):

Subtitle files in SRT, VTT, or ASS format stored in the key-value store

# 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 = {
    "videoUrls": [
        "https://youtu.be/qMquIcJWZag",
        "https://youtube.com/shorts/pRjw_XEwXX4"
    ],
    "playlistUrls": [
        "https://www.youtube.com/@Apify/",
        "https://www.youtube.com/playlist?list=PLObrtcm1Kw6Ohp5OC9ymNNBVEgTa2DZuh"
    ],
    "maxVideosPerPlaylist": 2,
    "includeSubtitles": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapipe/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 = {
    "videoUrls": [
        "https://youtu.be/qMquIcJWZag",
        "https://youtube.com/shorts/pRjw_XEwXX4",
    ],
    "playlistUrls": [
        "https://www.youtube.com/@Apify/",
        "https://www.youtube.com/playlist?list=PLObrtcm1Kw6Ohp5OC9ymNNBVEgTa2DZuh",
    ],
    "maxVideosPerPlaylist": 2,
    "includeSubtitles": True,
}

# Run the Actor and wait for it to finish
run = client.actor("datapipe/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 '{
  "videoUrls": [
    "https://youtu.be/qMquIcJWZag",
    "https://youtube.com/shorts/pRjw_XEwXX4"
  ],
  "playlistUrls": [
    "https://www.youtube.com/@Apify/",
    "https://www.youtube.com/playlist?list=PLObrtcm1Kw6Ohp5OC9ymNNBVEgTa2DZuh"
  ],
  "maxVideosPerPlaylist": 2,
  "includeSubtitles": true
}' |
apify call datapipe/youtube-video-downloader --silent --output-dataset

```

## MCP server setup

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