# Universal Media Downloader — video & audio from 1800+ sites (`synthetic.ia/media-downloader`) Actor

Download video or audio (MP4/MP3/…) from a URL of any of 1800+ sites (YouTube, X, TikTok, Instagram, Vimeo, SoundCloud, Reddit, Twitch…) via yt-dlp. Pick format/quality, extract audio, or just read metadata. HTTP API + MCP. Optional residential proxy for sites that block servers.

- **URL**: https://apify.com/synthetic.ia/media-downloader.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $30.00 / 1,000 media downloads

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Universal Media Downloader — video & audio from 1800+ sites

Download **video or audio from almost any URL** over a simple HTTP API. Powered by **yt-dlp + ffmpeg**, it supports **1800+ sites** — YouTube, X/Twitter, TikTok, Instagram, Vimeo, SoundCloud, Reddit, Twitch, Facebook, and many more — plus direct `.mp4`/`.mp3` links. Choose the format and quality, extract just the audio, or read a URL's metadata without downloading. No binaries to install, no server to run.

- ⬇️ **Any site** → MP4 / WebM / MKV, or **audio only** → MP3 / M4A / WAV / Opus / …
- 🎚️ **Pick quality** (480p → 4K) and a **max file size**
- 🔎 **Info mode**: title, duration, thumbnail and available formats — no download, cheaper
- 🌐 **Optional residential proxy** for sites that block datacenter IPs (e.g. YouTube)
- ⚡ HTTP API (Standby) + `/async` for big files + usable from AI agents (MCP)
- 💵 Pay per download + per 100 MB (residential proxy billed separately)

### Sample output

```json
{
  "ok": true,
  "url": "https://api.apify.com/v2/key-value-stores/…/records/media_lq3k.mp4",
  "contentType": "video/mp4",
  "sizeMB": 4.8,
  "billed100MB": 1,
  "kind": "video",
  "ext": "mp4",
  "proxied": false
}
```

### How to use

#### HTTP API (Standby — recommended)

Base URL: `https://synthetic-ia--media-downloader.apify.actor` with header `Authorization: Bearer <APIFY_TOKEN>`.

| Endpoint | Body | Does |
|---|---|---|
| `POST /download` | `{ url, format?, audioOnly?, maxHeight?, maxFileSizeMb?, proxy? }` | Download → file URL |
| `POST /info` | `{ url, proxy? }` | Metadata + available formats (no download) |
| `POST /async` | `{ ...params }` → `{ runId }` | Start a big download; then `GET /status/<runId>` |
| `GET /` | — | Endpoint list as JSON |

```bash
## Best-quality MP4 up to 1080p
curl -X POST ".../download" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"url":"https://vimeo.com/…","maxHeight":1080}'

## Audio only → MP3
curl -X POST ".../download" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"url":"https://soundcloud.com/…","audioOnly":true,"format":"mp3"}'

## A site that blocks servers (YouTube) → use the residential proxy
curl -X POST ".../download" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"url":"https://www.youtube.com/watch?v=…","proxy":"residential"}'
```

#### One-shot run

Set `url` (and options) and run once. The file is saved to the run's key-value store as `OUTPUT` and a record with the URL is pushed to the dataset.

### Input

- **url** — the page or file to download from.
- **operation** — `download` or `info` (metadata only).
- **audioOnly** — extract just the audio.
- **format** — video `mp4|webm|mkv`, audio `mp3|m4a|wav|opus|aac|flac|ogg`.
- **maxHeight** — `0` (best), 480, 720, 1080, 2160.
- **maxFileSizeMb** — abort above this (1–1024).
- **proxy** — `none` (direct, default), `datacenter`, or `residential`.

### About the proxy (important for YouTube)

Requests run from Apify's **datacenter IPs**, which some sites — most notably **YouTube** — block. Set `proxy: "residential"` to route the download through **real home IPs** so the site treats you like a normal user. Residential bandwidth is billed per GB, so it's charged separately (see Pricing). For most other sites, leave `proxy` as `none`.

### Pricing

| What | Price (Free tier) |
|---|---|
| Per download | **$0.05** |
| Per 100 MB of output | **$0.10** |
| Residential proxy, per 100 MB | **$2.00** (only when used) |

Prices drop on higher usage tiers. A 5-minute 1080p video (~80 MB) direct ≈ **$0.05 + $0.10 = $0.15**. Info mode is charged as a normal download event only if it downloads; pure metadata is light. Datacenter/no-proxy downloads never pay the residential fee.

### Related Actors

- **[ffmpeg API](https://apify.com/synthetic.ia/ffmpeg-api)** — transcode, compress, trim, GIF, thumbnail the downloaded file.
- **[Live Stream Clipper](https://apify.com/synthetic.ia/live-stream-clipper)** — clip a live stream instead of downloading a full video.
- **[AI Voice Generator & Cloner](https://apify.com/synthetic.ia/ai-voice-generator)** — turn text into speech, or clone a voice.

### Limits

- Output capped at **1024 MB** per download; use `/async` for big files (30-min timeout).
- http(s) URLs only; private/loopback hosts are blocked.

### Legal

**You are responsible for having the right to download the content you request.** Use it for your own media, content you're licensed to use, or content that permits downloading. Do not use it to infringe copyright or violate a site's terms of service.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/media-downloader/changelog.md

# Actor input Schema

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

Page or file URL to download from (YouTube, X, TikTok, Vimeo, a direct .mp4/.mp3, etc.).

## `operation` (type: `string`):

Download the media, or just read its metadata.

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

Extract just the audio track.

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

Video: mp4|webm|mkv. Audio: mp3|m4a|wav|opus|aac|flac|ogg. Default mp4 (or mp3 when audio only).

## `maxHeight` (type: `integer`):

Cap the resolution (e.g. 480, 720, 1080, 2160). 0 = best available.

## `maxFileSizeMb` (type: `integer`):

Abort if the file would be larger than this (1–1024).

## `proxy` (type: `string`):

Use a proxy for sites that block servers. 'residential' is billed extra per 100 MB (needed for YouTube etc.).

## Actor input object example

```json
{
  "url": "https://download.samplelib.com/mp4/sample-5s.mp4",
  "operation": "download",
  "audioOnly": false,
  "format": "mp4",
  "maxHeight": 1080,
  "maxFileSizeMb": 500,
  "proxy": "none"
}
```

# Actor output Schema

## `result` (type: `string`):

The downloaded media file and its URL.

## `runs` (type: `string`):

No description

# 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 = {
    "format": "mp4"
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/media-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 = { "format": "mp4" }

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/media-downloader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "format": "mp4"
}' |
apify call synthetic.ia/media-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthetic.ia/media-downloader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0uMjzrsXX2QoqmbEv/builds/dOg9bXRSu64RW9t1Y/openapi.json
