簡介
的播放指標 Live 由 Brightcove公司 Live 服務可以通過以下方式實時獲得 Analytics API。 捕獲此數據用於 live 流 只要; 不包括VOD播放。
API提供 Live 通過兩個端點流指標:
/v1/timeseries
/v1/events
兩者都查詢相同的數據集,但匯總結果不同。 本文檔介紹了它們的用法和語法。
指標
這些是通過 Live 端點。 查詢可能請求多個指標。
公制 | 產品描述 |
---|---|
alive_ss_ad_start |
服務器端廣告展示次數 |
ccu |
獨特 會議; 不重複計數指紋 + 會議) |
fingerprint_count |
獨特 設備; 數量不同 指紋 (見下文) |
video_impression |
視頻加載到的次數 player |
video_seconds_viewed |
所有觀眾觀看的總秒數 |
video_view |
流開始(非唯一) |
為 獨特 跟踪,我們分配一個 指紋 通過組合(Remote IP
+ User-Agent
+ Player
)。 請注意,我們不使用設備本身的實際硬件ID,這會降低準確性,但會保持我們的隱私合規性。
尺寸
支持以下組合 dimensions
以及 where
過濾鍵:
video
video, country
video, device_type
查詢參數
多模 Live 端點共享一些公共參數,這些參數控制查詢的範圍和分組。
參數 | 句法 | 需要的 | 預設產品 | 產品描述 |
---|---|---|---|---|
外形尺寸 | <dim1>,<dim2>,... |
Y | - | 查詢維度(GROUP BY) |
度量 | <metric1>,<metric2>,... |
Y | - | 一個或多個要報告的指標 |
哪裡 | <dim1>=<value1>;... |
Y | - | 一個或多個查詢過濾器; 必須包含至少1個視頻 |
低至 | <epoch> |
N | 從“到”值開始32天 | 時間範圍開始 |
至 | <epoch> |
N | 現在 | 時間範圍結束 |
時間序列
/v1/timeseries
端點沿時間軸返回一個點列表,其中包含每個時間點所請求度量的值。 點是 1分鐘 存儲桶是默認設置,但可以通過參數進行更改。
在這種情況下,唯一指標(ccu
, fingerprint_count
)指出 最大值 在每個時段中的任何時候。 所以一個查詢 bucket_duration=1d
將返回每天的最大並發量,而帶有 bucket_limit=1
將在流中的任何點返回最大並發性。
的URI
/v1/timeseries/accounts/$account
附加參數
參數 | 句法 | 需要的 | 預設產品 | 產品描述 |
---|---|---|---|---|
bucket_duration | <n>m (分鐘)<n>h (小時)<n>d (天) |
N | 1m | 每個點代表的持續時間。 1d 是24小時,而不是日曆日。 |
bucket_limit | <n> |
N | - | 返回點數。 使用任一 bucket_duration or bucket_limit ,但不能同時使用。 |
響應
{
"<metric1>": {
"data": [
{
"dimensions": {
"account": "<account>",
"<dim1>": "<key1>",
...
"<dimN>": "<keyN>"
},
"points": [
{
"timestamp": <bucket1>,
"value": <value1>
},
...,
{
"timestamp": <bucketN>,
"value": <valueN>
},
]
}
]
},
"<metric2>": {
...
},
...
}
活動
/v1/events
端點返回全部或部分指標的指標總計 Live 視頻流。
在這種情況下,唯一指標(ccu
, fingerprint_count
)代表 總價值 在查詢範圍內。 例如,沒有 from
/to
參數將返回的總數 獨特 整個流的會話(ccu)和/或設備(fingerprint_count)。
的URI
/v1/events/accounts/$account
附加參數
沒有
響應
{
"data": [
{
"dimensions": {
"account": "<account>",
"<dim1>": "<key1>",
...
"<dimN>": "<keyN>"
},
"totals": {
"<metric1>": <value1>,
...
"<metricN>": <valueN>
}
}
]
}
出口
事件端點還提供了可下載的報告:
/v1/events/accounts/$account/videos/$video/export?format=xlsx
回應是 XLSX 文件 Live 4張紙上的指標:
- 總結
- 並髮用戶
- 按設備類型查看
- 地理觀點
使用範例
對於所有這些示例,我們將使用 帳戶1234, 視頻5555,並假設當前時間為 UTC下午12:00:00 on 15年2020月XNUMX日.
獲取當前的觀看者計數(CCU) Live 流或頻道
在你的生活中 低至 到至少2分鐘前(11:58 AM),並使用最後一個 點 在回應中。
/v1/timeseries/accounts/1234?dimensions=video&metrics=ccu&where=video==5555&from=1581767880000
獲取CCU圖形點 Live 過去24小時內的視頻流
放大(1分鐘)
/v1/timeseries/accounts/1234?dimensions=video&metrics=ccu&where=video==5555&from=1581681600000&bucket_duration=1m
縮小(1小時點)
/v1/timeseries/accounts/1234?dimensions=video&metrics=ccu&where=video==5555&from=1581681600000&bucket_duration=1h
每天獲得最高CCU Live 過去7天的頻道
/v1/timeseries/accounts/1234?dimensions=video&metrics=ccu&where=video==5555&from=1581206400000&bucket_duration=7d
在任何情況下,任何時候均可獲得最高CCU Live 流
/v1/timeseries/accounts/1234?dimensions=video&metrics=ccu&where=video==5555&bucket_limit=1
獲取多個的唯一觀看者總數和觀看秒數 Live 流
視頻5555已完成; 數字是最終的。 視頻5556仍處於活動狀態; 數字是運行總數。
/v1/events/accounts/1234?dimensions=video&metrics=fingerprint_count,video_seconds_viewed&where=video==5555,5556
在電視上獲取一個小時的節目的觀看次數和廣告總計 Live 渠道
節目播出時間為10:00 AM至11:00 AM(UTC)
/v1/events/accounts/1234?dimensions=video&metrics=alive_ss_ad_start,video_view,fingerprint_count&where=video==5555&from=1581760800000&to=1581764399999
在某段時間內按國家/地區獲取觀看次數 Live 流
/v1/events/accounts/1234?dimensions=video,country&metrics=video_view,fingerprint_count&where=video==5555