Analytics
Account-wide and per-asset analytics: datasets, dates, Content Group vs Individual.
Analytics with the Dacast API
Pull bandwidth, plays, and audience metrics for your account or for a single VOD, live channel, or folder.
All examples usehttps://developer.dacast.comas the API host. Authenticate withX-Api-Keyand sendX-Format: default. Successful calls return 200 and a JSON array.
resource_type in the path must be singular: vod, channel, or folder. Plural forms return 400 Invalid content type.
1. Which endpoint?
| Need | Endpoint |
|---|---|
| Account-wide aggregates (no single asset id) | Content Group Data: GET /v2/analytics/{resource_type}/{data_set} |
| One VOD, channel, or folder | Individual Content Data: GET /v2/analytics/{resource_type}/{id}/{data_set} |
For VOD and channel, {id} is a UUID (from List Videos / Lookup Video, or list/lookup channel). Folder ids are numeric strings (for example "1259852") - see how to get a folder id below.
2. Metrics
| Dashboard | API field |
|---|---|
| Plays | hits |
| Impressions | visitors |
| Bandwidth / data usage | bytes (raw byte counts) |
3. Datasets
Both endpoints use the same data_set values:
data_set | What you get |
|---|---|
bytesperperiod | Bandwidth over time: bytes, datetime |
bytespercontent | Total bytes for the range (often one row - not a full per-asset list on Content Group) |
visitorsperperiod | datetime, hits, visitors |
visitorspercontent | Per-asset rows when available (file for VOD, channel for channels, plus hits / visitors) |
visitorspercountry | country_name, hits, visitors |
4. Dates and buckets
Prefer YYYY-MM-DD for startdate and enddate. Datetime values such as YYYY-MM-DDTHH:MM:SS are also accepted.
For Individual analytics with daily buckets, a date-only enddate can exclude that calendar day. To include plays on day D, set enddate to D+1, or pass a datetime on day D (for example 2026-08-21T23:59:59).
For *perperiod datasets, bucket size depends on the requested range:
| Range | Typical buckets |
|---|---|
| Up to about 6 days | Hourly |
| About 7–31 days | Daily |
| Longer multi-month ranges | Monthly |
bytesperperiod and visitorsperperiod may use different thresholds for the same dates. Use the datetime values in the response to see which bucket size you received. More edge cases: Content Group Data and Individual Content Data.
5. Content Group (account-wide)
Bandwidth over a week
curl -X GET "https://developer.dacast.com/v2/analytics/vod/bytesperperiod?startdate=2026-08-01&enddate=2026-08-07" \
-H "X-Api-Key: insertYourApiKeyHere" \
-H "X-Format: default"[
{
"bytes": 2028780233,
"datetime": "2026-08-01 00:00:00"
},
{
"bytes": 1973438647,
"datetime": "2026-08-02 00:00:00"
},
{
"bytes": 1991626506,
"datetime": "2026-08-03 00:00:00"
}
]Visitors per content (VOD vs channel)
For visitorspercontent, the row shape depends on resource_type:
vod→ each row has"file"(title or id), plushitsandvisitorschannel→ each row has"channel"(id), plushitsandvisitors
curl -X GET "https://developer.dacast.com/v2/analytics/vod/visitorspercontent?startdate=2026-08-01&enddate=2026-08-07" \
-H "X-Api-Key: insertYourApiKeyHere" \
-H "X-Format: default"[
{
"file": "Episode 1",
"hits": 2,
"visitors": 1
},
{
"file": "Episode 2",
"hits": 1,
"visitors": 0
}
]curl -X GET "https://developer.dacast.com/v2/analytics/channel/visitorspercontent?startdate=2026-08-01&enddate=2026-08-07" \
-H "X-Api-Key: insertYourApiKeyHere" \
-H "X-Format: default"[
{
"channel": "live-61812c52-191f-483e-8e49-3027ed84fea6",
"hits": 1,
"visitors": 0
},
{
"channel": "live-e3239795-6657-41bc-ac35-88cfa205c854",
"hits": 1,
"visitors": 1
}
]For bytesperperiod, bytespercontent, visitorsperperiod, and visitorspercountry, Content Group responses use the same account-wide totals whether you pass vod, channel, or folder in the path.
See Content Group Data.
6. Individual content
One VOD over time
curl -X GET "https://developer.dacast.com/v2/analytics/vod/{id}/visitorsperperiod?startdate=2026-08-01&enddate=2026-08-22" \
-H "X-Api-Key: insertYourApiKeyHere" \
-H "X-Format: default"const id = '28cfe183-675c-4aa5-95d6-3cf5260d92c6';
const qs = new URLSearchParams({
startdate: '2026-08-01',
enddate: '2026-08-22'
});
fetch('https://developer.dacast.com/v2/analytics/vod/' + id + '/visitorsperperiod?' + qs, {
headers: {
'X-Api-Key': 'insertYourApiKeyHere',
'X-Format': 'default'
}
})
.then((response) => response.json())
.then((rows) => {
// rows: [{ datetime, hits, visitors }, ...]
});Dashboard Plays map to hits; Impressions map to visitors.
An unknown id, a mismatched resource_type, or a period with no data returns 200 with [] (not 404).
How to get a folder id
Folder ids are numeric strings, not UUIDs. Ways to obtain one:
- Create -
POST /v2/folderreturnsidin the body (see Create Folder). - List -
GET /v2/folderand readidfrom each item indata(optionaltitlefilter):
curl "https://developer.dacast.com/v2/folder?page=1&per_page=25&title=Conference" \
-H "X-Api-Key: insertYourApiKeyHere" \
-H "X-Format: default"- From a VOD -
GET /v2/vod/{vodId}and readfolders[].id(membership array). Prefer this overfolder_idson the VOD response, which is oftennulleven when the asset is in a folder.
Full create / list / lookup flow: Folders.
Folder totals (sum of members)
For resource_type=folder, totals are the sum of analytics for assets that belong to that folder (bytes, hits, and visitors over the same date range). bytespercontent / visitorspercontent return a single aggregate row, not a per-video breakdown.
curl -X GET "https://developer.dacast.com/v2/analytics/folder/{folderId}/bytesperperiod?startdate=2026-02-21&enddate=2026-08-22" \
-H "X-Api-Key: insertYourApiKeyHere" \
-H "X-Format: default"Reference
- Content Group Data
- Individual Content Data
- Folders - create, list, lookup, and VOD membership
- List Folders / Lookup Folder
Updated about 4 hours ago
