文档中心 API文档 查询天粒度URL的自定义TOP排行

查询天粒度URL的自定义TOP排行

更新时间:2021-12-13 18:13:12

适用产品

网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案

接口描述

查询天粒度URL的自定义TOP排行

推荐使用 Open API在线调试

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

请求参数

Body 参数

参数名称类型必填描述
dateFrom
String开始时间: 1.时间格式为yyyy-MM-ddTHH:mm:ss+08:00,例如,2019-01-01T10:00:00+08:00(为北京时间2019年01月01日10点0分0秒); 2.不能大于当前时间 3.最多可获取最近三个月(90天)的数据。
dateTo
String结束时间: 1.时间格式2019-01-02T10:00:00+08:00 2.结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间。 3.dateFrom,dateTo二者都未传,默认查询过去的7天;如仅有一个未传,抛异常 4.允许查询最大时间间隔:31天,即dateFrom和dateTo相差不能超过31天(可联系技术支持调整)。
domain
List域名: 可传递域名数量上限默认为100个(可联系技术支持调整)。 自动过滤掉非法域名(如传递非法域名,会被过滤掉,查询结果只返回合法域名的数据) 未传递该入参时,默认查询账号下所有域名,但当账号下域名数量超过上限时提示错误
top
StringTOP个数: 不传默认TOP 100 最大TOP 500
orderBy
String排序: 1. 可选值为:request, flow 2. 不传默认request

返回参数

Body 参数

参数名称类型描述
code
String请求结果状态码
message
String请求结果信息
data
List请求结果的详细数据
top
Stringtop排名
url
Stringurl
totalFlow
String总流量:计量单位MB,保留2位小数
totalRequest
String总请求数

错误码

错误代码(code)描述(message)HTTP状态码语义
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 minute(s).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不符合规范
24102008param: orderBy is null or invalid.400参数orderBy不符合规范
24102008param: topis null or invalid.400参数top不符合规范
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/url/custom-top/daily" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-d '{
    "dateFrom": "2020-10-01T00:00:00+08:00",
    "dateTo": "2020-10-04T00:00:00+08:00",
    "domain": ["bbb.cn","www.abc.com"],
    "orderBy": "request",
    "top": "5"
}'
返回示例
复制代码 复制成功
{
  "code": "0",
  "message": "success",
  "data": [
    {
      "top": "1",
      "url": "https://www.abc.com/api/qwq",
      "totalRequest": "22640850",
      "totalFlow": "10857292.95"
    },
    {
      "top": "2",
      "url": "https://www.abc.com/zh-cn/huhu.html",
      "totalRequest": "5276165",
      "totalFlow": "5668.09"
    },
    {
      "top": "3",
      "url": "https://www.abc.com/api/prices/lalala",
      "totalRequest": "5258196",
      "totalFlow": "4416.89"
    },
    {
      "top": "4",
      "url": "https://www.abc.com/api/users/zzz",
      "totalRequest": "615627",
      "totalFlow": "474.52"
    },
    {
      "top": "5",
      "url": "http://www.abc.com/api/pic/rose",
      "totalRequest": "385654",
      "totalFlow": "157.32"
    }
  ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!