# All-in-One Video & Audio (YouTube, TikTok, Instagram, X etc.) (`qbitlabs/all-in-one-video-downloader-youtube-tiktok-instagram-x-etc`) Actor

A universal media downloader. Download video or audio from 1000+ websites including YouTube, TikTok, Instagram, X (Twitter), Facebook, Vimeo, SoundCloud, Twitch and Reddit in your chosen quality (4K, 1080p, 720p, 480p, 360p) or as an MP3 audio file.

- **URL**: https://apify.com/qbitlabs/all-in-one-video-downloader-youtube-tiktok-instagram-x-etc.md
- **Developed by:** [qbitlabs](https://apify.com/qbitlabs) (community)
- **Categories:** Videos, Social media, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

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

## Universal Media Downloader

Download **video or audio from 1000+ sites** — including YouTube, TikTok, Instagram, X (Twitter), Facebook, Vimeo, SoundCloud, Twitch and Reddit — in your chosen quality, or as an MP3 audio file.

Just paste a URL, pick your quality, and get a **direct download link**.

### Features

- ✅ **1000+ supported sites** — one Actor for everything
- ✅ **Video (MP4)** or **audio-only (MP3)** extraction
- ✅ Choose quality: **4K / 1080p / 720p / 480p / 360p** (with automatic fallback to the nearest available)
- ✅ **Direct download link** for every result
- ✅ Optional proxy & cookies for private or region-locked media
- ✅ **Pay only for successful downloads** — failures are free

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | ✅ | The media URL to download. |
| `quality` | enum | — | `best`, `1080p`, `720p`, `480p`, `360p`, `worst`. Ignored when `audioOnly` is on. Falls back to the nearest available quality. |
| `audioOnly` | boolean | — | If `true`, extracts the audio track and converts it to MP3. |
| `platform` | enum | — | Optional source hint (`auto`, `youtube`, `tiktok`, …). The site is auto-detected from the URL, so this is just for labeling. |
| `proxy` | proxy | — | Off by default. Enable only if a site blocks the direct request (e.g. 403 / captcha). |
| `cookies` | string | — | Optional cookies in Netscape `cookies.txt` format, for private / age-restricted / login-required media. |
| `maxFileSizeMB` | integer | — | Skip downloads larger than this (default `2048`). Set `0` to disable the limit. |

#### Example input

```json
{
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "quality": "720p",
    "audioOnly": false
}
````

### Output

Each run produces one dataset record with a ready-to-use **`downloadUrl`**:

```json
{
    "title": "Never Gonna Give You Up",
    "platform": "Youtube",
    "quality": "720p",
    "audioOnly": false,
    "ext": "mp4",
    "fileSizeMB": 12.34,
    "duration": 213,
    "uploader": "Rick Astley",
    "downloadUrl": "https://.../sample.mp4",
    "sourceUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "success": true
}
```

Click `downloadUrl` to download the file directly.

### Pricing (Pay-Per-Event)

You are charged **only on a successful download**. Failed, private, geo-blocked, DRM-protected, or too-large requests cost **nothing**.

| Event | Charged when | Price |
|-------|--------------|-------|
| Audio download | Audio-only MP3 succeeds | **$0.005** |
| SD video | Video ≤ 480p succeeds | **$0.03** |
| HD video | Video 720p–1080p succeeds | **$0.05** |
| 4K / 2K video | Video above 1080p succeeds | **$0.10** |
| Large file surcharge | Per whole GB of file size, **first GB free** | **+$0.03 / GB** |

One main tier (audio / SD / HD / 4K) per run, plus the per-GB surcharge for files over 1 GB (first GB free, rounded down — e.g. a 2 GB file adds 1×, a 3 GB file adds 2×).

**Examples:** a 3-minute MP3 = **$0.005**; a 720p video = **$0.05**; a 2 GB 4K video = $0.10 + $0.03 = **$0.13**; a 3 GB 4K video = $0.10 + $0.06 = **$0.16**.

### Notes

- Private, deleted, geo-blocked or DRM-protected media cannot be downloaded — these fail with a clear, categorized error (`errorType`) and are **not charged**.
- Downloads a **single** item per run; playlist URLs resolve to their first video.
- **Bot-checks:** if a site returns a 403 / captcha, enable a **proxy** and/or supply **cookies**.

# Actor input Schema

## `url` (type: `string`):

The full URL of the video or audio you want to download (e.g. a YouTube, TikTok, Instagram, X or Facebook link).

## `platform` (type: `string`):

Optional. The source platform. yt-dlp auto-detects the site from the URL, so this is only used for labeling/validation.

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

Desired video quality. Ignored when 'Audio only' is enabled. Falls back to the nearest available quality.

## `audioOnly` (type: `boolean`):

If enabled, extracts the audio track and converts it to MP3 instead of downloading the video.

## `proxy` (type: `object`):

Optional. By default the download goes out as a normal direct request (no proxy). Enable a proxy only if a site blocks the direct request (e.g. 403 / captcha). Datacenter is cheap; switch to Residential only if Datacenter is also blocked.

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

Optional. Paste cookies in Netscape/Mozilla cookies.txt format to download private, age-restricted or login-required media. Export with a browser extension like 'Get cookies.txt'.

## `maxFileSizeMB` (type: `integer`):

Abort if the media is larger than this, to avoid huge downloads and storage costs. Set 0 to disable the limit.

## Actor input object example

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "platform": "auto",
  "quality": "best",
  "audioOnly": false,
  "proxy": {
    "useApifyProxy": false
  },
  "maxFileSizeMB": 2048
}
```

# Actor output Schema

## `downloads` (type: `string`):

The downloaded media: metadata and a direct download link for each run.

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

// Run the Actor and wait for it to finish
const run = await client.actor("qbitlabs/all-in-one-video-downloader-youtube-tiktok-instagram-x-etc").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 = { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }

# Run the Actor and wait for it to finish
run = client.actor("qbitlabs/all-in-one-video-downloader-youtube-tiktok-instagram-x-etc").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 '{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}' |
apify call qbitlabs/all-in-one-video-downloader-youtube-tiktok-instagram-x-etc --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=qbitlabs/all-in-one-video-downloader-youtube-tiktok-instagram-x-etc",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "All-in-One Video & Audio (YouTube, TikTok, Instagram, X etc.)",
        "description": "A universal media downloader. Download video or audio from 1000+ websites including YouTube, TikTok, Instagram, X (Twitter), Facebook, Vimeo, SoundCloud, Twitch and Reddit in your chosen quality (4K, 1080p, 720p, 480p, 360p) or as an MP3 audio file.",
        "version": "0.0",
        "x-build-id": "emK9r0ehbejnEGwFX"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/qbitlabs~all-in-one-video-downloader-youtube-tiktok-instagram-x-etc/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-qbitlabs-all-in-one-video-downloader-youtube-tiktok-instagram-x-etc",
                "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/qbitlabs~all-in-one-video-downloader-youtube-tiktok-instagram-x-etc/runs": {
            "post": {
                "operationId": "runs-sync-qbitlabs-all-in-one-video-downloader-youtube-tiktok-instagram-x-etc",
                "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/qbitlabs~all-in-one-video-downloader-youtube-tiktok-instagram-x-etc/run-sync": {
            "post": {
                "operationId": "run-sync-qbitlabs-all-in-one-video-downloader-youtube-tiktok-instagram-x-etc",
                "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": [
                    "url"
                ],
                "properties": {
                    "url": {
                        "title": "Media URL",
                        "type": "string",
                        "description": "The full URL of the video or audio you want to download (e.g. a YouTube, TikTok, Instagram, X or Facebook link)."
                    },
                    "platform": {
                        "title": "Platform (optional hint)",
                        "enum": [
                            "auto",
                            "youtube",
                            "tiktok",
                            "instagram",
                            "twitter",
                            "facebook",
                            "vimeo",
                            "soundcloud",
                            "twitch",
                            "reddit",
                            "other"
                        ],
                        "type": "string",
                        "description": "Optional. The source platform. yt-dlp auto-detects the site from the URL, so this is only used for labeling/validation.",
                        "default": "auto"
                    },
                    "quality": {
                        "title": "Quality",
                        "enum": [
                            "best",
                            "1080p",
                            "720p",
                            "480p",
                            "360p",
                            "worst"
                        ],
                        "type": "string",
                        "description": "Desired video quality. Ignored when 'Audio only' is enabled. Falls back to the nearest available quality.",
                        "default": "best"
                    },
                    "audioOnly": {
                        "title": "Audio only",
                        "type": "boolean",
                        "description": "If enabled, extracts the audio track and converts it to MP3 instead of downloading the video.",
                        "default": false
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional. By default the download goes out as a normal direct request (no proxy). Enable a proxy only if a site blocks the direct request (e.g. 403 / captcha). Datacenter is cheap; switch to Residential only if Datacenter is also blocked.",
                        "default": {
                            "useApifyProxy": false
                        }
                    },
                    "cookies": {
                        "title": "Cookies (Netscape format)",
                        "type": "string",
                        "description": "Optional. Paste cookies in Netscape/Mozilla cookies.txt format to download private, age-restricted or login-required media. Export with a browser extension like 'Get cookies.txt'."
                    },
                    "maxFileSizeMB": {
                        "title": "Max file size (MB)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Abort if the media is larger than this, to avoid huge downloads and storage costs. Set 0 to disable the limit.",
                        "default": 2048
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
