Get bandwidth by hostname
https://usages.livepush.io/usage/cdn/hostnames
Base URL https://usages.livepush.io — Usage & Bandwidth API
Returns every delivery hostname on the account with its billable bytes for the range, which is how you split CDN bandwidth per channel.
Picking a range. Send nothing and you get the current billing term,
from the day it started through today, with range.isCurrentTerm set to
true. Send from, till, or both to ask for specific UTC days instead.
from on its own runs to today; till on its own starts at the current
term. The maximum span is 400 days.
Reading the rows. The account's primary hostname comes first, then the
rest by descending bytes, then a synthetic _other row holding traffic
recorded against hostnames that are no longer configured. _other is
always present, even at zero, so the rows always sum to accountBytes.
Only a hostname with assignment: dedicated belongs to a single stream.
A pooled or shared row covers more than one stream and cannot be
split further, so do not divide it.
These are delivery figures, not an invoice. Quota, allowance and
overage are not reported here; they come from the account's subscription.
Figures are written by a collector that runs periodically, so the current
day is always partial and lastUpdated says how fresh the numbers are.
Add daily=true for a per-day series on every row.
Authorization
Send a valid access token in the Authorization header.
bearerAuth— Bearer token (JWT)
Authorization: Bearer YOUR_API_TOKEN
Try it
Loading the request builder…
GET
https://usages.livepush.io/usage/cdn/hostnames
— This call only reads data.
Parameters
Query parameters
-
fromstring<date>First UTC day to include, asYYYY-MM-DD. Defaults to the start of the current billing term.example: 2026-10-01 -
tillstring<date>Last UTC day to include, asYYYY-MM-DD. Defaults to today.example: 2026-10-15 -
dailybooleanInclude a per-day series on every hostname. Days with no traffic are omitted rather than returned as zero.
Code samples
curl -X GET 'https://usages.livepush.io/usage/cdn/hostnames' \
-H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://usages.livepush.io/usage/cdn/hostnames', {
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/hostnames', headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
Responses
Bandwidth per hostname. Also returned with enabled: false and empty
figures when the account has no CDN delivery configured.
Headers
Cache-ControlstringAlwaysprivate, max-age=60.
-
enabledbooleanfalsewhen the account has no CDN delivery configured. Everything else is then empty ornull; this is a normal200, not an error. -
cpcodeintegerThe account's CDN reporting code.nullwhen delivery is not configured.nullable -
rangeobjectThe UTC days the figures actually cover, after defaults are applied. Both bounds are inclusive.-
fromstring<date>First UTC day included. -
tillstring<date>Last UTC day included. Today's figure is always partial. -
isCurrentTermbooleantruewhen no dates were sent and the range was filled in from the current billing term. Whentruethe totals come from the stored term rows rather than from summing days, which is what the dashboard shows.
-
-
termobjectThe current CDN billing term.nullwhen the account has no activecdnsubscription and no stored term row to fall back on.nullable-
startstring<date-time>Start of the current term. -
endstring<date-time>End of the current term, ornullwhen the term is open-ended or was recovered from a stored usage row rather than from a subscription.nullable
-
-
accountBytesinteger<int64>Sum ofbytesacross every row below, including_other. This is a delivery figure for display, not the billing figure: quota, allowance and overage are reported by the account's subscription, not by this endpoint.nullable -
lastUpdatedstring<date-time>When the collector last wrote any row in this response. The collector runs periodically, so the current day is always partial and this says how stale the figures are.nullable -
hostnamesobject[]Primary hostname first, then the rest by descending bytes, then the_otherbucket last. The_otherrow is always present, even at zero.-
hostnamestringLowercase delivery hostname. The synthetic value_othercarries traffic recorded against hostnames that are no longer configured on the account. -
labelstringDisplay name for the hostname. Falls back to the hostname itself when no label is set. The_otherrow is always labelledUnassigned hostnames. -
isPrimarybooleantruefor the account's primary hostname, which carries every stream that has no hostname of its own plus any traffic still arriving on older links. -
assignmentstringHow this hostname is used. | Value | Meaning | | --- | --- | |dedicated| Exactly one stream delivers on it | |shared| Several streams, or none yet, deliver on it | |pooled| The account's primary hostname | |other| The synthetic_otherbucket |dedicatedsharedpooledother -
streamIdsstring[]Streams assigned to this hostname. Always empty for the primary hostname and for_other, because their traffic cannot be attributed per stream. -
otherHostnamesstring[]Present on the_otherrow only. The hostnames whose rows were folded into it, so you can see what the unattributed traffic was delivered on. -
bytesinteger<int64>Billable bytes for this hostname across the range. -
dailyobject[]Per-day series, present only whendaily=truewas sent. Days with no traffic are omitted rather than returned as zero.2 nested fields
-
datestring<date> -
bytesinteger<int64>Billable bytes recorded for this day.
-
-
{
"enabled": true,
"cpcode": 1234567,
"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"
},
"accountBytes": 5541960000000,
"lastUpdated": "2026-10-15T04:03:20.000Z",
"hostnames": [
{
"hostname": "hls-acme-livepush.akamaized.net",
"label": "Acme Channel",
"isPrimary": false,
"assignment": "dedicated",
"streamIds": [
"st_xxxxxxxxxxxxx"
],
"otherHostnames": [
"hls-retired-livepush.akamaized.net"
],
"bytes": 1234567890,
"daily": [
{
"date": "2026-10-06",
"bytes": 123456789
}
]
}
]
}
invalid_range — a date was not YYYY-MM-DD, from is after till,
or the span is over 400 days. message says which.
-
errorstringStable machine-readable code. -
messagestringHuman-readable detail. Present oninvalid_range, which says exactly which parameter was wrong.
{
"error": "invalid_range",
"message": "range is 500 days; the maximum is 400"
}
Unauthorized