查询小时粒度URL的TOP排行

更新时间:2022-12-28 11:19:17

适用产品

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

接口描述

查询url的top请求或流量排行,仅支持查询top 500

推荐使用 Open API在线调试

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

请求参数

Body 参数

参数名称描述
dateFromString
开始时间: 1.时间格式为yyyy-MM-ddTHH:mm:ss+08:00,例如,2016-12-02T10:00:00+08:00(为北京时间2016年12月2日10点0分0秒); 2.不能大于当前时间 3.最多可获取最近半年(183天)的数据。
dateToString
结束时间: 1.时间格式yyyy-MM-ddTHH:mm:ss+08:00 2.结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间。 3.dateFrom,dateTo二者都未传,默认查询当天;如仅有一个未传,抛异常 4.允许查询最大时间间隔:31天,即dateFrom和dateTo相差不能超过31天。(可联系技术支持调整)
domainList
域名: 1.可传递域名数量上限默认为500个; 2.自动过滤掉无效域名(如传递非法域名,会被过滤,查询结果只返回有效域名的数据)。 3.未传递该入参时,默认查询账号下所有域名,但当账号下域名数量超过上限时提示错误
orderByString
排序: 1.可选值为:totalRequest、totalFlow 2.不传则默认取值 totalRequest

返回参数

Body 参数

参数名称描述
topString
top排名
urlString
url
totalFlowString
总流量:计量单位MB,保留2位小数
totalRequestString
总请求数
hitRequestString
请求数hit值
missRequestString
请求数miss值
sc200String
状态码200的请求数
sc206String
状态码206的请求数
sc302String
状态码302的请求数
sc304String
状态码304的请求数
sc404String
状态码404的请求数

错误码

错误代码(code)描述(message)HTTP状态码语义
NotAcceptableThe   accept header specified in your request is not acceptable.400Accept请求头不支持,接口仅支持json和xml格式,默认为json格式
InvalidHTTPRequestThere   was an error in the body of your HTTP request.400 请求体格式错误
InternalErrorWe   encountered an internal error. Please try again.500 系统发生错误
InvalidDatePeriodThe date specified is invalid.400 日期不符合
PARAM_INVALIDparam: domain is null or invalid400 domain值为空
NumberLimitExceededThe request was rejected because the number of domain(6) exceeds the limit (5).400 输入的domain超过数据字典配置个数
DateSpanErrorYou cannot specify a period greater than 31 day(s).400输入的时间超过数据字典配置数
PARAM_INVALIDparam: orderBy is null or invalid.400输入的orderBy参数为空或参数不正确

示例

JSON
XML
JSON
请求示例
复制代码 复制成功
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
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/top" \
-X "POST" \
-H "X-Time-Zone:GMT+08:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{"dateFrom": "2019-01-01T10:00:00+08:00","dateTo": "2019-01-02T10:00:00+08:00","domain": ["www.aaa.com","www.bbb.com"],"orderBy": "totalRequest"
 }'
返回示例
复制代码 复制成功
{
   "result":[
                    {
                        "top":"1",
                        "url":"http://www.aaa.com/ccdrg13.image",
                        "totalRequest":"37947",
                        "totalFlow":"954624377.23",
                        "hitRequest":"35269",
                        "missRequest":"2678",
                        "sc200":"21331",
                        "sc206":"1",
                        "sc302":"0",
                        "sc304":"146",
                        "sc404":"0"
                    },
                    {
                        "top":"2",
                        "url":"http://www.aaa.com/css/common.jpg",
                        "totalRequest":"12506",
                        "totalFlow":"93871265",
                        "hitRequest":"11766",
                        "missRequest":"740",
                        "sc200":"34553",
                        "sc206":"13",
                        "sc302":"2",
                        "sc304":"0",
                        "sc404":"3"
                    },
                    {
                        "top":"100",
                        "url":"http://www.bbb.com/css/style.css",
                        "totalRequest":"2765",
                        "totalFlow":"12721647",
                        "hitRequest":"2467",
                        "missRequest":"298",
                        "sc200":"443241",
                        "sc206":"7",
                        "sc302":"0",
                        "sc304":"0",
                        "sc404":"0"
                    }
            ]
 }
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!