YouTube to MP3 API — audio link from any video or Short
Two calls: /v1/youtube/info tells you what the audio weighs, /v1/youtube/create?quality=mp3 builds it and answers with a signed link. M4A is the source track and comes back with an exact size; MP3 is transcoded and its size is an estimate.
Example request
curl -s "https://api.saveapi.org/v1/youtube/create" \ -H "Authorization: Bearer sk_live_xxxx" \ -G --data-urlencode "url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \ --data-urlencode "quality=mp3"
10 credits
Accepted link shapes
youtube.com/watch?v=…, youtu.be/…, youtube.com/shorts/… and music.youtube.com/watch?v=… all resolve to the same video. Playlists and channel pages do not — the endpoint works on one video at a time.
What comes back
create answers with url (a signed link served from our side), filename with the title in it, mode "audio", ext, file_size with an exact flag, and expires as a Unix timestamp. After expires the link answers 410; call create again for a fresh one. The link has no Content-Length and no Range support — read it to the end in one pass.
What it costs
2 credits for info and 10 for create. If your users always want audio you can skip info and call create straight away — the quality parameter is all it needs. Cache the info response when you do show sizes: it is the cheap half.
Questions before you build
- MP3 or M4A?
- M4A is the original AAC track YouTube publishes: exact size, no transcoding, the link starts streaming at once. MP3 is built from it with ffmpeg, so its size is an estimate (exact: false). Choose M4A unless the player on the other end insists on MP3.
- Can I pick the bitrate?
- No. There is one audio rendition per format — the best M4A the source publishes and a single MP3 encode. The quality parameter accepts mp3 or m4a.
- Does it work for Shorts and YouTube Music links?
- Yes. A Short is a normal video with is_short: true in the info response, and a music.youtube.com link is accepted as the same video ID.