Add Video Library
curl --request POST \
--url https://api.bunny.net/videolibrary \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"Name": "<string>",
"ReplicationRegions": [
"<string>"
],
"PlayerVersion": 123,
"JitEncodingEnabled": true,
"OutputCodecs": "<string>",
"EnabledResolutions": "<string>",
"BlockNoneReferrer": true,
"EnableMP4Fallback": true,
"KeepOriginalFiles": true,
"AllowDirectPlay": true,
"EnableMultiAudioTrackSupport": true,
"EnableTranscribing": true,
"TranscribingCaptionLanguages": [
"<string>"
],
"EnableTranscribingTitleGeneration": true,
"EnableTranscribingDescriptionGeneration": true,
"EnableTranscribingChaptersGeneration": true,
"EnableTranscribingMomentsGeneration": true,
"AllowEarlyPlay": true
}
'import requests
url = "https://api.bunny.net/videolibrary"
payload = {
"Name": "<string>",
"ReplicationRegions": ["<string>"],
"PlayerVersion": 123,
"JitEncodingEnabled": True,
"OutputCodecs": "<string>",
"EnabledResolutions": "<string>",
"BlockNoneReferrer": True,
"EnableMP4Fallback": True,
"KeepOriginalFiles": True,
"AllowDirectPlay": True,
"EnableMultiAudioTrackSupport": True,
"EnableTranscribing": True,
"TranscribingCaptionLanguages": ["<string>"],
"EnableTranscribingTitleGeneration": True,
"EnableTranscribingDescriptionGeneration": True,
"EnableTranscribingChaptersGeneration": True,
"EnableTranscribingMomentsGeneration": True,
"AllowEarlyPlay": True
}
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Name: '<string>',
ReplicationRegions: ['<string>'],
PlayerVersion: 123,
JitEncodingEnabled: true,
OutputCodecs: '<string>',
EnabledResolutions: '<string>',
BlockNoneReferrer: true,
EnableMP4Fallback: true,
KeepOriginalFiles: true,
AllowDirectPlay: true,
EnableMultiAudioTrackSupport: true,
EnableTranscribing: true,
TranscribingCaptionLanguages: ['<string>'],
EnableTranscribingTitleGeneration: true,
EnableTranscribingDescriptionGeneration: true,
EnableTranscribingChaptersGeneration: true,
EnableTranscribingMomentsGeneration: true,
AllowEarlyPlay: true
})
};
fetch('https://api.bunny.net/videolibrary', 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.bunny.net/videolibrary",
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([
'Name' => '<string>',
'ReplicationRegions' => [
'<string>'
],
'PlayerVersion' => 123,
'JitEncodingEnabled' => true,
'OutputCodecs' => '<string>',
'EnabledResolutions' => '<string>',
'BlockNoneReferrer' => true,
'EnableMP4Fallback' => true,
'KeepOriginalFiles' => true,
'AllowDirectPlay' => true,
'EnableMultiAudioTrackSupport' => true,
'EnableTranscribing' => true,
'TranscribingCaptionLanguages' => [
'<string>'
],
'EnableTranscribingTitleGeneration' => true,
'EnableTranscribingDescriptionGeneration' => true,
'EnableTranscribingChaptersGeneration' => true,
'EnableTranscribingMomentsGeneration' => true,
'AllowEarlyPlay' => true
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"Content-Type: application/json"
],
]);
$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.bunny.net/videolibrary"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"ReplicationRegions\": [\n \"<string>\"\n ],\n \"PlayerVersion\": 123,\n \"JitEncodingEnabled\": true,\n \"OutputCodecs\": \"<string>\",\n \"EnabledResolutions\": \"<string>\",\n \"BlockNoneReferrer\": true,\n \"EnableMP4Fallback\": true,\n \"KeepOriginalFiles\": true,\n \"AllowDirectPlay\": true,\n \"EnableMultiAudioTrackSupport\": true,\n \"EnableTranscribing\": true,\n \"TranscribingCaptionLanguages\": [\n \"<string>\"\n ],\n \"EnableTranscribingTitleGeneration\": true,\n \"EnableTranscribingDescriptionGeneration\": true,\n \"EnableTranscribingChaptersGeneration\": true,\n \"EnableTranscribingMomentsGeneration\": true,\n \"AllowEarlyPlay\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<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.bunny.net/videolibrary")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Name\": \"<string>\",\n \"ReplicationRegions\": [\n \"<string>\"\n ],\n \"PlayerVersion\": 123,\n \"JitEncodingEnabled\": true,\n \"OutputCodecs\": \"<string>\",\n \"EnabledResolutions\": \"<string>\",\n \"BlockNoneReferrer\": true,\n \"EnableMP4Fallback\": true,\n \"KeepOriginalFiles\": true,\n \"AllowDirectPlay\": true,\n \"EnableMultiAudioTrackSupport\": true,\n \"EnableTranscribing\": true,\n \"TranscribingCaptionLanguages\": [\n \"<string>\"\n ],\n \"EnableTranscribingTitleGeneration\": true,\n \"EnableTranscribingDescriptionGeneration\": true,\n \"EnableTranscribingChaptersGeneration\": true,\n \"EnableTranscribingMomentsGeneration\": true,\n \"AllowEarlyPlay\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunny.net/videolibrary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Name\": \"<string>\",\n \"ReplicationRegions\": [\n \"<string>\"\n ],\n \"PlayerVersion\": 123,\n \"JitEncodingEnabled\": true,\n \"OutputCodecs\": \"<string>\",\n \"EnabledResolutions\": \"<string>\",\n \"BlockNoneReferrer\": true,\n \"EnableMP4Fallback\": true,\n \"KeepOriginalFiles\": true,\n \"AllowDirectPlay\": true,\n \"EnableMultiAudioTrackSupport\": true,\n \"EnableTranscribing\": true,\n \"TranscribingCaptionLanguages\": [\n \"<string>\"\n ],\n \"EnableTranscribingTitleGeneration\": true,\n \"EnableTranscribingDescriptionGeneration\": true,\n \"EnableTranscribingChaptersGeneration\": true,\n \"EnableTranscribingMomentsGeneration\": true,\n \"AllowEarlyPlay\": true\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Name": "<string>",
"VideoCount": 123,
"LiveStreamCount": 123,
"TotalCount": 123,
"TrafficUsage": 123,
"StorageUsage": 123,
"DateCreated": "2023-11-07T05:31:56Z",
"DateModified": "2023-11-07T05:31:56Z",
"ReplicationRegions": [
"<string>"
],
"ApiKey": "<string>",
"ReadOnlyApiKey": "<string>",
"HasWatermark": true,
"WatermarkPositionLeft": 123,
"WatermarkPositionTop": 123,
"WatermarkWidth": 123,
"PullZoneId": 123,
"StorageZoneId": 123,
"WatermarkHeight": 123,
"EnabledResolutions": "<string>",
"ViAiPublisherId": "<string>",
"VastTagUrl": "<string>",
"WebhookUrl": "<string>",
"CaptionsFontSize": 123,
"CaptionsFontColor": "<string>",
"CaptionsBackground": "<string>",
"UILanguage": "<string>",
"AllowEarlyPlay": true,
"PlayerTokenAuthenticationEnabled": true,
"AllowedReferrers": [
"<string>"
],
"BlockedReferrers": [
"<string>"
],
"BlockNoneReferrer": true,
"EnableMP4Fallback": true,
"KeepOriginalFiles": true,
"AllowDirectPlay": true,
"EnableDRM": true,
"DrmVersion": 0,
"AppleFairPlayDrm": {
"Enabled": true,
"CertificateId": 123,
"CertificateExpirationDate": "2023-11-07T05:31:56Z",
"Provider": "<string>"
},
"GoogleWidevineDrm": {
"Enabled": true,
"CertificateId": 123,
"CertificateExpirationDate": "2023-11-07T05:31:56Z",
"Provider": "<string>",
"SdOnlyForL3": true,
"MinClientSecurityLevel": 0
},
"Bitrate240p": 123,
"Bitrate360p": 123,
"Bitrate480p": 123,
"Bitrate720p": 123,
"Bitrate1080p": 123,
"Bitrate1440p": 123,
"Bitrate2160p": 123,
"ApiAccessKey": "<string>",
"ShowHeatmap": true,
"EnableContentTagging": true,
"PullZoneType": 0,
"CustomHTML": "<string>",
"Controls": "<string>",
"PlaybackSpeeds": "<string>",
"PlayerKeyColor": "<string>",
"FontFamily": "<string>",
"WatermarkVersion": 123,
"EnableTranscribing": true,
"EnableTranscribingTitleGeneration": true,
"EnableTranscribingDescriptionGeneration": true,
"EnableTranscribingChaptersGeneration": true,
"EnableTranscribingMomentsGeneration": true,
"TranscribingCaptionLanguages": [
"<string>"
],
"EnableCaptionsInPlaylist": true,
"RememberPlayerPosition": true,
"EnableMultiAudioTrackSupport": true,
"UseSeparateAudioStream": true,
"JitEncodingEnabled": true,
"EncodingTier": 0,
"OutputCodecs": "<string>",
"DrmBasePriceOverride": 123,
"DrmCostPerLicenseOverride": 123,
"TranscribingPriceOverride": 123,
"PremiumEncodingPriceOverride": 123,
"MonthlyChargesTranscribing": 123,
"MonthlyChargesPremiumEncoding": 123,
"MonthlyChargesEnterpriseDrm": 123,
"FeatureFlags": "<string>",
"PlayerVersion": 123,
"RemoveMetadataFromFallbackVideos": true,
"ScaleVideoUsingBothDimensions": true,
"ExposeOriginals": true,
"ExposeVideoMetadata": true,
"EnableCompactControls": true,
"GeoBlocking": {
"Enabled": true,
"AllowedCountries": [
"<string>"
],
"BlockedCountries": [
"<string>"
]
}
}{
"ErrorKey": "<string>",
"Field": "<string>",
"Message": "<string>"
}Stream Video Library
Add Video Library
POST
/
videolibrary
Add Video Library
curl --request POST \
--url https://api.bunny.net/videolibrary \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"Name": "<string>",
"ReplicationRegions": [
"<string>"
],
"PlayerVersion": 123,
"JitEncodingEnabled": true,
"OutputCodecs": "<string>",
"EnabledResolutions": "<string>",
"BlockNoneReferrer": true,
"EnableMP4Fallback": true,
"KeepOriginalFiles": true,
"AllowDirectPlay": true,
"EnableMultiAudioTrackSupport": true,
"EnableTranscribing": true,
"TranscribingCaptionLanguages": [
"<string>"
],
"EnableTranscribingTitleGeneration": true,
"EnableTranscribingDescriptionGeneration": true,
"EnableTranscribingChaptersGeneration": true,
"EnableTranscribingMomentsGeneration": true,
"AllowEarlyPlay": true
}
'import requests
url = "https://api.bunny.net/videolibrary"
payload = {
"Name": "<string>",
"ReplicationRegions": ["<string>"],
"PlayerVersion": 123,
"JitEncodingEnabled": True,
"OutputCodecs": "<string>",
"EnabledResolutions": "<string>",
"BlockNoneReferrer": True,
"EnableMP4Fallback": True,
"KeepOriginalFiles": True,
"AllowDirectPlay": True,
"EnableMultiAudioTrackSupport": True,
"EnableTranscribing": True,
"TranscribingCaptionLanguages": ["<string>"],
"EnableTranscribingTitleGeneration": True,
"EnableTranscribingDescriptionGeneration": True,
"EnableTranscribingChaptersGeneration": True,
"EnableTranscribingMomentsGeneration": True,
"AllowEarlyPlay": True
}
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Name: '<string>',
ReplicationRegions: ['<string>'],
PlayerVersion: 123,
JitEncodingEnabled: true,
OutputCodecs: '<string>',
EnabledResolutions: '<string>',
BlockNoneReferrer: true,
EnableMP4Fallback: true,
KeepOriginalFiles: true,
AllowDirectPlay: true,
EnableMultiAudioTrackSupport: true,
EnableTranscribing: true,
TranscribingCaptionLanguages: ['<string>'],
EnableTranscribingTitleGeneration: true,
EnableTranscribingDescriptionGeneration: true,
EnableTranscribingChaptersGeneration: true,
EnableTranscribingMomentsGeneration: true,
AllowEarlyPlay: true
})
};
fetch('https://api.bunny.net/videolibrary', 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.bunny.net/videolibrary",
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([
'Name' => '<string>',
'ReplicationRegions' => [
'<string>'
],
'PlayerVersion' => 123,
'JitEncodingEnabled' => true,
'OutputCodecs' => '<string>',
'EnabledResolutions' => '<string>',
'BlockNoneReferrer' => true,
'EnableMP4Fallback' => true,
'KeepOriginalFiles' => true,
'AllowDirectPlay' => true,
'EnableMultiAudioTrackSupport' => true,
'EnableTranscribing' => true,
'TranscribingCaptionLanguages' => [
'<string>'
],
'EnableTranscribingTitleGeneration' => true,
'EnableTranscribingDescriptionGeneration' => true,
'EnableTranscribingChaptersGeneration' => true,
'EnableTranscribingMomentsGeneration' => true,
'AllowEarlyPlay' => true
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"Content-Type: application/json"
],
]);
$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.bunny.net/videolibrary"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"ReplicationRegions\": [\n \"<string>\"\n ],\n \"PlayerVersion\": 123,\n \"JitEncodingEnabled\": true,\n \"OutputCodecs\": \"<string>\",\n \"EnabledResolutions\": \"<string>\",\n \"BlockNoneReferrer\": true,\n \"EnableMP4Fallback\": true,\n \"KeepOriginalFiles\": true,\n \"AllowDirectPlay\": true,\n \"EnableMultiAudioTrackSupport\": true,\n \"EnableTranscribing\": true,\n \"TranscribingCaptionLanguages\": [\n \"<string>\"\n ],\n \"EnableTranscribingTitleGeneration\": true,\n \"EnableTranscribingDescriptionGeneration\": true,\n \"EnableTranscribingChaptersGeneration\": true,\n \"EnableTranscribingMomentsGeneration\": true,\n \"AllowEarlyPlay\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<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.bunny.net/videolibrary")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Name\": \"<string>\",\n \"ReplicationRegions\": [\n \"<string>\"\n ],\n \"PlayerVersion\": 123,\n \"JitEncodingEnabled\": true,\n \"OutputCodecs\": \"<string>\",\n \"EnabledResolutions\": \"<string>\",\n \"BlockNoneReferrer\": true,\n \"EnableMP4Fallback\": true,\n \"KeepOriginalFiles\": true,\n \"AllowDirectPlay\": true,\n \"EnableMultiAudioTrackSupport\": true,\n \"EnableTranscribing\": true,\n \"TranscribingCaptionLanguages\": [\n \"<string>\"\n ],\n \"EnableTranscribingTitleGeneration\": true,\n \"EnableTranscribingDescriptionGeneration\": true,\n \"EnableTranscribingChaptersGeneration\": true,\n \"EnableTranscribingMomentsGeneration\": true,\n \"AllowEarlyPlay\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunny.net/videolibrary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Name\": \"<string>\",\n \"ReplicationRegions\": [\n \"<string>\"\n ],\n \"PlayerVersion\": 123,\n \"JitEncodingEnabled\": true,\n \"OutputCodecs\": \"<string>\",\n \"EnabledResolutions\": \"<string>\",\n \"BlockNoneReferrer\": true,\n \"EnableMP4Fallback\": true,\n \"KeepOriginalFiles\": true,\n \"AllowDirectPlay\": true,\n \"EnableMultiAudioTrackSupport\": true,\n \"EnableTranscribing\": true,\n \"TranscribingCaptionLanguages\": [\n \"<string>\"\n ],\n \"EnableTranscribingTitleGeneration\": true,\n \"EnableTranscribingDescriptionGeneration\": true,\n \"EnableTranscribingChaptersGeneration\": true,\n \"EnableTranscribingMomentsGeneration\": true,\n \"AllowEarlyPlay\": true\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Name": "<string>",
"VideoCount": 123,
"LiveStreamCount": 123,
"TotalCount": 123,
"TrafficUsage": 123,
"StorageUsage": 123,
"DateCreated": "2023-11-07T05:31:56Z",
"DateModified": "2023-11-07T05:31:56Z",
"ReplicationRegions": [
"<string>"
],
"ApiKey": "<string>",
"ReadOnlyApiKey": "<string>",
"HasWatermark": true,
"WatermarkPositionLeft": 123,
"WatermarkPositionTop": 123,
"WatermarkWidth": 123,
"PullZoneId": 123,
"StorageZoneId": 123,
"WatermarkHeight": 123,
"EnabledResolutions": "<string>",
"ViAiPublisherId": "<string>",
"VastTagUrl": "<string>",
"WebhookUrl": "<string>",
"CaptionsFontSize": 123,
"CaptionsFontColor": "<string>",
"CaptionsBackground": "<string>",
"UILanguage": "<string>",
"AllowEarlyPlay": true,
"PlayerTokenAuthenticationEnabled": true,
"AllowedReferrers": [
"<string>"
],
"BlockedReferrers": [
"<string>"
],
"BlockNoneReferrer": true,
"EnableMP4Fallback": true,
"KeepOriginalFiles": true,
"AllowDirectPlay": true,
"EnableDRM": true,
"DrmVersion": 0,
"AppleFairPlayDrm": {
"Enabled": true,
"CertificateId": 123,
"CertificateExpirationDate": "2023-11-07T05:31:56Z",
"Provider": "<string>"
},
"GoogleWidevineDrm": {
"Enabled": true,
"CertificateId": 123,
"CertificateExpirationDate": "2023-11-07T05:31:56Z",
"Provider": "<string>",
"SdOnlyForL3": true,
"MinClientSecurityLevel": 0
},
"Bitrate240p": 123,
"Bitrate360p": 123,
"Bitrate480p": 123,
"Bitrate720p": 123,
"Bitrate1080p": 123,
"Bitrate1440p": 123,
"Bitrate2160p": 123,
"ApiAccessKey": "<string>",
"ShowHeatmap": true,
"EnableContentTagging": true,
"PullZoneType": 0,
"CustomHTML": "<string>",
"Controls": "<string>",
"PlaybackSpeeds": "<string>",
"PlayerKeyColor": "<string>",
"FontFamily": "<string>",
"WatermarkVersion": 123,
"EnableTranscribing": true,
"EnableTranscribingTitleGeneration": true,
"EnableTranscribingDescriptionGeneration": true,
"EnableTranscribingChaptersGeneration": true,
"EnableTranscribingMomentsGeneration": true,
"TranscribingCaptionLanguages": [
"<string>"
],
"EnableCaptionsInPlaylist": true,
"RememberPlayerPosition": true,
"EnableMultiAudioTrackSupport": true,
"UseSeparateAudioStream": true,
"JitEncodingEnabled": true,
"EncodingTier": 0,
"OutputCodecs": "<string>",
"DrmBasePriceOverride": 123,
"DrmCostPerLicenseOverride": 123,
"TranscribingPriceOverride": 123,
"PremiumEncodingPriceOverride": 123,
"MonthlyChargesTranscribing": 123,
"MonthlyChargesPremiumEncoding": 123,
"MonthlyChargesEnterpriseDrm": 123,
"FeatureFlags": "<string>",
"PlayerVersion": 123,
"RemoveMetadataFromFallbackVideos": true,
"ScaleVideoUsingBothDimensions": true,
"ExposeOriginals": true,
"ExposeVideoMetadata": true,
"EnableCompactControls": true,
"GeoBlocking": {
"Enabled": true,
"AllowedCountries": [
"<string>"
],
"BlockedCountries": [
"<string>"
]
}
}{
"ErrorKey": "<string>",
"Field": "<string>",
"Message": "<string>"
}Scopes
Body
application/json
Response
The added video library
The comma-separated list of controls displayed in the video player. Possible values: play-large, play, progress, current-time, duration, mute, volume, captions, settings, pip, airplay, fullscreen, rewind, fast-forward, and chromecast. Empty when all player UI controls are removed.