查詢直播流量
更新時間 2024-06-24 15:43:00
最近更新時間: 2024-06-24 15:43:00
分享文章
接口功能介紹
支持按照協議、運營商、省份、流名等不同維度查詢直播帶寬。
使用說明
單個用戶一分鐘限制調用10000次,并發不超過100。
可查詢歷史數據時間范圍為最近14天。
單次可查詢的時間跨度為3小時,時間延時為5分鐘。
單次查詢輸入域名的個數不能超過100個。
最大返回記錄50000條記錄。
該接口查詢的數據不作為計費依據。
接口詳情
請求方式:post
請求路徑:/live/statistics/query-flux-data
請求參數
| 參數名 | 類型 | 名稱 | 是否必填 | 說明 |
|---|---|---|---|---|
| start_time | long | 開始時間戳 | 是 | 起始時間,時間戳(秒)。不傳或者傳小于等于0是默認取當前時間-3分鐘 |
| end_time | long | 結束時間戳 | 是 | 結束時間,時間戳(秒)。不傳或者傳小于等于0默認取start_time + 1分鐘 |
| interval | string | 時間粒度 | 否 | 時間粒度,目前限制1m,不傳默認1m |
| domain | list | 域名列表 | 否 | 域名,不傳默認名下所有域名,可多個域名,且域名的個數不超過100個。 |
| app | list | 應用名列表 | 否 | 應用名,默認名下所有應用名,可多個應用名 |
| stream | list | 流名列表 | 否 | 流名,默認名下所有流名,可多個流名 |
| province | list | 省編碼列表 | 否 | 省編碼列表,不傳默認所有省份,點擊查看省份及對應的省編碼。 |
| isp | list | 運營商編碼列表 | 否 | 運營商編碼,不傳默認所有運營商,可多個運營商編碼作為統計篩選項,點擊查看運營商及對應的運營商編碼。 |
| protocol | list | 應用層協議列表 | 否 | 應用層協議,不傳默認所有絡層協議,支持作為統計篩選項,可以為rtmp、http、https。 |
| live_type | list | 直播協議類型列表 | 否 | 播放協議,支持rtmp,flv,hls,other,不傳默認所有播放協議,作為統計過濾項。 |
| group_by | list | 聚合維度 | 否 | 該指標統計結果的聚合維度,支持在時間顆粒度外疊加多種聚合維度。目前支持domain,app,province,isp,stream,province,isp,protocol,live_type。不傳默認統計結果按時間顆粒維度聚合。 |
響應參數
| 參數名 | 類型 | 說明 |
|---|---|---|
| code | int | 狀態碼 |
| message | string | 描述信息 |
| start_time | int | 開始時間戳 |
| end_time | int | 結束時間戳 |
| interval | string | 時間粒度 |
| req_flux_data_interval | list | 每個時間間隔的在線人數 |
| req_flux_data_interval[*].time_stamp | int | 時間片開始時間戳 |
| req_flux_data_interval[*].domain | string | 域名 |
| req_flux_data_interval[*].app | string | 應用名 |
| req_flux_data_interval[*].stream | string | 流名 |
| req_flux_data_interval[*].province | int | 省編碼 |
| req_flux_data_interval[*].isp | string | 運營商編碼 |
| req_flux_data_interval[*].protocol | string | 應用層協議 |
| req_flux_data_interval[*].live_type | string | 播放協議 |
| req_flux_data_interval[*].flux | long | 流量,單位為字節 |
示例
請求路徑://cdnapi-global.ctapi.daliqc.cn/live/statistics/query-flux-data
請求示例
{
"start_time": 1669257052,
"end_time": 1669264252,
"domain": ["daliqc.cn"],
"group_by": ["domain","protocol"]
}
正確響應示例
{
"start_time": 1669257052,
"code": 100000,
"req_flux_data_interval": [
{
"protocol": "https",
"time_stamp": 1669257960,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "rtmp",
"time_stamp": 1669257960,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "http",
"time_stamp": 1669257960,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "https",
"time_stamp": 1669258140,
"domain": "daliqc.cn",
"flux": 3980210
},
{
"protocol": "rtmp",
"time_stamp": 1669258140,
"domain": "daliqc.cn",
"flux": 3956797
},
{
"protocol": "http",
"time_stamp": 1669258140,
"domain": "daliqc.cn",
"flux": 3652428
},
{
"protocol": "rtmp",
"time_stamp": 1669258320,
"domain": "daliqc.cn",
"flux": 2083757
},
{
"protocol": "https",
"time_stamp": 1669258320,
"domain": "daliqc.cn",
"flux": 2247648
},
{
"protocol": "http",
"time_stamp": 1669258320,
"domain": "daliqc.cn",
"flux": 2060344
},
{
"protocol": "https",
"time_stamp": 1669258500,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "http",
"time_stamp": 1669258500,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "rtmp",
"time_stamp": 1669258500,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "https",
"time_stamp": 1669258680,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "http",
"time_stamp": 1669258680,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "rtmp",
"time_stamp": 1669258680,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "http",
"time_stamp": 1669258860,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "rtmp",
"time_stamp": 1669258860,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "https",
"time_stamp": 1669258860,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "http",
"time_stamp": 1669260660,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "rtmp",
"time_stamp": 1669260660,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "https",
"time_stamp": 1669260660,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "https",
"time_stamp": 1669262460,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "http",
"time_stamp": 1669262460,
"domain": "daliqc.cn",
"flux": 1685736
},
{
"protocol": "rtmp",
"time_stamp": 1669262460,
"domain": "daliqc.cn",
"flux": 1685736
}
],
"end_time": 1669264252,
"interval": "1m",
"message": "success"
}
錯誤碼請參考:參數code和message含義