REST API that allows you to download a YouTube video to audio or video format.
The generated links are available for a maximum period of 1 hour, after which the link is no longer available.
Request paramters POST /download
Param | Description | Required | Default Value |
---|---|---|---|
url | YouTube url of video | true | null |
format | format of downloaded file | false | mp3 |
startTime | clip start time in second | false | null |
endTime | clip end time in second | false | null |
quality | quality of audio response, insert a value between 0 (best) and 10 (worst) | false | 0 |
This is the list of formats available for download, the default format is mp3.
Format | Audio/Video |
---|---|
mp3 | audio |
m4a | audio |
3gp | video |
mp4 | video |
The easiest way to download a video to mp3 is via curl with the following command:
curl --request GET --url “https://youtube-to-mp315.p.rapidapi.com/download?url=https://www.youtube.com/watch?v=zyG9Nh_PH38" --header “X-RapidAPI-Host: youtube-to-mp315.p.rapidapi.com” --header “X-RapidAPI-Key: YOUR_API_KEY”
Below you can find an example of a service response.
{
"id": "0cbd1a95-4259-40c2-8b05-7dca250ce6d3",
"downloadUrl": "http://localhost/0cbd1a95-4259-40c2-8b05-7dca250ce6d3.mp3",
"status": "AVAILABLE",
"format": "MP3",
"title": "Artist - Song Name | Medium",
"startAt": "08/05/2022 18:32:58",
"endAt": "08/05/2022 18:33:03",
"startTime": 10,
"endTime": 50,
"quality": 0
}