YouTube to MP3 Downloader avatar

YouTube to MP3 Downloader

Pricing

from $20.00 / 1,000 audio file saveds

Go to Apify Store
YouTube to MP3 Downloader

YouTube to MP3 Downloader

Convert authorized YouTube videos and playlists to MP3 (or m4a, opus, wav, flac) with chosen bitrate, ID3 tags and thumbnail cover art. Saves each track to Apify key-value storage and returns MCP-ready JSON. Built for AI agents and SEO.

Pricing

from $20.00 / 1,000 audio file saveds

Rating

0.0

(0)

Developer

Khadin Akbar

Khadin Akbar

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

4 days ago

Last modified

Share

Convert authorized YouTube videos and playlists into clean, tagged MP3 files — or M4A, Opus, WAV, and FLAC — at the bitrate you choose. Every track is transcoded with yt-dlp + ffmpeg, tagged with ID3 metadata and embedded thumbnail cover art, saved to Apify key-value storage, and returned as MCP-ready JSON for AI agents and automation.

What it does

Give it one or more YouTube URLs (single videos, Shorts, or playlists). For each track it:

  1. Downloads the best available audio stream.
  2. Transcodes to your chosen format and bitrate.
  3. Embeds ID3 tags (title, artist, upload date) and the video thumbnail as cover art.
  4. Saves the file to the key-value store and returns a structured row with a direct download key.

When to use it

  • Build an audio archive of talks, lectures, podcasts, or interviews you have rights to.
  • Turn a playlist you own into a set of tagged MP3s in one run.
  • Feed audio into transcription, diarization, or music-analysis pipelines.
  • Let an AI agent fetch YouTube audio as a structured tool call (MCP-ready).

Do not use it to download content you do not own or have permission to use. See the legal note below.

Output

One dataset row per track, plus the audio file in the key-value store.

FieldDescription
titleVideo / track title
artistUploader / channel (written to the ID3 artist tag)
videoIdYouTube video ID
durationSecondsTrack length
audioFormatmp3, m4a, opus, wav, or flac
bitrateKbpsTarget bitrate for lossy formats (null for VBR / lossless)
fileKeyKey-value store key to download the audio file
fileSizeBytesSaved file size
thumbnailCover-art image URL
uploadDateYYYYMMDD when available
statussuccess, skipped, or failed
errorActionable message when a track could not be produced
scrapedAtISO 8601 timestamp

Audio files are stored under keys like audio-{videoId}-{slug}.mp3. Each row's fileKey points to its file.

Pricing

Pay per result (PPE):

  • Actor start — $0.00005 per run
  • Audio file saved$0.02 per track successfully saved

Failed, skipped, and invalid URLs are not charged the per-track fee. A typical single-track run costs about $0.02. You also pay Apify platform compute + proxy usage.

Input

FieldTypeDefaultNotes
videoUrlsarrayYouTube video / playlist URLs (required)
authorizationConfirmedbooleanfalseMust be true to download
audioFormatenummp3mp3, m4a, opus, wav, flac
audioBitrateenum192best, 320, 256, 192, 128 (lossy only)
embedMetadatabooleantrueID3 tags + thumbnail cover art
includePlaylistbooleanfalseExpand playlist URLs
maxResultsinteger20Total track cap per run (1–200)
maxDurationMinutesinteger120Skip longer videos
maxFileSizeMbinteger100Skip larger files
includeMetadataJsonbooleanfalseSave raw yt-dlp metadata JSON
cookiesTxtstring (secret)Netscape cookies.txt for restricted videos
proxyConfigurationobjectResidentialApify proxy settings

Example input

{
"videoUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
"authorizationConfirmed": true,
"audioFormat": "mp3",
"audioBitrate": "192",
"embedMetadata": true
}

Playlist example

{
"videoUrls": [{ "url": "https://www.youtube.com/playlist?list=PLxxxxxxxx" }],
"authorizationConfirmed": true,
"includePlaylist": true,
"maxResults": 25,
"audioFormat": "mp3",
"audioBitrate": "320"
}

Use with the Apify API

from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("khadinakbar/youtube-to-mp3-downloader").call(run_input={
"videoUrls": [{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],
"authorizationConfirmed": True,
"audioFormat": "mp3",
"audioBitrate": "192",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row["title"], row["fileKey"], row["status"])
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('khadinakbar/youtube-to-mp3-downloader').call({
videoUrls: [{ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }],
authorizationConfirmed: true,
audioFormat: 'mp3',
audioBitrate: '192',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Download a saved file from the key-value store using its fileKey:

https://api.apify.com/v2/key-value-stores/{storeId}/records/{fileKey}

MCP and AI agents

This actor is MCP-ready. It returns compact, flat JSON with stable keys and a direct fileKey for each track, so agents can request YouTube audio as a single tool call and hand the file to a downstream transcription or analysis step. Expose it via https://mcp.apify.com?tools=khadinakbar/youtube-to-mp3-downloader.

FAQ

Which format should I pick? MP3 for maximum compatibility, M4A/Opus for smaller high-quality files, WAV/FLAC when you need lossless audio for editing.

Does it embed cover art? Yes, when embedMetadata is on (default). The video thumbnail is embedded and ID3 tags are written.

Can it download a whole playlist? Yes — set includePlaylist: true and raise maxResults. The cap applies to the whole run to keep cost predictable.

Why residential proxy? YouTube heavily rate-limits datacenter IPs. Residential proxy is the default for reliability.

Age-restricted or members-only videos? Provide your own cookiesTxt (Netscape format). Only use cookies you are allowed to use.

A video returned "restricted_media"? Some premium/VEVO music and age-restricted videos are DRM-gated by YouTube and cannot be downloaded without a logged-in session. The run still succeeds and marks that track skipped with a clear message. To download it, supply cookiesTxt from an account allowed to view it. The vast majority of YouTube content (regular videos, talks, lectures, Shorts, most music, Creative Commons) downloads without cookies.

This actor is a technical tool for downloading audio you own or are legally permitted to download. You are solely responsible for how you use it and for complying with YouTube's Terms of Service and all applicable copyright laws. Downloading copyrighted content without permission may be illegal in your jurisdiction. The authorizationConfirmed checkbox must be set to true to confirm you have the necessary rights. This actor does not bypass paywalls, DRM, or access controls.