Livepush Developers

Usage

Get bandwidth for a stream

GET https://usages.livepush.io/usage/cdn/streams/{stream_id}

Base URL https://usages.livepush.io — Usage & Bandwidth API

Returns the bandwidth recorded for one stream, resolved through the hostname it delivers on. Ranges work exactly as they do on GET /usage/cdn/hostnames.

Check assignment before you trust bytes. Only dedicated means the figure belongs to this stream alone. shared means the hostname carries the streams named in sharedWith as well, so the figure covers all of them. pooled means the stream delivers on the account's primary hostname, where traffic cannot be attributed per stream: bytes is null and reason explains why.

A stream with no per-stream tracking is not an error. It returns 200 with assignment: pooled and a reason, because whether a stream has its own hostname is account configuration rather than a bad request. The only 404 is a stream that does not exist or is not yours.

Add daily=true for the per-day series. Days with no traffic are omitted, so do not assume one entry per day in the range.

Authorization

Send a valid access token in the Authorization header.

  • bearerAuth — Bearer token (JWT)
headers.txt
Authorization: Bearer YOUR_API_TOKEN

Try it

GET https://usages.livepush.io/usage/cdn/streams/{stream_id} — This call only reads data.

Parameters

Path parameters

  • stream_id string required
    Unique identifier of the stream.
    example: st_xxxxxxxxxxxxx

Query parameters

  • from string<date>
    First UTC day to include, as YYYY-MM-DD. Defaults to the start of the current billing term.
    example: 2026-10-01
  • till string<date>
    Last UTC day to include, as YYYY-MM-DD. Defaults to today.
    example: 2026-10-15
  • daily boolean
    Include a per-day series. Days with no traffic are omitted.

Code samples

request.sh
curl -X GET 'https://usages.livepush.io/usage/cdn/streams/st_xxxxxxxxxxxxx' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://usages.livepush.io/usage/cdn/streams/st_xxxxxxxxxxxxx', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
  },
});

if (!response.ok) {
  throw new Error(`Livepush API error ${response.status}`);
}

const data = await response.json();
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
}

response = requests.get('https://usages.livepush.io/usage/cdn/streams/st_xxxxxxxxxxxxx', headers=headers, timeout=30)
response.raise_for_status()
data = response.json()

Responses

Bandwidth for the stream. Also returned when the stream has no per-stream figure, with bytes: null and a reason.

Headers

  • Cache-Control string
    Always private, max-age=60.

application/json

  • enabled boolean
    false when the account has no CDN delivery configured.
  • streamId string
  • assignment string
    How this stream's traffic is recorded. | Value | Meaning | | --- | --- | | dedicated | It has a hostname to itself, so bytes is its own traffic | | shared | It shares a hostname with other streams; bytes covers all of them, and sharedWith names them | | pooled | It delivers on the account's primary hostname, so its traffic cannot be separated. bytes is null | | none | The account has no CDN delivery configured |
    dedicatedsharedpoolednone
  • hostname string
    The hostname the figure was read from. For a pooled stream this is the account's primary hostname, reported so you know where the traffic went.
    nullable
  • label string
    nullable
  • sharedWith string[]
    The other streams delivering on the same hostname. Non-empty only when assignment is shared, and it is why bytes is not this stream alone.
  • range object
    The UTC days the figures actually cover, after defaults are applied. Both bounds are inclusive.
    • from string<date>
      First UTC day included.
    • till string<date>
      Last UTC day included. Today's figure is always partial.
    • isCurrentTerm boolean
      true when no dates were sent and the range was filled in from the current billing term. When true the totals come from the stored term rows rather than from summing days, which is what the dashboard shows.
  • term object
    The current CDN billing term. null when the account has no active cdn subscription and no stored term row to fall back on.
    nullable
    • start string<date-time>
      Start of the current term.
    • end string<date-time>
      End of the current term, or null when the term is open-ended or was recovered from a stored usage row rather than from a subscription.
      nullable
  • bytes integer<int64>
    Billable bytes on this stream's hostname across the range. null when the stream is pooled or delivery is not enabled.
    nullable
  • daily object[]
    Per-day series, present only when daily=true was sent, and empty for a pooled stream. Days with no traffic are omitted rather than zero-filled.
    • date string<date>
    • bytes integer<int64>
      Billable bytes recorded for this day.
  • lastUpdated string<date-time>
    nullable
  • reason string
    Why there is no per-stream figure, or null when there is one. Either stream is on the account's primary hostname or per-stream bandwidth not enabled.
    nullable
Example 200 response response.json
{
  "enabled": true,
  "streamId": "st_xxxxxxxxxxxxx",
  "assignment": "dedicated",
  "hostname": "hls-acme-livepush.akamaized.net",
  "label": "Acme Channel",
  "sharedWith": [],
  "range": {
    "from": "2026-10-02",
    "till": "2026-10-15",
    "isCurrentTerm": true
  },
  "term": {
    "start": "2026-10-02T04:03:40.000Z",
    "end": "2026-11-02T04:03:40.000Z"
  },
  "bytes": 1234567890,
  "daily": [
    {
      "date": "2026-10-06",
      "bytes": 123456789
    }
  ],
  "lastUpdated": "2026-10-15T04:03:20.000Z",
  "reason": null
}

invalid_range — see GET /usage/cdn/hostnames.

application/json

  • error string
    Stable machine-readable code.
  • message string
    Human-readable detail. Present on invalid_range, which says exactly which parameter was wrong.
Example 400 response response.json
{
  "error": "invalid_range",
  "message": "range is 500 days; the maximum is 400"
}

Unauthorized

stream_not_found — no such stream on this account.

application/json

  • error string
    Stable machine-readable code.
  • message string
    Human-readable detail. Present on invalid_range, which says exactly which parameter was wrong.
Example 404 response response.json
{
  "error": "invalid_range",
  "message": "range is 500 days; the maximum is 400"
}