Links

Get Video

Get a Single Video

get
https://api.dyntube.com/v1/
videos/{id}
This endpoint will return a single video with the provided video Id.
Parameters
Path
id*
String
Video Id. This is NOT the same as channelKey that is provided in the embed code. This is normally provided in the video list through API or through the dashboard.
Responses
200: OK
Video object in JSON format
404: Not Found
If video not found

C# Sample

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;
namespace SingleVideo
{
class Program
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "your_bearer_token");
var videoId = "your_video_id";
var response = await client.GetAsync($"https://api.dyntube.com/v1/videos/{videoId}");
if (response.IsSuccessStatusCode)
{
var responseContent = await response.Content.ReadAsStringAsync();
var video = JsonSerializer.Deserialize<Video>(responseContent);
Console.WriteLine("Id: " + video.Id);
Console.WriteLine("Title: " + video.Title);
Console.WriteLine("Description: " + video.Description);
Console.WriteLine("hlsUrl: " + video.HlsUrl);
Console.WriteLine("hlsUrlWeb: " + video.HlsUrlWeb);
Console.WriteLine("mp4Url: " + video.Mp4Url);
}
else
{
Console.WriteLine("Error getting video. Status code: " + response.StatusCode);
}
}
}
class Video
{
public string Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string HlsUrl { get; set; }
public string HlsUrlWeb { get; set; }
public string Mp4Url { get; set; }
}
}

Node.js

const axios = require('axios');
const videoId = 'your_video_id';
const bearerToken = 'your_bearer_token';
async function getVideo() {
try {
const response = await axios.get(`https://api.dyntube.com/v1/videos/${videoId}`, {
headers: {
Authorization: `Bearer ${bearerToken}`
}
});
const video = response.data;
console.log('Id:', video.id);
console.log('Title:', video.title);
console.log('Description:', video.description);
console.log('hlsUrl:', video.hlsUrl);
console.log('hlsUrlWeb:', video.hlsUrlWeb);
console.log('mp4Url:', video.mp4Url);
} catch (error) {
console.error(error);
}
}
getVideo();

Python

import requests
video_id = 'your_video_id'
bearer_token = 'your_bearer_token'
url = f'https://api.dyntube.com/v1/videos/{video_id}'
headers = {
'Authorization': f'Bearer {bearer_token}'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
video = response.json()
print('Id:', video['id'])
print('Title:', video['title'])
print('Description:', video['description'])
print('hlsUrl:', video['hlsUrl'])
print('hlsUrlWeb:', video['hlsUrlWeb'])
print('mp4Url:', video['mp4Url'])
else:
print('Error getting video. Status code:', response.status_code)

PHP

<?php
$video_id = 'your_video_id';
$bearer_token = 'your_bearer_token';
$url = "https://api.dyntube.com/v1/videos/{$video_id}";
$headers = array(
'Authorization: Bearer ' . $bearer_token
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (!$response) {
echo 'Error getting video: ' . curl_error($ch);
} else {
$video = json_decode($response, true);
echo "Id: " . $video['id'] . "\n";
echo "Title: " . $video['title'] . "\n";
echo "Description: " . $video['description'] . "\n";
echo "hlsUrl: " . $video['hlsUrl'] . "\n";
echo "hlsUrlWeb: " . $video['hlsUrlWeb'] . "\n";
echo "mp4Url: " . $video['mp4Url'] . "\n";
}
curl_close($ch);
?>
A video status3 means that the video is published. See more details here.