API中心
概览
API-Key Authentication
AK/SK Authentication
应用性能管理
请求数报表
访客IP报表
查询天粒度访客IP的自定义TOP排行
域名管理
域名配置
流量报表
带宽报表
状态码报表
URL报表
其他
边缘应用
CDN Pro
边缘云主机
访问控制
互动直播
流媒体直播
流媒体点播
云直播
低延时直播
云点播
API Shield
Application Shield
Web Application Firewall
Flood Shield
Cloud Security 2.0
Bot Shield
Flood Shield 2.0
动态加速
静态加速
CloudDNS
对象存储
本地存储
证书管理
内容管理
IP查询
云监控
日志下载
其他

查询天粒度访客IP的自定义TOP排行

更新时间:2025-03-26 10:17:16

查询天粒度访客IP的自定义TOP排行

  • 单用户调用频率:300/5min
  • 适用产品:应用性能管理、静态加速、流媒体直播、Flood Shield 2.0、动态加速

请求参数

Body 参数

参数名称描述
dateFromString
开始时间: 时间格式为yyyy-MM-dd,例如,2021-10-10; 不能大于当前时间 最多可获取最近三个月(90天)的数据。
dateToString
结束时间: 时间格式为yyyy-MM-dd 结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间。 dateFrom,dateTo二者都未传,默认查询过去的7天;如仅有一个未传,抛异常 允许查询最大时间间隔:31天,即dateFrom和dateTo相差不能超过31天(可联系技术支持调整)。
domainList
域名: 可传递域名数量上限默认为100个(可联系技术支持调整)。 自动过滤掉非法域名(如传递非法域名,会被过滤掉,查询结果只返回合法域名的数据) 未传递该入参时,默认查询账号下所有域名,但当账号下域名数量超过上限时提示错误
topString
TOP个数: 不传默认TOP 10 最大TOP 100
orderByString
排序: 1、可选值为:request, flow 2、不传默认request

返回参数

Body 参数

参数名称描述
codeString
请求结果状态码
messageString
请求结果信息
dataList
请求结果的详细数据
topString
top排名
ipString
ip
totalFlowString
总流量:计量单位MB,保留2位小数
totalRequestString
总请求数

错误码

错误代码(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: top is 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://api.cdnetworks.com/api/report/visitor/custom-top/daily" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-d '{
  "dateFrom": "2021-10-18",
  "dateTo": "2021-10-22",
  "domain": [
    "www.aaaa.com"
  ],
  "orderBy":"flow",
  "top":100
}'
返回示例
复制代码
{
    "code": "0",
    "message": "success",
    "data": [
        {
            "top": "1",
            "ip": "1.1.1.2",
            "totalRequest": "10000",
            "totalFlow": "1000.00"
        },
        {
            "top": "2",
            "ip": "1.1.1.4",
            "totalRequest": "3000",
            "totalFlow": "500.00"
        },
        {
            "top": "3",
            "ip": "1.1.1.1",
            "totalRequest": "1000",
            "totalFlow": "100.00"
        },
        {
            "top": "4",
            "ip": "1.1.1.3",
            "totalRequest": "900",
            "totalFlow": "800.00"
        }
    ]
}

目录

  • 请求参数
  • 返回参数
  • 错误码
  • 示例
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!