Live streaming

Get Live Streams

List Live Streams

Get a list of live streams. Use optional query parameters to filter or sort the result.

GET https://api.dyntube.com/v1/live-streams

Headers

Name / Type / Description
NameTypeDescription
AuthorizationStringBearer YOUR_API_KEY

Query Parameters

Name / Type / Description
NameTypeDescription
pageIntegerPage number
sizeIntegerPage size
planTypeIntegerType of the plan
sortStringSort order of the results. See details below.

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

json

{
    "pager": {
        "page": 1,
        "totalPages": 1,
        "totalResults": 7,
        "sort": "name:-1"
    },
    "streams": [
        
        {
            "id": "6dWVR5343889MV3lQ",
            "name": "My Stream",
            "description": "",
            "region": "euc",
            "auth": false,
            "encrypt": false,
            "record": false,
            "storageProjectId": "",
            "platforms": [
                {
                    "service": 4,
                    "address": "rtmp://syd03.contribute.live-video.net/app",
                    "streamKey": "1211212"
                }
            ]
        },
        {
            "id": "6dWVR5343889MV3lQ2",
            "name": "My Stream 2",
            "description": "",
            "region": "euc",
            "auth": false,
            "encrypt": false,
            "record": false,
            "storageProjectId": "",
            "platforms": [
                {
                    "service": 4,
                    "address": "rtmp://syd03.contribute.live-video.net/app",
                    "streamKey": "1211212"
                }
            ]
        }
        
    ]
}

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 live streams. The format is field:1 for ascending order or field:-1 for descending order.

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

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

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

Code Samples

C#

csharp
using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

var res = await client.GetAsync("https://api.dyntube.com/v1/live-streams?page=1&size=20");
var body = await res.Content.ReadAsStringAsync();
System.Console.WriteLine(body);

Node.js

javascript
const axios = require('axios');

async function listStreams() {
  const res = await axios.get('https://api.dyntube.com/v1/live-streams?page=1&size=20', {
    headers: { Authorization: 'Bearer YOUR_API_KEY' }
  });
  console.log(res.data);
}

listStreams().catch(err => console.error(err.response?.data || err.message));

Python

python
import requests

res = requests.get(
    "https://api.dyntube.com/v1/live-streams",
    params={"page": 1, "size": 20},
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

print(res.status_code, res.text)

PHP

php
<?php
$ch = curl_init("https://api.dyntube.com/v1/live-streams?page=1&size=20");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"]
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "Status: {$status}\n";
echo $response;
  • Create a live stream to add a new stream.
  • Get a live stream to inspect a single stream.
  • Count live streams to check current usage.
  • Live streams limit to check account limits.

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