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 use https://developer.dacast.com as the API host. Authenticate with X-Api-Key and send X-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?

NeedEndpoint
Account-wide aggregates (no single asset id)Content Group Data: GET /v2/analytics/{resource_type}/{data_set}
One VOD, channel, or folderIndividual 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

DashboardAPI field
Playshits
Impressionsvisitors
Bandwidth / data usagebytes (raw byte counts)

3. Datasets

Both endpoints use the same data_set values:

data_setWhat you get
bytesperperiodBandwidth over time: bytes, datetime
bytespercontentTotal bytes for the range (often one row - not a full per-asset list on Content Group)
visitorsperperioddatetime, hits, visitors
visitorspercontentPer-asset rows when available (file for VOD, channel for channels, plus hits / visitors)
visitorspercountrycountry_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:

RangeTypical buckets
Up to about 6 daysHourly
About 7–31 daysDaily
Longer multi-month rangesMonthly

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), plus hits and visitors
  • channel → each row has "channel" (id), plus hits and visitors
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:

  1. Create - POST /v2/folder returns id in the body (see Create Folder).
  2. List - GET /v2/folder and read id from each item in data (optional title filter):
curl "https://developer.dacast.com/v2/folder?page=1&per_page=25&title=Conference" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default"
  1. From a VOD - GET /v2/vod/{vodId} and read folders[].id (membership array). Prefer this over folder_ids on the VOD response, which is often null even 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"

See Individual Content Data.


Reference