YouTube to MP3 API
Most "YouTube to MP3" services download the video, convert it on their servers and hand you a file of unknown quality. CrawlFetch gives you the original audio track (m4a/AAC or Opus) as a direct download link. If you need MP3 specifically, one ffmpeg command converts it on your side, with the bitrate you choose.
Why the API returns m4a or Opus, not MP3
Platforms store audio as AAC (in m4a) or Opus. Re-encoding to MP3 always loses some quality, so returning the original track lets you decide whether you need MP3 at all — many players, editors and speech-to-text services accept m4a directly.
Get the audio and convert to MP3
curl -sG "https://api.crawlfetch.com/v1/resolve" --data-urlencode "url=https://youtu.be/aqz-KE-bpKQ" \--data-urlencode "format=m4a" -H "Authorization: Bearer $CRAWLFETCH_KEY" > audio.jsoncurl -fL -o audio.m4a "$(jq -r .downloadUrl audio.json)"ffmpeg -i audio.m4a -codec:a libmp3lame -q:a 2 audio.mp3 # VBR ~190 kbps
Choosing an MP3 bitrate
| Setting | Approx. bitrate | Good for |
|---|---|---|
-q:a 0 | ~245 kbps VBR | Music, archiving |
-q:a 2 | ~190 kbps VBR | Default for most apps |
-b:a 128k | 128 kbps CBR | Podcasts, speech, small files |
-b:a 64k -ac 1 | 64 kbps mono | Transcription input, voice notes |
Plans
Audio-only formats (m4a, opus) are included from Starter up. On every plan, audioUrl in the resolve response points at the best audio track.
FAQ
Does the API convert to MP3 itself?
No — it returns the original audio track so you don't lose quality to a double encode. Convert with ffmpeg if you need MP3.
Does it work for TikTok audio?
Yes, when TikTok publishes a separate audio track. See the TikTok download API.
Is downloading music legal?
Only download audio you own or have rights to use. Commercial music is usually protected by copyright.
Related
Last updated 2026-10-25