# Universal Media Extractor (`abotapi/universal-media-extractor`) Actor

Extract videos, audio, and metadata from 1000+ websites including YouTube, TikTok, Twitter/X, Instagram, Vimeo, Facebook, Twitch, and many more. Stream directly to your cloud storage or get direct download URLs for your pipelines.

- **URL**: https://apify.com/abotapi/universal-media-extractor.md
- **Developed by:** [Abot API](https://apify.com/abotapi) (community)
- **Categories:** Social media, Developer tools, Videos
- **Stats:** 38 total users, 4 monthly users, 79.1% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.00 / 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.
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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Extractor

Extract videos, audio, and metadata from **1000+ websites** including YouTube, TikTok, Twitter/X, Instagram, Vimeo, Facebook, Twitch, and many more. Stream directly to your cloud storage or get direct download URLs for your pipelines.

### Features

- **1000+ Supported Sites** - YouTube, TikTok, Twitter/X, Instagram, Vimeo, Dailymotion, Twitch, SoundCloud, Facebook, and many more
- **Three Flexible Modes** - Extract metadata only, download to storage, or stream directly to cloud
- **Cloud Storage Integration** - Upload directly to AWS S3 or Google Cloud Storage
- **Format Selection** - Choose video quality, audio-only, or specific formats
- **Playlist Support** - Process entire playlists with filtering options
- **Direct URLs** - Get direct download links for integration with other tools
- **Proxy Support** - Built-in proxy configuration for geo-restricted content

### Use Cases

| Scenario | Mode | What You Get |
|----------|------|--------------|
| **Content Archiving** | `download` | Save videos to S3/GCS for backup or compliance |
| **Social Media Monitoring** | `extract` | Track video metrics, availability, and engagement |
| **Media Processing Pipeline** | `stream` | Feed videos directly to transcription/ML workflows |
| **Research & Analytics** | `extract` | Gather video metadata at scale for analysis |
| **Content Aggregation** | `extract` | Get direct URLs for embedding or redistribution |

### Input

| Field | Type | Description |
|-------|------|-------------|
| `url` | string | **(Required)** Video or playlist URL |
| `mode` | string | `extract` (default), `download`, or `stream` |
| `format` | string | Format selection: `best`, `bestaudio`, `720p`, etc. |
| `storage_type` | string | `apify` (default), `s3`, or `gcs` |
| `storage_config` | object | Cloud credentials (see examples below) |
| `proxy` | string | Proxy URL for geo-restricted content |

#### Format Examples

| Format String | Result |
|---------------|--------|
| `best` | Best available quality |
| `bestaudio` | Best audio only (for podcasts, music) |
| `bestvideo+bestaudio` | Best video + audio merged |
| `best[height<=720]` | Best quality up to 720p |
| `best[height<=1080]` | Best quality up to 1080p |

### Output

#### Extract Mode

Returns full metadata including available formats with direct URLs:

```json
{
  "id": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up",
  "duration": 212,
  "view_count": 1500000000,
  "uploader": "Rick Astley",
  "thumbnail": "https://i.ytimg.com/vi/...",
  "formats": [
    {
      "format_id": "22",
      "ext": "mp4",
      "resolution": "1280x720",
      "url": "https://..."
    }
  ]
}
```

#### Download/Stream Mode

Returns storage location and video info:

```json
{
  "storage_url": "https://my-bucket.s3.amazonaws.com/videos/video.mp4",
  "filename": "dQw4w9WgXcQ.mp4",
  "storage_type": "s3",
  "info": { "title": "...", "duration": 212 }
}
```

### Examples

#### Extract Video Metadata

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "mode": "extract"
}
```

#### Download to AWS S3

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "mode": "download",
  "format": "best[height<=1080]",
  "storage_type": "s3",
  "storage_config": {
    "bucket": "my-media-bucket",
    "prefix": "videos/",
    "region": "us-east-1",
    "aws_access_key": "AKIA...",
    "aws_secret_key": "..."
  }
}
```

#### Download Audio Only to GCS

```json
{
  "url": "https://soundcloud.com/artist/track",
  "mode": "download",
  "format": "bestaudio[ext=m4a]",
  "storage_type": "gcs",
  "storage_config": {
    "bucket": "my-audio-bucket",
    "credentials_json": "{...service account JSON...}"
  }
}
```

#### Process TikTok with Proxy

```json
{
  "url": "https://www.tiktok.com/@user/video/1234567890",
  "mode": "extract",
  "proxy": "http://user:pass@proxy.example.com:8080"
}
```

### Supported Platforms

YouTube, TikTok, Twitter/X, Instagram, Facebook, Vimeo, Dailymotion, Twitch, SoundCloud, Bandcamp, Reddit, LinkedIn, Pinterest, Tumblr, VK, Bilibili, Niconico, and 1000+ more.

### Limitations

- **DRM Content** - Cannot download DRM-protected videos
- **Live Streams** - Limited support for ongoing live streams
- **Rate Limits** - Some platforms may rate-limit requests
- **Authentication** - Private content requires cookies or credentials

# Actor input Schema

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

URL of the video or playlist to process

## `mode` (type: `string`):

Processing mode: extract (metadata only), download (to storage), stream (direct to cloud)

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

Video/audio format selection. Examples: best, bestaudio, bestvideo+bestaudio, best\[height<=720]

## `storage_type` (type: `string`):

Where to store downloaded files (for download/stream modes)

## `storage_config` (type: `object`):

Cloud storage credentials. For S3: {bucket, region, aws\_access\_key, aws\_secret\_key, prefix, acl}. For GCS: {bucket, credentials\_json, prefix, make\_public}

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

HTTP/HTTPS proxy URL. If not set, uses Apify proxy if available.

## `extract_flat` (type: `boolean`):

For playlists, only extract video URLs without downloading individual video info

## `playlist_items` (type: `string`):

Specific playlist items to process (e.g., '1,3,5-7')

## `write_subtitles` (type: `boolean`):

Download subtitles

## `subtitle_langs` (type: `array`):

List of subtitle languages to download (e.g., en, es)

## `geo_bypass` (type: `boolean`):

Attempt to bypass geo-restrictions

## `ignore_errors` (type: `boolean`):

Continue on download errors (useful for playlists)

## `username` (type: `string`):

Account username for authenticated content

## `password` (type: `string`):

Account password for authenticated content

## Actor input object example

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "mode": "extract",
  "format": "best",
  "storage_type": "apify",
  "extract_flat": false,
  "write_subtitles": false,
  "geo_bypass": true,
  "ignore_errors": false
}
```

# 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",
    "format": "best"
};

// Run the Actor and wait for it to finish
const run = await client.actor("abotapi/universal-media-extractor").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",
    "format": "best",
}

# Run the Actor and wait for it to finish
run = client.actor("abotapi/universal-media-extractor").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",
  "format": "best"
}' |
apify call abotapi/universal-media-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=abotapi/universal-media-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/JiQc435LE9XICJYKZ/builds/yjHnAjW0RTrpLOmNy/openapi.json
