# Titan YouTube Audio Downloader (MP3) (`titan_network/titan-youtube-audio`) Actor

Powered by Titan Network (Apify Gateway). Download YouTube audio tracks as MP3, each with attached .info.json metadata. Fast, reliable, and storage-ready.

- **URL**: https://apify.com/titan\_network/titan-youtube-audio.md
- **Developed by:** [Titan Network](https://apify.com/titan_network) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.04 / 1,000 audio download successes

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?

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

## Titan YouTube Audio Downloader (MP3)

Download **audio only** from YouTube videos as **MP3** (current Gateway supports MP3 only — no M4A/FLAC).

> Powered by [Titan Network](https://apify.com/Titan_Network) via the **Titan Apify Gateway** · Not affiliated with YouTube or Google.

***

### 🌟 Key Features

- This Actor is the **Gateway version** of the old `youtube-audio` actor: it is fixed to `outputType=media` + `format=mp3` (quality always 720) and delivers `<video_id>.mp3` (kind=audio) plus the attached `<video_id>.info.json` (kind=metadata) in `downloadFiles`.
- **Shorts & Standard Videos**: Fully supports standard YouTube videos, YouTube Shorts, and `youtu.be` short links.
- **Zero Memory Overhead (Ultra-Lightweight)**: Runs smoothly on Apify's minimal **128MB RAM** tier.
- **Direct High-Speed Delivery**: Pre-signed download links (retained ~24h) — no slow double-transfers.
- **Custom Cloud Storage Integration**: Pipe outputs into your Amazon S3, Google Cloud Storage, or DigitalOcean Spaces bucket. Azure is not supported.
- **Real-time Progress**: Live status via Apify Console (fetching metadata / downloading / processing / uploading).
- **Bounded Concurrency + Configurable Timeout**: Default 20 concurrent worker units (1-50) and a configurable per-task timeout.

***

### 📋 Input Configuration

| Parameter | Type | Required | Default | Description |
| :--- | :--- | :--- | :--- | :--- |
| `startUrls` | Array of strings | **Yes** | - | YouTube URLs or plain 11-char video IDs. Duplicates are processed once. |
| `storageType` | String | No | `"apify"` | `apify` (Titan platform storage / pre-signed links), `aws`, `gcp`, `digitalocean`. Azure is not supported. |
| `s3Bucket` | String | External | - | Bucket/container name for `aws`/`gcp`/`digitalocean`. |
| `s3Region` | String | No | - | Storage region (`us-east-1`, `auto`, `nyc3`). Required for DigitalOcean. |
| `s3AccessKeyId` | String | External | - | Access key ID for external storage. |
| `s3SecretAccessKey` | String | External | - | Secret access key for external storage. |
| `maxWaitSec` | Integer | No | mode default | Per-task SSE timeout in seconds. |
| `maxConcurrency` | Integer | No | `20` | Bounded concurrency (1-50) for submit + SSE worker units. |

#### Example Input JSON

```json
{
  "startUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "9bZkp7q19f0"],
  "maxConcurrency": 5
}
```

***

### 💰 Pricing & Monetization (Pay-Per-Event)

- Billing event: **`audio-download-success`** — charged only when the Gateway returns `completed`, the requested output files exist, and the Dataset row was written successfully.
- Zero cost on failures, timeouts, cancellations, or missing output files.

***

### ⚖️ Legal & Fair Use Disclaimer

This Actor is designed solely for archiving, offline viewing of authorized content, or educational and fair-use research. Please respect the copyright of creators and YouTube's Terms of Service.

# Actor input Schema

## `startUrls` (type: `array`):

List of YouTube video URLs (watch links, Shorts, youtu.be) or plain 11-character video IDs. One item per line. Duplicate video IDs are processed once. This Actor downloads MP3 audio (with attached .info.json metadata).

## `storageType` (type: `string`):

Destination where downloaded files will be stored: apify (Titan platform storage, pre-signed links valid ~24h; files are NOT copied to the Apify Key-Value Store), aws (Amazon S3), gcp (Google Cloud Storage), digitalocean (DigitalOcean Spaces). Azure is not supported.

## `s3Bucket` (type: `string`):

Bucket or container name if using custom cloud storage (required for aws/gcp/digitalocean).

## `s3Region` (type: `string`):

Region of your storage bucket (e.g. us-east-1, auto, nyc3). Required for DigitalOcean Spaces.

## `s3AccessKeyId` (type: `string`):

Access Key ID for your cloud storage provider (required for aws/gcp/digitalocean).

## `s3SecretAccessKey` (type: `string`):

Secret Access Key for your cloud storage provider (required for aws/gcp/digitalocean).

## `maxWaitSec` (type: `integer`):

Maximum seconds to wait for each task's SSE completion before cancelling it. Default 7200 (2 hours).

## `maxConcurrency` (type: `integer`):

Maximum number of concurrent submit + SSE worker units (1-50). Default 20.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "storageType": "apify",
  "maxWaitSec": 7200,
  "maxConcurrency": 20
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of audio results — one item per requested video.

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

// Run the Actor and wait for it to finish
const run = await client.actor("titan_network/titan-youtube-audio").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 = { "startUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("titan_network/titan-youtube-audio").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 '{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call titan_network/titan-youtube-audio --silent --output-dataset

```

## MCP server setup

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

```

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/TcFaies0NbdkVQatU/builds/vbA62WyY1Q4dhEhtO/openapi.json
