文档中心 API文档 获取账号下多域名的PV统计数

获取账号下多域名的PV统计数

更新时间:2023-04-28 14:31:29

适用产品

全站加速、动态加速、网页加速、点播分发

接口描述

获取账号下多域名的PV统计数

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Body 参数

参数名称类型必填描述
dateFrom
String开始时间: 1.时间格式为yyyy-MM-dd 2.不能大于当前时间 3.最多可获取最近2年内数据
dateTo
String结束时间: 1.时间格式yyyy-MM-dd 2.结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间 3.dateFrom,dateTo二者都未传,默认查询过去的1天;如仅有一个未传,抛异常 4.允许查询最大时间间隔31天:,即dateFrom和dateTo相差不能超过31天。(可联系技术支持调整)
domain
List域名: 1.可传递域名数量上限默认为20个(可联系技术支持调整); 2.自动过滤掉无效域名(如传递非法域名,会被过滤掉,查询结果只返回有效域名的数据)。

返回参数

Body 参数

参数名称类型描述
code
String请求结果状态码
message
String请求结果信息
date
List
domain
String域名
detailList
List
timestamp
String时间,格式为yyyy-MM-dd HH:mm:ss,每一个时间片数据值代表的是前一个时间粒度范围内的数据值,一天开始的时间片是yyyy-MM-dd 01:00:00,最后一个时间片是yyyy-MM-dd 24:00:00。
value
StringPV数

错误码

错误代码(code)描述(message)HTTP状态码语义
24102014This operation requires a body. Ensure that the body is present and the Content-Type header is set.400请求体没有传递
24102013The accept header specified in your request is not acceptable.400Accept请求头不支持,接口仅支持json和xml格式,默认为json格式
24102020The value of X-Time-Zone header specified in your request in invalid.400请求头时区不合法
24102002There was an error in the body of your HTTP request.400请求体格式错误
24102006The date specified is invalid.400dateFrom或dateTo不符合规范或时间区间不合法
24102007You cannot specify a period greater than xx minutes.400dateFrom和dateTo相差超过限制值
24102019The request was rejected because the number of domain(xx) exceeds the limit (xx).400传递的域名个数超过账号限制
24102008param: domain is null or invalid.400参数domain不符合规范
24102500We encountered an internal error. Please try again.500系统发生错误

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/api/report/domain/pv" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
  "dateFrom": "2022-01-04",
  "dateTo": "2022-01-04",
   "domain":["www.test.com"]
}'
返回示例
复制代码 复制成功
{
    "code": "0",
    "message": "success",
    "data": [
        {
            "domain": "www.test.com",
            "detailList": [
                {
                    "timestamp": "2022-01-04 01:00:00",
                    "value": "0"
                },
                {
                    "timestamp": "2022-01-04 02:00:00",
                    "value": "0"
                },
                {
                    "timestamp": "2022-01-04 03:00:00",
                    "value": "0"
                }
            ]
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!