https://api.polyv.net/live/v3/channel/statistics/browsers-summary
1、接口用于获取多个频道下(聚合查询结果)的终端分布信息
2、接口支持https
{
"code": 200,
"status": "success",
"message": "",
"data": [{
"browser": "Chrome 浏览器",
"count": 69,
"platform": "pc",
"percent": 98.57
},
{
"browser": "IE 11.0 浏览器",
"count": 1,
"platform": "pc",
"percent": 1.43
}]
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
{
"code": 403,
"status": "error",
"message": "illegal channel id: 1234567",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "param is not digit: dsadasd",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "startDate can not great endDater",
"data": ""
}
public static void main(String[] args) {
String url = "http://api.polyv.net/live/v3/channel/statistics/browsers-summary;
// 用户对应的appId和加密串
String appId = "xxxxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
Map<String, String> params = new HashMap<>();
int channelId = 1234567;
String startDate = "2020-08-01";
String endDate = "2020-08-18";
params.put("channelId", String.valueOf(channelId));
params.put("startDate", startDate);
params.put("endDate", endDate);
PolyvTool.setLiveSign(params, appId, appSecret);
// 调用Polyv的httpClient工具类发送请求
String content = HttpClientUtil.getInstance()
.sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(content);
}