Create download request
curl --request POST \
--url https://api.videodb.io/download \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"stream_link": "https://stream.videodb.io/v/12345",
"name": "my_download.mp4"
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({stream_link: 'https://stream.videodb.io/v/12345', name: 'my_download.mp4'})
};
fetch('https://api.videodb.io/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.videodb.io/download",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'stream_link' => 'https://stream.videodb.io/v/12345',
'name' => 'my_download.mp4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.videodb.io/download"
payload := strings.NewReader("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.videodb.io/download")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/download")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/download' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"stream_link": "https://stream.videodb.io/v/12345",
"name": "my_download.mp4"
}'import Foundation
let parameters = [
"stream_link": "https://stream.videodb.io/v/12345",
"name": "my_download.mp4"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/download")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-access-token": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/download");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/download");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({stream_link: 'https://stream.videodb.io/v/12345', name: 'my_download.mp4'})
};
fetch('https://api.videodb.io/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/download");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/download");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}")
val request = Request.Builder()
.url("https://api.videodb.io/download")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"success": true,
"status": "processing",
"data": {
"id": "job-123",
"output_url": "https://api.videodb.io/async-response/job-123"
}
}Create Download Job
Create a new video download job to generate a downloadable file
POST
/
download
Create download request
curl --request POST \
--url https://api.videodb.io/download \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"stream_link": "https://stream.videodb.io/v/12345",
"name": "my_download.mp4"
}
'const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({stream_link: 'https://stream.videodb.io/v/12345', name: 'my_download.mp4'})
};
fetch('https://api.videodb.io/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.videodb.io/download",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'stream_link' => 'https://stream.videodb.io/v/12345',
'name' => 'my_download.mp4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.videodb.io/download"
payload := strings.NewReader("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.videodb.io/download")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.videodb.io/download")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("x-access-token", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.videodb.io/download' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"stream_link": "https://stream.videodb.io/v/12345",
"name": "my_download.mp4"
}'import Foundation
let parameters = [
"stream_link": "https://stream.videodb.io/v/12345",
"name": "my_download.mp4"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.videodb.io/download")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-access-token": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/download");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.videodb.io/download");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-access-token", "<api-key>");
request.AddJsonBody("{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({stream_link: 'https://stream.videodb.io/v/12345', name: 'my_download.mp4'})
};
fetch('https://api.videodb.io/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/download");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.videodb.io/download");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-access-token: <api-key>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"stream_link\": \"https://stream.videodb.io/v/12345\",\n \"name\": \"my_download.mp4\"\n}")
val request = Request.Builder()
.url("https://api.videodb.io/download")
.post(body)
.addHeader("x-access-token", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"success": true,
"status": "processing",
"data": {
"id": "job-123",
"output_url": "https://api.videodb.io/async-response/job-123"
}
}Initiate a download job to convert a stream URL into a downloadable file. This is an asynchronous operation that returns a download ID for tracking progress.
import videodb
conn = videodb.connect(api_key="your_api_key")
# Create a download job
result = conn.download(
stream_link="https://stream.videodb.io/v/abc123def",
name="my_export.mp4"
)
print(f"Download ID: {result.get('download_id')}")
import { connect } from 'videodb';
const conn = connect({ apiKey: 'your_api_key' });
// Create a download job
const result = await conn.download(
'https://stream.videodb.io/v/abc123def',
'my_export.mp4'
);
console.log(`Download ID: ${result.download_id}`);
- Download jobs are asynchronous—use the returned
download_idto check status - Provide a stream URL from
generateStream()or a timeline stream URL - The
nameparameter sets the output filename (include file extension) - Download URLs expire after 24 hours from completion
Streams and Exports Guide
Learn how to generate streams before downloading
Get Download Status
Check download progress and retrieve the final URL
Authorizations
API key for authentication (sk-xxx format)
Body
application/json
⌘I