# YouTube Video & Audio Downloader (MP4, Shorts, M4A/MP3) (`academic_nipa/my-actor`) Actor

Ultra-fast YouTube video & audio downloader. Download videos in 1080p, 720p, 480p, 360p MP4 (with sound) or extract M4A/MP3 audio. Built-in residential bypass, zero proxy fees, and direct cloud links!

- **URL**: https://apify.com/academic_nipa/my-actor.md
- **Developed by:** [forever accessories](https://apify.com/academic_nipa) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 megabyte downloadeds

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/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

## High-Speed YouTube Video & Audio Downloader (MP4 / M4A)

Download any YouTube video or Shorts directly to a fast, clickable cloud **MP4 video (with audio)** or **M4A/MP3 audio** link in seconds.

#### 🌟 Key Features

- **No Proxy Setup Needed:** Built-in anti-bot bypass is included automatically. You do not need to buy expensive $8/GB residential proxies!
- **All Popular Qualities Supported:** Download videos in **1080p Full HD**, **720p HD**, **480p**, and **360p** (Fast MP4 + Audio).
- **Audio Only Extraction:** Choose the `Audio Only` option from the dropdown to extract high-quality M4A/MP3 streams.
- **Smart Quality Fallback:** If a requested resolution is unavailable on YouTube (e.g. you ask for 1080p but the video is only 480p), the Actor automatically selects the next best available quality so your workflow never fails.
- **Direct Cloud Download Link:** Generates an instant, non-IP-locked cloud download URL (`https://api.apify.com/.../video.mp4`) ready for browsers, websites, apps, Zapier, Make, and n8n.
- **Auto-Cleanup Storage:** Downloaded files are automatically purged from cloud storage after 10 minutes to ensure your storage usage stays at $0.00.
- **Fair Pay-Per-MB Pricing:** Platform usage is **100% Included (Free)**. You are only charged for the exact Megabytes successfully downloaded. Failed runs are never charged.

#### ⚙️ How It Works (For Developers & Non-Coders)

1. **Input:** Provide a valid YouTube URL (Standard watch link, `youtu.be`, or `/shorts/`).
2. **Select Format:** Use the dropdown to select your desired MP4 Video resolution or Audio Only.
3. **Run:** The Actor instantly retrieves the media, bypassing YouTube's bot checks.
4. **Output:** The output table gives you a direct link to the playable media file hosted on Apify Cloud Storage. Click the link to play or download!

# Actor input Schema

## `youtube_url` (type: `string`):

Paste any YouTube video or Shorts URL to download as a playable MP4 video or M4A audio file.

## `preferred_quality` (type: `string`):

Select video resolution (with audio) or Audio Only. Automatically falls back to the nearest available quality if the selected resolution is unavailable.

## Actor input object example

```json
{
  "youtube_url": "https://www.youtube.com/watch?v=Ec9FSxwPea0",
  "preferred_quality": "360p"
}
```

# Actor output Schema

## `video_download_url` (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 = {
    "youtube_url": "https://www.youtube.com/watch?v=Ec9FSxwPea0"
};

// Run the Actor and wait for it to finish
const run = await client.actor("academic_nipa/my-actor").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 = { "youtube_url": "https://www.youtube.com/watch?v=Ec9FSxwPea0" }

# Run the Actor and wait for it to finish
run = client.actor("academic_nipa/my-actor").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 '{
  "youtube_url": "https://www.youtube.com/watch?v=Ec9FSxwPea0"
}' |
apify call academic_nipa/my-actor --silent --output-dataset

```

## MCP server setup

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

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/UNHdtb2rMkflmin5G/builds/tExbNSM4wXfw0Q88K/openapi.json
