Batch Query Video Analysis
Updated: 2025-03-12 17:14:55
API Description
1、分页查询所有已发布视频的视频分析数据
2、接口支持https协议
API URL
https://api.polyv.net/v3/advance/video/list
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
- For advanced analysis features, see: Video Advanced Analysis
- Due to large data volume and computation, analysis results are only available the next day
- The batch query API can only query video data with a status of Published
Request Parameter Description
Example
https://api.polyv.net/v3/advance/video/list?timestamp=1682498437763&appId=gf24khyndx&page=1&pageSize=10&sign=4C62E7E1FDBD500C032A2E047B8C6A43
Response Parameter Description
data Field Description
contents Field Description
error Field Description
Java Request Example
For quick integration of the base code, download the relevant dependency source code. Click to download source code. After downloading, add it to your project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 批量查询视频分析
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void getVideoAdvanceTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;//注意此处为appId
String appSecret = super.appSecret;//注意此处为appSecret,非secretKey
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/v3/advance/video/list";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("page", "1");
requestMap.put("pageSize", "1");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试批量查询视频分析成功:{}", response);
//do somethings
}
Response Example
Success Example
{
"requestId": "40d2ab85-73a4-4266-bcc6-8e828d8c9a9b",
"code": 200,
"status": "success",
"error": null,
"data": {
"pageNumber": 1,
"totalPages": 1,
"pageSize": 10,
"totalItems": 3,
"contents": [
{
"videoId": "833584471db2eb2b9d0b582e7e755c66_8",
"videoName": "导出18-平台设置",
"duration": 145,
"playTimes": 6,
"uniqueViewerCount": 1,
"avgCompletionRate": 0.03,
"viewHeatmap": "[\"0-1:6\",\"2-2:4\",\"3-5:2\",\"6-15:1\"]",
"uniqueViewHeatmap": "[\"0-15:1\"]"
},
{
"videoId": "833584471d0ed109bb261b104f584896_8",
"videoName": "导出17-数据统计",
"duration": 129,
"playTimes": 1,
"uniqueViewerCount": 1,
"avgCompletionRate": 0.2,
"viewHeatmap": "[\"0-26:1\"]",
"uniqueViewHeatmap": "[\"0-26:1\"]"
},
{
"videoId": "833584471d80e5c1752460d2a07bd51c_8",
"videoName": "导出16-默认模板",
"duration": null,
"playTimes": null,
"uniqueViewerCount": null,
"avgCompletionRate": null,
"viewHeatmap": null,
"uniqueViewHeatmap": null
}
]
}
}
Error Example
{
"requestId": "492834b6-c1c6-4c5e-8609-ddc1f96da1e4",
"code": 500,
"status": "error",
"error": {
"code": 9,
"desc": "undefined error"
},
"data": null
}
{
"requestId": "edcc2674-bf46-4db1-991c-0f7feab94200",
"code": 400,
"status": "error",
"error": {
"code": 4013,
"desc": "vid illegal"
},
"data": null
}