# 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
- **Stats:** 4 total users, 2 monthly users, 100.0% 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. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datapipe/youtube-video-downloader",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Video, Shorts, Audio & Transcript Downloader",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "eNRWyV1DOaDqor0Eg"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datapipe~youtube-video-downloader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datapipe-youtube-video-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datapipe~youtube-video-downloader/runs": {
            "post": {
                "operationId": "runs-sync-datapipe-youtube-video-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datapipe~youtube-video-downloader/run-sync": {
            "post": {
                "operationId": "run-sync-datapipe-youtube-video-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "videoUrls": {
                        "title": "Video URLs",
                        "type": "array",
                        "description": "Individual YouTube video or Shorts URLs to download.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "playlistUrls": {
                        "title": "Playlist / Channel URLs",
                        "type": "array",
                        "description": "YouTube playlist or channel URLs. All videos will be downloaded.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxVideosPerPlaylist": {
                        "title": "Max Videos Per Playlist",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of videos to download per playlist or channel. Leave empty to download all."
                    },
                    "subtitlesOnly": {
                        "title": "Subtitles Only (No Video)",
                        "type": "boolean",
                        "description": "Skip the video download entirely and return only subtitles/transcript text. Ideal for transcript extraction pipelines.",
                        "default": false
                    },
                    "includeSubtitles": {
                        "title": "Include Subtitles",
                        "type": "boolean",
                        "description": "Download subtitle files alongside the video. Subtitle URLs and transcript text are added to the output.",
                        "default": false
                    },
                    "subtitleLanguages": {
                        "title": "Subtitle Language",
                        "enum": [
                            "auto",
                            "af",
                            "sq",
                            "am",
                            "ar",
                            "hy",
                            "az",
                            "eu",
                            "be",
                            "bn",
                            "bs",
                            "bg",
                            "ca",
                            "ceb",
                            "zh-Hans",
                            "zh-Hant",
                            "co",
                            "hr",
                            "cs",
                            "da",
                            "nl",
                            "en",
                            "eo",
                            "et",
                            "fi",
                            "fr",
                            "fy",
                            "gl",
                            "ka",
                            "de",
                            "el",
                            "gu",
                            "ht",
                            "ha",
                            "haw",
                            "iw",
                            "hi",
                            "hmn",
                            "hu",
                            "is",
                            "ig",
                            "id",
                            "ga",
                            "it",
                            "ja",
                            "jv",
                            "kn",
                            "kk",
                            "km",
                            "rw",
                            "ko",
                            "ku",
                            "ky",
                            "lo",
                            "lv",
                            "lt",
                            "lb",
                            "mk",
                            "mg",
                            "ms",
                            "ml",
                            "mt",
                            "mi",
                            "mr",
                            "mn",
                            "my",
                            "ne",
                            "no",
                            "ny",
                            "or",
                            "ps",
                            "fa",
                            "pl",
                            "pt",
                            "pa",
                            "ro",
                            "ru",
                            "sm",
                            "gd",
                            "sr",
                            "st",
                            "sn",
                            "sd",
                            "si",
                            "sk",
                            "sl",
                            "so",
                            "es",
                            "su",
                            "sw",
                            "sv",
                            "tl",
                            "tg",
                            "ta",
                            "tt",
                            "te",
                            "th",
                            "tr",
                            "tk",
                            "uk",
                            "ur",
                            "ug",
                            "uz",
                            "vi",
                            "cy",
                            "xh",
                            "yi",
                            "yo",
                            "zu"
                        ],
                        "type": "string",
                        "description": "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.",
                        "default": "auto"
                    },
                    "subtitleFormat": {
                        "title": "Subtitle Format",
                        "enum": [
                            "srt",
                            "vtt",
                            "ass"
                        ],
                        "type": "string",
                        "description": "Output format for subtitle files.",
                        "default": "srt"
                    },
                    "captionOutput": {
                        "title": "Caption Output",
                        "enum": [
                            "both",
                            "subtitleFile",
                            "transcript"
                        ],
                        "type": "string",
                        "description": "What to include in the output when captions are enabled.",
                        "default": "both"
                    },
                    "quality": {
                        "title": "Video Quality",
                        "enum": [
                            "best",
                            "2160p",
                            "1440p",
                            "1080p",
                            "720p",
                            "480p",
                            "360p",
                            "240p",
                            "144p"
                        ],
                        "type": "string",
                        "description": "Maximum video quality to download.",
                        "default": "1080p"
                    },
                    "format": {
                        "title": "Output Format",
                        "enum": [
                            "mp4",
                            "webm",
                            "mkv",
                            "mp3",
                            "m4a",
                            "opus"
                        ],
                        "type": "string",
                        "description": "Output format. Use mp3, m4a, or opus for audio-only extraction.",
                        "default": "mp4"
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrent Downloads",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Number of videos to download simultaneously. Higher values are faster but use more memory.",
                        "default": 5
                    },
                    "includeThumbnail": {
                        "title": "Include Thumbnail",
                        "type": "boolean",
                        "description": "Add the video thumbnail URL to the output.",
                        "default": false
                    },
                    "includeStats": {
                        "title": "Include Stats",
                        "type": "boolean",
                        "description": "Add view count, like count, and comment count to the output.",
                        "default": false
                    },
                    "includeDescription": {
                        "title": "Include Description",
                        "type": "boolean",
                        "description": "Add the full video description to the output.",
                        "default": false
                    },
                    "includeChannelInfo": {
                        "title": "Include Channel Info",
                        "type": "boolean",
                        "description": "Add channel name, channel URL, and upload date to the output.",
                        "default": false
                    },
                    "includeTechnicalInfo": {
                        "title": "Include Technical Info",
                        "type": "boolean",
                        "description": "Add codec, fps, and bitrate details to the output.",
                        "default": false
                    },
                    "includeTags": {
                        "title": "Include Tags & Categories",
                        "type": "boolean",
                        "description": "Add tags and categories to the output.",
                        "default": false
                    },
                    "cookiesText": {
                        "title": "Cookies (Netscape format)",
                        "type": "string",
                        "description": "YouTube cookies in Netscape format for downloading age-restricted videos. Export using a browser extension like 'Get cookies.txt LOCALLY'."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
