YouTube Downloader API
One call turns a YouTube link into a direct download. Ask for the details first if you want to show someone the qualities and let them choose, then ask for the file once they have.
Qualities
What the video holds, and what each size costs.
https://api.gapi.dev/v2/youtube/infoParameters
urlrequiredstringAny public YouTube link: watch?v=…, youtu.be/…, /shorts/… and /live/… all work.
e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQResponses
{
"platform": "youtube",
"id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"author": "Rick Astley",
"author_url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
"duration": 213,
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg",
"thumbnails": {
"low": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg",
"max": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg"
},
"formats": [
{ "type": "video", "quality": "144p", "size": 5507589 },
{ "type": "video", "quality": "240p", "size": 7759569 },
{ "type": "video", "quality": "360p", "size": 11840368 },
{ "type": "video", "quality": "480p", "size": 17552966 },
{ "type": "video", "quality": "720p", "size": 29905327 },
{ "type": "video", "quality": "1080p", "size": 84361446 },
{ "type": "video", "quality": "1440p", "size": 125617724 },
{ "type": "video", "quality": "2160p", "size": 243784090 },
{ "type": "audio", "quality": "audio", "size": 3449447 }
]
}Download
One direct link, at the format you name.
https://api.gapi.dev/v2/youtubeParameters
urlrequiredstringAny public YouTube link: watch?v=…, youtu.be/…, /shorts/… and /live/… all work.
e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQformatoptionalstringA height — 1080, 720, 480, 360, 240, 144 — or mp3 for audio only. Defaults to 720.
e.g. 720Responses
{
"platform": "youtube",
"type": "video",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"author": "Rick Astley",
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"duration": null,
"media": [
{ "type": "video", "url": "https://api.gapi.dev/dl/…", "quality": "720", "ext": "mp4" }
]
}Try it
https://api.gapi.dev/v2/youtube/infocurl -G 'https://api.gapi.dev/v2/youtube/info' \
--data-urlencode 'url=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \
-H 'X-API-Key: YOUR_KEY'What each link gives you
| You send | type | media contains |
|---|---|---|
youtube.com/watch?v=… | video | one file, up to 1080p |
youtube.com/shorts/… | video | the same, Shorts are videos here |
youtube.com/live/… | video | the recording, once the stream has ended |
any of the above with format=mp3 | audio | one mp3 file, audio only |
What it does not do
Playlists, channels and streams that have not started. Quality above 1080p is not sold: the details call lists 1440p and 2160p because YouTube has them, and asking the download endpoint for either is answered with a 400.
Field-by-field detail is on the response shape page.
Code examples
The same request in four languages. Swap in the key from your dashboard and it runs as it is.
curl -G 'https://api.gapi.dev/v2/youtube' \
--data-urlencode 'url=https://www.youtube.com/watch?v=dQw4w9WgXcQ' \
-H 'X-API-Key: gapi_live_your_key_here'One call, one request
A carousel with ten slides costs the same as a single photo: one charge against your balance. You pay for calls, not for files.