










import com.baidubce.http.ApiExplorerClient; import com.baidubce.http.AppSigner; import com.baidubce.http.HttpMethodName; import com.baidubce.model.ApiExplorerRequest; import com.baidubce.model.ApiExplorerResponse; // 人流量统计-静态版 Java示例代码 public class RequestDemo { public static void main(String[] args) { String path = "https://jmrlltjjtb.api.bdymkt.com/rlltjjtb/traffic/statistics"; ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path); request.setCredentials("您的 access key", "您的 secret key"); request.addHeaderParameter("Content-Type", "application/x-www-form-urlencoded"); ApiExplorerClient client = new ApiExplorerClient(new AppSigner()); try { ApiExplorerResponse response = client.sendRequest(request); // 返回结果格式为Json字符串 System.out.println(response.getResult()); } catch (Exception e) { e.printStackTrace(); } } }点击复制代码
{
"code": 200,// 返回码,详见返回码说明
"msg": "成功",// 返回码对应描述
"taskNo": "803818906150348309912540",// 本次请求号
"data": {
"areaCounts": [ //每一个区域框中人数,仅当area参数有效时才会返回,否则该字段不返回。
1,
5,
8
],
"personNum":"1", //识别出的人体数目;若多个区域之间有重合,则是所有区域的并集人体数目。
"image":"/aj/4MHo...FS2P/9=" //渲染后的图片base64字符串,不包含图片头
}
}
{
"msg": "照片格式不正确",
"code": 400
}
1,官方直连,权威校验;2,全实时优质接口,不参缓存,品质保证;3,多通道冗余切换,稳定可靠
