Download video and music using cURL

Using our API to download YouTube video, SoundCloud music, Facebook media, etc. For FREE!

Code Example


Our API is really easy to use to download media files! Check this example out. How to download a YouTube video with cURL:

curl --get --include '' \
  -H 'X-Mashape-Key: YOUR-API-KEY' \
  -H 'Accept: text/plain'

This will return a JSON array with download links, thumbnails, etc!

For example, let’s say you want to download the Taylor Swift music video Shake It Off, from YouTube. First, locate the URL to the video in question, in this case it’s “”.

Then, just use that URL (with URL encoding), and your Mashape API key, as above. If you don’t have an API key yet, click here to get started.

So, your code should look something like this:

curl --get --include '' \
  -H 'X-Mashape-Key: YOUR-API-KEY' \
  -H 'Accept: text/plain'

You will get a JSON array back as a result:

   "message":"Successfully received info.",
   "title":"Taylor Swift - Shake It Off", 
   "description":"Taylor\u2019s new release 1989 is Available Now featuring the hit single \u201cShake It Off\u201d and her latest single \u201cBlank Space\u201d. ",
      "format":"audio only (DASH audio)",
      "format_note":"Audio only, no video",
      "format":"1920x1080 (1080p)",

In the array, you have “status” and “message” to give you the results, a thumbnail, and the most important parts, the “streams” array!

The “streams” array will contain all variants of the video, with or without audio, and in different quality!

Just pick the URL you want to download, and off you go!

Developers are downloading 50,000+ videos daily with our API. For FREE!