Videos

Get Videos

List and filter the videos available to the authenticated account.

Get Video List

Get a list of videos. You can filter and sort the result with optional query parameters.

GET https://api.dyntube.com/v1/videos

Query Parameters

Name / Type / Description
NameTypeDescription
pageIntegerPage number
sizeIntegerPage size
planTypeIntegerType of the plan
sortStringSort order of the results. See details below.
projectIdStringID of the project
tagsStringFilter videos by tag name.
regionStringFilter videos by region code, such as usw-s.
includeOriginalFileBooleanOptional. Set to true to include signed original file download URLs in original.url. Original file URLs expire after 12 hours.

200: OK Response returns a list of videos and a pager.

json
{
    "pager": {
        "page": 1,
        "totalPages": 400,
        "totalResults": 400,
        "sort": "Created:-1"
    },
    "videos": [
        {
			"id": "fFL56RU6PjvJPeE",
			"duration": "00:02:30.1270000",
			"projectId": "unjVhFJ7vAhrYu9",
			"accountKey": "6aG9UBe5rGPzjbh",
			"region": "use-s",
			"captions": [],
			"key": "NULPJ7mWDuyj4w5",
			"channelKey": "f8RMr2q4h6yNpv9",
			"privateLink": "QBr6n8HN878t5sH",
			"hlsLink": "Sx5FTtWsUU8tmux",
			"planType": 1,
			"mp4Url": "",
			"mp4Urls": [],
			"formats": {
				"hls": true,
				"mp4": false
			},
			"hlsUrl": "https://api.dyntube.com/v1/apps/hls/FhyinduNY4Kr9Q.m3u8",
			"hlsUrlWeb": "https://api.dyntube.com/v1/apps/hls/FhyinduNY4Kr9Q.m3u8",
			"title": "My Video",
			"description": "",
			"options": {
				"autoplay": false,
				"playerColor": "rgba(255, 65, 113, 0.83)",
				"playerSkin": "solid",
				"controlsColor": "#FFFFFF",
				"seekButtons": false,
				"volumeControl": true,
				"preload": "auto",
				"fullscreenControl": true,
				"controls": true,
				"stickyControls": false,
				"defaultQuality": "",
				"qualityControl": true,
				"speedControl": true,
				"fastForward": true,
				"bigPlayControl": true,
				"playControl": true,
				"volume": 1.0,
				"loop": false,
				"muted": false,
				"modal": false
			},
			"tags": [],
			"version": 1,
            "original": {
                "height": 720,
                "width": 1280,
                "url": "https://cdn.example.com/path/original.mp4?md5=...&expires=..."
            },
			"status": 3,
            "statusName": "Published",
			"created": "2016-08-27T12:37:24.4970796+00:00"
		}
    ]
}

Error Responses

Status Code / Description
Status CodeDescription
400Bad Request - Invalid query parameters
401Unauthorized - Invalid or missing API key

Sorting of results

Use the sort query parameter to order videos. The format is field:1 for ascending order or field:-1 for descending order.

yaml
#Here are examples to sort the videos by "Created" date.

#Sort by date created descending:
https://api.dyntube.com/v1/videos?sort=Created:-1

#Sort by date created ascending:
https://api.dyntube.com/v1/videos?sort=Created:1

C# Sample

csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;

namespace VideoList
{
    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 response = await client.GetAsync("https://api.dyntube.com/v1/videos");

            if (response.IsSuccessStatusCode)
            {
                var responseContent = await response.Content.ReadAsStringAsync();
                var videosResponse = JsonSerializer.Deserialize<VideosResponse>(responseContent);
                foreach (var video in videosResponse.Videos)
                {
                    Console.WriteLine("ID: " + video.Id);
                    Console.WriteLine("Title: " + video.Title);
                    Console.WriteLine("hlsUrl: " + video.HlsUrl);
                    Console.WriteLine("hlsUrlWeb: " + video.HlsUrlWeb);
                    Console.WriteLine("mp4Url: " + video.Mp4Url);
                }
            }
        }
    }

    class VideosResponse
    {
        public Video[] Videos { get; set; }
        public Pager Pager { get; set; }

    }

    class Video
    {
        public string Id { get; set; }
        public string Title { get; set; }
        public string HlsUrl { get; set; }
        public string HlsUrlWeb { get; set; }
        public string Mp4Url { get; set; }
    }
    class Pager
    {
        public int page { get; set; }
        public int totalPages { get; set; }
        public int totalResults { get; set; }
        public string sort { get; set; }
    }

}

Node.js Sample

javascript
const axios = require('axios');

async function video_list(bearer_token) {
    try {
        const response = await axios.get("https://api.dyntube.com/v1/videos", {
            headers: {
                Authorization: `Bearer ${bearer_token}`
            }
        });

        const videosResponse = response.data;
        for (const video of videosResponse.videos) {
            console.log("ID: " + video.id);
            console.log("Title: " + video.title);
            console.log("hlsUrl: " + video.hlsUrl);
            console.log("hlsUrlWeb: " + video.hlsUrlWeb);
            console.log("mp4Url: " + video.mp4Url);
        }
        console.log("Page: " + videosResponse.pager.page);
        console.log("Total Pages: " + videosResponse.pager.totalPages);
        console.log("Total Results: " + videosResponse.pager.totalResults);
        console.log("Sort: " + videosResponse.pager.sort);
    } catch (error) {
        console.error(error);
    }
}

video_list('your_bearer_token');

Python

python
import requests
import json

bearer_token = "your_bearer_token"
url = "https://api.dyntube.com/v1/videos"

headers = {
    "Authorization": f"Bearer {bearer_token}"
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    videos_response = response.json()
    for video in videos_response.get("videos", []):
        print("ID:", video.get("id"))
        print("Title:", video.get("title"))
        print("hlsUrl:", video.get("hlsUrl"))
        print("hlsUrlWeb:", video.get("hlsUrlWeb"))
        print("mp4Url:", video.get("mp4Url"))
    pager = videos_response.get("pager", {})
    print("Page:", pager.get("page"))
    print("Total Pages:", pager.get("totalPages"))
    print("Total Results:", pager.get("totalResults"))
    print("Sort:", pager.get("sort"))
else:
    print("Error getting videos. Status code:", response.status_code)

PHP

php
<?php
$bearer_token = 'your_bearer_token';
$url = 'https://api.dyntube.com/v1/videos';

$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 videos: ' . curl_error($ch);
} else {
    $videos_response = json_decode($response);
    foreach ($videos_response->videos as $video) {
        echo "ID: " . $video->id . "\n";
        echo "Title: " . $video->title . "\n";
        echo "hlsUrl: " . $video->hlsUrl . "\n";
        echo "hlsUrlWeb: " . $video->hlsUrlWeb . "\n";
        echo "mp4Url: " . $video->mp4Url . "\n";
    }
    echo "Page: " . $videos_response->pager->page . "\n";
    echo "Total Pages: " . $videos_response->pager->totalPages . "\n";
    echo "Total Results: " . $videos_response->pager->totalResults . "\n";
    echo "Sort: " . $videos_response->pager->sort . "\n";
}

curl_close($ch);
?>
  • Get video to retrieve full details for a single video.
  • Get video status to check processing state after upload.
  • Create expirable links for browser playback links.
  • Download original video when you need the uploaded source file.

Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.