GAPI

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.

GEThttps://api.gapi.dev/v2/youtube/info

Parameters

urlrequiredstring

Any public YouTube link: watch?v=…, youtu.be/…, /shorts/… and /live/… all work.

e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ

Responses

{
  "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.

GEThttps://api.gapi.dev/v2/youtube

Parameters

urlrequiredstring

Any public YouTube link: watch?v=…, youtu.be/…, /shorts/… and /live/… all work.

e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ
formatoptionalstring

A height — 1080, 720, 480, 360, 240, 144 — or mp3 for audio only. Defaults to 720.

e.g. 720

Responses

{
  "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

GEThttps://api.gapi.dev/v2/youtube/info
Try
No key yet? Create one free
curl -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 sendtypemedia contains
youtube.com/watch?v=…videoone file, up to 1080p
youtube.com/shorts/…videothe same, Shorts are videos here
youtube.com/live/…videothe recording, once the stream has ended
any of the above with format=mp3audioone 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.

Other platforms