# YouTube Video & Shorts Downloader (`calm_builder/youtube-video-shorts-downloader`) Actor

Download YouTube videos and Shorts in MP4, WebM, MKV and more. Choose quality up to 4K, secure hosted download links with retention, structured JSON metadata, optional tags, chapters and transcripts. Preview costs in Estimate mode.

- **URL**: https://apify.com/calm\_builder/youtube-video-shorts-downloader.md
- **Developed by:** [Coder](https://apify.com/calm_builder) (community)
- **Categories:** Videos, Automation, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 video download (per mb)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 and Shorts Downloader

Download public YouTube videos and Shorts in your chosen quality and format. Each successful result includes video details, a secure download link, and optional transcripts — saved to your Apify dataset as structured JSON.

Use it for **media archiving**, **content workflows**, **research**, **republishing pipelines**, and **automation** — without downloading files manually or building your own downloader.

---

### What you get

Each saved row is **one video link** from your input, organized into clear sections:

| Section              | What it contains                                                                 |
| -------------------- | -------------------------------------------------------------------------------- |
| **Identity**         | Original link, video ID, status, content type (`video` or `short`), and title    |
| **`video`**          | Title, description, channel, dates, duration, views, likes, comments, thumbnails |
| **`file`**           | Download link, format, quality, file size, and link expiry time (when completed) |
| **`transcriptFile`** | Reference to a transcript saved with your run (when enabled and available)       |
| **`message`**        | User-friendly status text for failed or skipped items                            |

Results are added to the dataset as each video finishes, so you can preview progress before the run completes.

In **Estimate** mode, rows show projected costs instead of download links — no files are downloaded.

---

### Quick start on Apify

1. Open the Actor in the Apify Console.
2. Set **Run mode** to **Process (download videos)**.
3. Add one or more **YouTube links** (videos or Shorts).
4. Choose **Video quality**, **Output format**, and **File storage duration**.
5. Optionally enable **Detailed video information** and/or **Transcript**.
6. Click **Start** and open the **Dataset** tab when the run finishes.

**Example input (process mode):**

```json
{
  "runMode": "process",
  "videoUrls": [
    "https://www.youtube.com/watch?v=BfsNfFoA0J0",
    "https://www.youtube.com/watch?v=q90zq1-heR4"
  ],
  "videoQuality": "1080p",
  "videoBitrate": "balanced",
  "videoCountry": "US",
  "outputFormat": "mp4",
  "storageRetention": "1w",
  "includeDetailedInfo": true,
  "includeTranscript": true,
  "transcriptLanguage": "auto",
  "transcriptFormat": "json"
}
````

**Example input (estimate mode — cost preview only):**

```json
{
  "runMode": "estimate",
  "videoUrls": ["https://www.youtube.com/watch?v=BfsNfFoA0J0"],
  "videoQuality": "1080p",
  "storageRetention": "1w",
  "includeDetailedInfo": true,
  "includeTranscript": true
}
```

***

### Run modes

| Mode         | What it does                                                                                                                                  |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Process**  | Downloads videos and saves results to the dataset. You are billed only for successful deliveries and selected options.                        |
| **Estimate** | Analyzes your links and returns projected charges. **No download** and **no download billing** — useful for checking cost before a large run. |

Estimated costs are based on video metadata (size, retention, and options). The actual **Process** run may differ slightly from the estimate.

***

### Input parameters

#### YouTube links

|               |                                                                                                     |
| ------------- | --------------------------------------------------------------------------------------------------- |
| **Type**      | List of URLs                                                                                        |
| **Format**    | Regular videos, Shorts, and short links                                                             |
| **Supported** | `https://www.youtube.com/watch?v=...`, `https://www.youtube.com/shorts/...`, `https://youtu.be/...` |

Add one link per row. You can mix videos and Shorts in the same run.

Unsupported or invalid links are skipped with a warning; other links in the same run can still succeed.

#### Video quality

|             |                                                                        |
| ----------- | ---------------------------------------------------------------------- |
| **Type**    | Select                                                                 |
| **Options** | Best available, 4K (2160p), 1440p, 1080p, 720p, 480p, 360p, 240p, 144p |
| **Default** | 480p                                                                   |

This is the **maximum** resolution to download. If that resolution is unavailable, the next best lower resolution is used.

#### Video bitrate

|             |                                                   |
| ----------- | ------------------------------------------------- |
| **Type**    | Select                                            |
| **Options** | **Best quality**, **Balanced**, **Smallest file** |
| **Default** | Balanced                                          |

Within your chosen resolution, this controls file size and quality. **Smallest file** reduces download size and cost.

#### Video country

|             |               |
| ----------- | ------------- |
| **Type**    | Select        |
| **Default** | United States |

Country used to access the video. Choose the country where the video is available if it is blocked in some regions.

#### Output format

|             |                               |
| ----------- | ----------------------------- |
| **Type**    | Select                        |
| **Options** | MP4, WebM, MKV, MOV, AVI, FLV |
| **Default** | MP4                           |

Each downloaded file includes both video and audio.

#### File storage duration

|             |                                                             |
| ----------- | ----------------------------------------------------------- |
| **Type**    | Select                                                      |
| **Options** | 1 day, 3 days, 1 week, 2 weeks, 1 month, 3 months, 6 months |
| **Default** | 1 week                                                      |

How long each **download link** stays active. Files are removed automatically when the period ends. Longer retention increases storage cost.

#### Detailed video information

|             |         |
| ----------- | ------- |
| **Type**    | Boolean |
| **Default** | Off     |

Standard details (title, thumbnail, channel, publish date, view count) are **always included**.

When enabled, adds extra watch-page details when available — such as **tags**, **keywords**, **chapters**, and **metadata rows**. Best suited for regular videos; Shorts may return fewer fields.

#### Transcript options

| Field                   | Description                                                      |
| ----------------------- | ---------------------------------------------------------------- |
| **Include transcript**  | Save spoken content as a separate file with your run results     |
| **Transcript language** | Auto or a specific language (English, Spanish, Arabic, and more) |
| **Transcript format**   | JSON, plain text (TXT), SRT, or VTT                              |

Transcript files are saved with your run. Open them from the run’s **Key-value store** using the `transcriptFile.key` value in each dataset row.

***

### What you will see during a run

The run log is written for end users — progress messages describe download activity only.

#### At the start

- `Video country: United States` (or your selected country)
- Warnings if links were skipped or free-plan limits were applied
- `Starting download for N video link(s).` (process mode)
- `Estimating costs for N video link(s). No downloads will be performed.` (estimate mode)

#### Per video (process mode)

- `{title or URL}: Queued` / `Preparing`
- `Downloading: {title or URL}`
- Progress updates with percentage, size, speed, and ETA — for example:\
  `Spiderhead | Chris Hemsworth | Official Trailer | Netflix — 45% · 120.5 MB / 268.0 MB · 2.1 MB/s · ETA 1m 10s`
- `Saving file: {title or URL}`
- `Downloaded: {title or URL}`

#### When a run finishes

- `Done. 3 downloaded.` (with failed or skipped counts when applicable)
- `Estimate complete. 2 video(s) analyzed.` (estimate mode)

If you stop a run early, finished downloads are saved and you see:\
`Stopping the run and saving finished downloads.`

The run **status bar** also shows live progress — for example:\
`Downloading videos: 1 of 3 finished.`

***

### Output overview

#### Dataset structure (process mode)

- Results are saved to a **single Apify dataset**
- Each row is one input link
- **`status`** is `completed`, `failed`, or `cancelled`
- Successful rows include **`file.downloadUrl`** — use this link before **`file.expiresAt`**
- Optional **`transcriptFile`** points to a transcript in the run key-value store

Field presence varies by video. Not every video includes tags, chapters, or transcripts. Empty arrays or `null` mean no data was available — not necessarily an error.

#### Dataset structure (estimate mode)

- Each row has **`status`: `estimate`** or **`error`**
- **`estimate`** contains projected duration, quality, and file size
- **`pricing`** contains a cost breakdown in USD
- No download link is provided

***

### Output fields

#### Top-level identity

| Field         | Description                                                       |
| ------------- | ----------------------------------------------------------------- |
| `inputUrl`    | The YouTube link you provided                                     |
| `videoId`     | YouTube video ID                                                  |
| `status`      | `completed`, `failed`, `cancelled`, or `estimate` (estimate mode) |
| `contentType` | `video` or `short`                                                |
| `title`       | Video title when available                                        |
| `message`     | User-friendly status message for non-completed items              |
| `error`       | Present on failed items with a plain-language explanation         |

#### `video` — metadata

| Field               | Description                                        |
| ------------------- | -------------------------------------------------- |
| `id`                | Video ID                                           |
| `title`             | Video title                                        |
| `description`       | Full description text                              |
| `channelId`         | Channel ID                                         |
| `author`            | Channel name                                       |
| `publishDate`       | Publish date (ISO 8601)                            |
| `uploadDate`        | Upload date (ISO 8601)                             |
| `category`          | Category label when available                      |
| `lengthSeconds`     | Duration in seconds                                |
| `viewCount`         | View count                                         |
| `likeCount`         | Like count when available                          |
| `commentCount`      | Comment count when available                       |
| `thumbnailUrl`      | Main thumbnail URL                                 |
| `thumbnails`        | List of thumbnail sizes (`url`, `width`, `height`) |
| `captionsAvailable` | Whether captions appear to be available            |
| `embedUrl`          | Embed URL                                          |
| `isLiveContent`     | Whether the video is live content                  |
| `isUpcoming`        | Whether the video is upcoming                      |
| `isEmbeddable`      | Whether embedding is allowed                       |
| `tags`              | Tags when detailed info is enabled                 |
| `keywords`          | Keywords when detailed info is enabled             |
| `chapters`          | Chapter list when available                        |
| `metadataRows`      | Extra metadata rows from the watch page            |

#### `file` — download (completed items only)

| Field           | Description                               |
| --------------- | ----------------------------------------- |
| `downloadUrl`   | Secure link to download the video file    |
| `format`        | File format (for example `mp4`)           |
| `quality`       | Delivered quality (for example `1080p`)   |
| `fileSizeBytes` | File size in bytes                        |
| `expiresAt`     | When the download link expires (ISO 8601) |

#### `transcriptFile` — transcript reference

| Field    | Description                                                                |
| -------- | -------------------------------------------------------------------------- |
| `key`    | Key in the run key-value store (for example `transcript_BfsNfFoA0J0.json`) |
| `format` | Transcript format (`json`, `txt`, `srt`, or `vtt`)                         |

#### Estimate mode fields

| Field                       | Description                                        |
| --------------------------- | -------------------------------------------------- |
| `estimate.durationSeconds`  | Video duration                                     |
| `estimate.quality`          | Estimated delivery quality                         |
| `estimate.fileSizeBytes`    | Estimated file size                                |
| `estimate.transcriptLikely` | Whether a transcript is likely available           |
| `pricing.currency`          | Currency (USD)                                     |
| `pricing.charges`           | Line items with event name, units, and amount      |
| `pricing.totalUsd`          | Estimated total cost                               |
| `pricing.disclaimer`        | Note that estimates may differ from actual billing |

***

### Example output

The excerpts below come from a real **Process** run with three videos at **1080p**, **detailed info**, and **transcripts** enabled. Full output is available in the run dataset.

#### Excerpt — short trailer with transcript

```json
{
  "inputUrl": "https://www.youtube.com/watch?v=BfsNfFoA0J0",
  "videoId": "BfsNfFoA0J0",
  "status": "completed",
  "contentType": "video",
  "title": "Spiderhead | Chris Hemsworth | Official Trailer | Netflix",
  "message": null,
  "video": {
    "id": "BfsNfFoA0J0",
    "title": "Spiderhead | Chris Hemsworth | Official Trailer | Netflix",
    "author": "Netflix",
    "lengthSeconds": 133,
    "viewCount": 10096083,
    "likeCount": 131491,
    "commentCount": 3901,
    "thumbnailUrl": "https://i.ytimg.com/vi/BfsNfFoA0J0/maxresdefault.jpg",
    "captionsAvailable": true,
    "tags": ["Netflix", "Chris Hemsworth", "Joseph Kosinski"],
    "keywords": ["Netflix", "Chris Hemsworth", "Joseph Kosinski"]
  },
  "file": {
    "downloadUrl": "https://example.com/downloads/.../video.mp4",
    "format": "mp4",
    "quality": "1080p",
    "fileSizeBytes": 21263275,
    "expiresAt": "2026-07-05T15:36:35.447856"
  },
  "transcriptFile": {
    "key": "transcript_BfsNfFoA0J0.json",
    "format": "json"
  }
}
```

#### Excerpt — longer music video (larger file)

```json
{
  "inputUrl": "https://www.youtube.com/watch?v=q90zq1-heR4",
  "videoId": "q90zq1-heR4",
  "status": "completed",
  "contentType": "video",
  "title": "Coke Studio Season 10| Naina Moray| Javed Bashir & Akbar Ali feat. Aamir Zaki",
  "video": {
    "id": "q90zq1-heR4",
    "author": "Coke Studio Pakistan",
    "lengthSeconds": 611,
    "viewCount": 7281276
  },
  "file": {
    "downloadUrl": "https://example.com/downloads/.../video.mp4",
    "format": "mp4",
    "quality": "1080p",
    "fileSizeBytes": 187250898,
    "expiresAt": "2026-07-05T15:37:06.568510"
  },
  "transcriptFile": {
    "key": "transcript_q90zq1-heR4.json",
    "format": "json"
  }
}
```

#### Excerpt — failed item

```json
{
  "inputUrl": "https://www.youtube.com/watch?v=invalid-example",
  "videoId": null,
  "status": "failed",
  "title": null,
  "message": "This video could not be downloaded.",
  "error": "This video could not be downloaded.",
  "video": null,
  "file": null
}
```

***

### Pricing (process mode)

This Actor uses **pay-per-event** pricing on Apify. You are charged only when a **Process** run delivers results — **Estimate** mode does not trigger download charges.

Typical charge types:

| Event                    | When it applies                                             |
| ------------------------ | ----------------------------------------------------------- |
| **Download (per MB)**    | Data transferred while downloading each successful video    |
| **Storage (per MB-day)** | Hosted file storage for the retention period you selected   |
| **Detailed info**        | When detailed watch-page metadata is successfully collected |
| **Transcript**           | When a transcript is successfully saved                     |

You are **not** charged for failed or skipped videos. If you stop a run early, you are billed for data already transferred during in-progress downloads.

See the Actor’s **Pricing** tab on Apify for current unit prices.

***

### Free plan limits

On the Apify **free plan**, the Actor automatically applies:

| Setting               | Free limit                        |
| --------------------- | --------------------------------- |
| Video links per run   | **1** (only the first valid link) |
| Video quality         | **720p** maximum                  |
| Video bitrate         | **Smallest file**                 |
| File storage duration | **1 day**                         |

Paid Apify plans can use the full input without these caps. If limits apply, the run log includes a short notice.

Free-plan limits do **not** remove pay-per-event charges on successful downloads — they only restrict input options.

***

### Data quality and limitations

**Public videos only**\
The Actor works with publicly available YouTube videos and Shorts. Private, members-only, or age-restricted content may fail.

**Availability varies**\
Some videos cannot be downloaded due to region restrictions, copyright, or YouTube policy. Failed items include a plain-language message in the dataset.

**Quality and format**\
The delivered quality depends on what YouTube offers for that video. Your selected quality is a maximum — a lower resolution may be used when necessary.

**Download links expire**\
Each `file.downloadUrl` is valid until `file.expiresAt`. Download or copy files before the retention period ends.

**Transcripts**\
Transcripts depend on captions being available for the video and language. Enable **Include transcript** and check `transcriptFile` in the result.

**Compliance**\
You are responsible for using downloaded content in line with applicable laws and [YouTube's Terms of Service](https://www.youtube.com/t/terms).

***

### Tips for best results

1. **Run Estimate first** — Check projected cost before downloading many or large videos.
2. **Use Smallest file bitrate** — Reduces file size and cost when maximum quality within a resolution is not required.
3. **Match video country** — If a video is geo-blocked, try the country where it is normally available.
4. **Start with one link** — Confirm quality and format before a large batch.
5. **Download before expiry** — Save files locally or to your own storage before `expiresAt`.
6. **Open transcripts from the key-value store** — Use the `transcriptFile.key` from each row.
7. **Filter the dataset by `status`** — Export completed rows for download URLs; review `failed` rows separately.
8. **Schedule recurring runs** — Use Apify schedules to refresh downloads or metadata on a cadence.

***

### Frequently asked questions

**Why was my link skipped?**\
The URL may not be a supported YouTube video or Shorts link. Check the run log for warnings.

**Why did my quality change on the free plan?**\
Free-plan runs are capped at 720p, smallest bitrate, 1-day storage, and one link. Upgrade or use a paid Apify plan for full options.

**Why is there no download link?**\
The video may have failed, been skipped when you stopped the run, or you used **Estimate** mode (which never downloads files).

**Why is `tags` or `chapters` null?**\
Enable **Include detailed video information**, and note that Shorts and some videos publish fewer watch-page fields.

**Why is there no transcript?**\
Enable **Include transcript**, pick a language if needed, and confirm captions exist for that video.

**Can I download a whole playlist?**\
Add individual video or Shorts links to **YouTube links**. Playlist URLs are not supported directly.

**Does Estimate mode charge me?**\
No download billing events are triggered in Estimate mode. You only pay standard Apify platform compute for the run itself.

**What happens if I abort a long download?**\
Finished videos are saved to the dataset. In-progress downloads are billed for the data transferred up to the point the run stopped.

***

### Support

For Actor-specific issues, use the **Issues** tab on the Apify store listing or contact the publisher through Apify.

For platform questions (runs, billing, API, schedules), see [Apify documentation](https://docs.apify.com) and Apify support.

# Actor input Schema

## `runMode` (type: `string`):

**Process** downloads videos and bills only for successful deliveries. **Estimate** analyzes videos and returns projected charges without downloading or billing. Estimated costs are calculated from metadata (size, retention, options) and the actual run may differ slightly.

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

One link per row. You can mix regular videos and Shorts in the same run.

## `videoQuality` (type: `string`):

Maximum resolution to download (priority). Choose **Best available** for the highest resolution offered. For a specific resolution, that height is preferred; if unavailable, the next best lower resolution is used.

## `videoBitrate` (type: `string`):

Within the selected resolution, choose stream size and quality.

- **Best quality** — highest bitrate available at that resolution
- **Balanced** — good quality with a more efficient file size
- **Smallest file** — smallest file at that resolution (lowest cost)

Resolution is always applied first. If your selected resolution is unavailable, the next best lower resolution is used.

## `videoCountry` (type: `string`):

Country used to access the video. Choose the country where the video is available if it is blocked in some regions.

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

File format for the downloaded video. Each file includes both video and audio.

- **MP4** — works on most phones, browsers, and editors
- **WebM** — common for web playback, often smaller files
- **MKV** — flexible format, good for archiving
- **MOV** — suited for Apple devices and video editing
- **AVI** — older format for legacy software
- **FLV** — older streaming format, rarely needed today

## `storageRetention` (type: `string`):

How long your video download links stay active, from **1 day** to **6 months**.

## `includeDetailedInfo` (type: `boolean`):

Adds extra watch-page details when available, such as **chapters**, **tags**, **keywords**, **category**, **caption availability**, and **other metadata rows**. Best suited for regular videos; Shorts may return fewer fields.

## `includeTranscript` (type: `boolean`):

Download captions or transcripts alongside the video. Transcript files are saved with your run; video files are delivered via download links in the dataset.

## `transcriptLanguage` (type: `string`):

Preferred transcript language. If unavailable, the video's original language is tried first, then English, then any available language.

## `transcriptFormat` (type: `string`):

Format for the saved transcript file.

- **JSON** — structured with timestamps
- **TXT** — plain text
- **SRT** — subtitles with timestamps
- **VTT** — web subtitles with timestamps

## Actor input object example

```json
{
  "runMode": "process",
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/jCE1Ol3PYDs"
  ],
  "videoQuality": "480p",
  "videoBitrate": "balanced",
  "videoCountry": "US",
  "outputFormat": "mp4",
  "storageRetention": "1w",
  "includeDetailedInfo": false,
  "includeTranscript": false,
  "transcriptLanguage": "auto",
  "transcriptFormat": "json"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Results for each link: status, video details, file download link (when successful), and optional transcript reference. Estimate mode also includes projected pricing.

## `keyValueStore` (type: `string`):

Transcript files saved during the run when Include transcript is enabled.

# 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://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/shorts/jCE1Ol3PYDs"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("calm_builder/youtube-video-shorts-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://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/shorts/jCE1Ol3PYDs",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("calm_builder/youtube-video-shorts-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://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/jCE1Ol3PYDs"
  ]
}' |
apify call calm_builder/youtube-video-shorts-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=calm_builder/youtube-video-shorts-downloader",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Video & Shorts Downloader",
        "description": "Download YouTube videos and Shorts in MP4, WebM, MKV and more. Choose quality up to 4K, secure hosted download links with retention, structured JSON metadata, optional tags, chapters and transcripts. Preview costs in Estimate mode.",
        "version": "0.0",
        "x-build-id": "wWlKY1v9W1d97KFZ6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/calm_builder~youtube-video-shorts-downloader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-calm_builder-youtube-video-shorts-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/calm_builder~youtube-video-shorts-downloader/runs": {
            "post": {
                "operationId": "runs-sync-calm_builder-youtube-video-shorts-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/calm_builder~youtube-video-shorts-downloader/run-sync": {
            "post": {
                "operationId": "run-sync-calm_builder-youtube-video-shorts-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",
                "required": [
                    "videoUrls"
                ],
                "properties": {
                    "runMode": {
                        "title": "Run mode",
                        "enum": [
                            "process",
                            "estimate"
                        ],
                        "type": "string",
                        "description": "**Process** downloads videos and bills only for successful deliveries. **Estimate** analyzes videos and returns projected charges without downloading or billing. Estimated costs are calculated from metadata (size, retention, options) and the actual run may differ slightly.",
                        "default": "process"
                    },
                    "videoUrls": {
                        "title": "YouTube links",
                        "type": "array",
                        "description": "One link per row. You can mix regular videos and Shorts in the same run.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "videoQuality": {
                        "title": "Video quality",
                        "enum": [
                            "best",
                            "2160p",
                            "1440p",
                            "1080p",
                            "720p",
                            "480p",
                            "360p",
                            "240p",
                            "144p"
                        ],
                        "type": "string",
                        "description": "Maximum resolution to download (priority). Choose **Best available** for the highest resolution offered. For a specific resolution, that height is preferred; if unavailable, the next best lower resolution is used.",
                        "default": "480p"
                    },
                    "videoBitrate": {
                        "title": "Video bitrate",
                        "enum": [
                            "best",
                            "balanced",
                            "smallest"
                        ],
                        "type": "string",
                        "description": "Within the selected resolution, choose stream size and quality.\n\n- **Best quality** — highest bitrate available at that resolution\n- **Balanced** — good quality with a more efficient file size\n- **Smallest file** — smallest file at that resolution (lowest cost)\n\nResolution is always applied first. If your selected resolution is unavailable, the next best lower resolution is used.",
                        "default": "balanced"
                    },
                    "videoCountry": {
                        "title": "Video country",
                        "enum": [
                            "AF",
                            "AL",
                            "DZ",
                            "AS",
                            "AD",
                            "AO",
                            "AI",
                            "AG",
                            "AR",
                            "AM",
                            "AW",
                            "AU",
                            "AT",
                            "AZ",
                            "BS",
                            "BH",
                            "BD",
                            "BB",
                            "BY",
                            "BE",
                            "BZ",
                            "BJ",
                            "BM",
                            "BT",
                            "BO",
                            "BQ",
                            "BA",
                            "BW",
                            "BR",
                            "BN",
                            "BG",
                            "BF",
                            "BI",
                            "KH",
                            "CM",
                            "CA",
                            "CV",
                            "KY",
                            "CF",
                            "TD",
                            "CL",
                            "CN",
                            "CO",
                            "KM",
                            "CG",
                            "CR",
                            "HR",
                            "CU",
                            "CW",
                            "CY",
                            "CZ",
                            "CD",
                            "DK",
                            "DJ",
                            "DM",
                            "DO",
                            "EC",
                            "EG",
                            "SV",
                            "GQ",
                            "ER",
                            "EE",
                            "ET",
                            "FK",
                            "FJ",
                            "FI",
                            "FR",
                            "GF",
                            "PF",
                            "GA",
                            "GM",
                            "GE",
                            "DE",
                            "GH",
                            "GI",
                            "GR",
                            "GL",
                            "GD",
                            "GP",
                            "GU",
                            "GT",
                            "GG",
                            "GN",
                            "GW",
                            "GY",
                            "HT",
                            "HN",
                            "HK",
                            "HU",
                            "IS",
                            "IN",
                            "ID",
                            "IR",
                            "IQ",
                            "IE",
                            "IM",
                            "IL",
                            "IT",
                            "CI",
                            "JM",
                            "JP",
                            "JE",
                            "JO",
                            "KZ",
                            "KE",
                            "XK",
                            "KW",
                            "KG",
                            "LA",
                            "LV",
                            "LB",
                            "LS",
                            "LR",
                            "LY",
                            "LI",
                            "LT",
                            "LU",
                            "MO",
                            "MK",
                            "MG",
                            "MW",
                            "MY",
                            "MV",
                            "ML",
                            "MT",
                            "MQ",
                            "MR",
                            "MU",
                            "YT",
                            "MX",
                            "MD",
                            "MC",
                            "MN",
                            "ME",
                            "MS",
                            "MA",
                            "MZ",
                            "MM",
                            "NA",
                            "NP",
                            "NL",
                            "NC",
                            "NZ",
                            "NI",
                            "NE",
                            "NG",
                            "MP",
                            "NO",
                            "OM",
                            "PK",
                            "PS",
                            "PA",
                            "PG",
                            "PY",
                            "PE",
                            "PH",
                            "PL",
                            "PT",
                            "PR",
                            "QA",
                            "RO",
                            "RU",
                            "RW",
                            "RE",
                            "SH",
                            "KN",
                            "LC",
                            "MF",
                            "VC",
                            "WS",
                            "SM",
                            "ST",
                            "SA",
                            "SN",
                            "RS",
                            "SC",
                            "SL",
                            "SG",
                            "SX",
                            "SK",
                            "SI",
                            "SO",
                            "ZA",
                            "KR",
                            "SS",
                            "ES",
                            "LK",
                            "SD",
                            "SR",
                            "SZ",
                            "SE",
                            "CH",
                            "SY",
                            "TW",
                            "TJ",
                            "TZ",
                            "TH",
                            "TL",
                            "TG",
                            "TO",
                            "TT",
                            "TN",
                            "TR",
                            "TM",
                            "TC",
                            "UG",
                            "UA",
                            "AE",
                            "GB",
                            "US",
                            "UY",
                            "UZ",
                            "VU",
                            "VE",
                            "VN",
                            "VG",
                            "VI",
                            "WF",
                            "YE",
                            "ZM",
                            "ZW"
                        ],
                        "type": "string",
                        "description": "Country used to access the video. Choose the country where the video is available if it is blocked in some regions.",
                        "default": "US"
                    },
                    "outputFormat": {
                        "title": "Output format",
                        "enum": [
                            "mp4",
                            "webm",
                            "mkv",
                            "mov",
                            "avi",
                            "flv"
                        ],
                        "type": "string",
                        "description": "File format for the downloaded video. Each file includes both video and audio.\n\n- **MP4** — works on most phones, browsers, and editors\n- **WebM** — common for web playback, often smaller files\n- **MKV** — flexible format, good for archiving\n- **MOV** — suited for Apple devices and video editing\n- **AVI** — older format for legacy software\n- **FLV** — older streaming format, rarely needed today",
                        "default": "mp4"
                    },
                    "storageRetention": {
                        "title": "File storage duration",
                        "enum": [
                            "1d",
                            "3d",
                            "1w",
                            "2w",
                            "1m",
                            "3m",
                            "6m"
                        ],
                        "type": "string",
                        "description": "How long your video download links stay active, from **1 day** to **6 months**.",
                        "default": "1w"
                    },
                    "includeDetailedInfo": {
                        "title": "Include detailed video information",
                        "type": "boolean",
                        "description": "Adds extra watch-page details when available, such as **chapters**, **tags**, **keywords**, **category**, **caption availability**, and **other metadata rows**. Best suited for regular videos; Shorts may return fewer fields.",
                        "default": false
                    },
                    "includeTranscript": {
                        "title": "Include transcript",
                        "type": "boolean",
                        "description": "Download captions or transcripts alongside the video. Transcript files are saved with your run; video files are delivered via download links in the dataset.",
                        "default": false
                    },
                    "transcriptLanguage": {
                        "title": "Transcript language",
                        "enum": [
                            "auto",
                            "ar",
                            "bn",
                            "de",
                            "en",
                            "es",
                            "fa",
                            "fr",
                            "hi",
                            "id",
                            "it",
                            "ja",
                            "ko",
                            "nl",
                            "pl",
                            "pt",
                            "ru",
                            "th",
                            "tr",
                            "uk",
                            "ur",
                            "vi",
                            "zh-Hans",
                            "zh-Hant"
                        ],
                        "type": "string",
                        "description": "Preferred transcript language. If unavailable, the video's original language is tried first, then English, then any available language.",
                        "default": "auto"
                    },
                    "transcriptFormat": {
                        "title": "Transcript format",
                        "enum": [
                            "json",
                            "txt",
                            "srt",
                            "vtt"
                        ],
                        "type": "string",
                        "description": "Format for the saved transcript file.\n\n- **JSON** — structured with timestamps\n- **TXT** — plain text\n- **SRT** — subtitles with timestamps\n- **VTT** — web subtitles with timestamps",
                        "default": "json"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
