Live streaming

Count Live Streams

This endpoint returns a count of currently published live streams

POST https://api.dyntube.com/v1/live-streams/count

Headers

Name / Value
NameValue
Content-Typeapplication/json
AuthorizationBearer

Body

Name / Type / Description
NameTypeDescription
planTypenumber1 //for standard plans

Response

200

json
{
  "count": 1
}

400

json
{
  "error": "Bad request"
}

Code Samples

C#

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

var payload = "{ \"planType\": 1 }";
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

var res = await client.PostAsync(
    "https://api.dyntube.com/v1/live-streams/count",
    new StringContent(payload, Encoding.UTF8, "application/json"));

System.Console.WriteLine(res.StatusCode);
System.Console.WriteLine(await res.Content.ReadAsStringAsync());

Node.js

javascript
const axios = require('axios');

async function countStreams() {
  const res = await axios.post(
    'https://api.dyntube.com/v1/live-streams/count',
    { planType: 1 },
    { headers: { Authorization: 'Bearer YOUR_API_KEY' } }
  );
  console.log(res.data);
}

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

Python

python
import requests

res = requests.post(
    "https://api.dyntube.com/v1/live-streams/count",
    json={"planType": 1},
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

print(res.status_code, res.text)

PHP

php
<?php
$payload = ["planType" => 1];
$ch = curl_init("https://api.dyntube.com/v1/live-streams/count");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_API_KEY",
        "Content-Type: application/json"
    ]
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "Status: {$status}\n";
echo $response;
  • Live streams limit to compare current usage with account limits.
  • Get live streams to list the streams included in the count.
  • Create a live stream when there is available capacity.

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