网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
查询特定状态码在指定时间段内TOP20的URL所对应的省份运营商的TOP10访客数
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
dateFrom | String | 是 | 开始时间 1. 格式为yyyy-MM-ddTHH:mm:ss+08:00,例如,2016-12-02T10:00:00+08:00(为北京时间2016年12月2日10点0分0秒) 2. 不能大于当前时间; 3. 最多可获取最近半年(183天)的数据。 |
dateTo | String | 是 | 结束时间 1. 格式为yyyy-MM-ddTHH:mm:ss+08:00; 2. 结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间; 3. 允许查询最大间隔:1天,即dateFrom和dateTo相差不能超过1天(可联系技术支持调整)。 |
domain | List | 是 | 域名,可传递域名数量上限默认为1个(可联系技术支持调整); |
dataInterval | String | 否 | 数据粒度,5m:5分钟粒度 |
statusCode | String | 是 | 错误码,可选值为404、5XX |
参数名称 | 类型 | 描述 |
---|---|---|
result | List | - |
domain | String | 域名 |
details | List | - |
timestamp | String | 时间, 1. 格式为yyyy-MM-dd HH:mm;每一个时间片数据值代表的是前一个时间粒度范围内的数据值。一天开始的时间片是yyyy-MM-dd 00:05,最后一个时间片是(yyyy-MM-dd+1) 00:00; 2. 返回开始时间和结束时间包含的时间片。 |
urlData | List | - |
url | String | url |
visitorData | List | - |
isp | String | 运营商 |
province | String | 省份 |
value | String | 访客数 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
MissingBody | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | 请求体没有传递 |
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
InvalidDatePeriod | The date specified is invalid. | 400 | dateFrom或dateTo不符合规范 |
DateSpanError | You cannot specify a period greater than 1. | 400 | dateFrom和dateTo相差超过1天 |
NumberLimitExceeded | The request was rejected because the number of domain({actual}) exceeds the limit({expect}). | 400 | 传递的域名个数超过账号限制 |
PARAM_INVALID | param: domain is null or invalid. | 400 | 参数domain不符合规范 |
PARAM_INVALID | param: dataInterval is null or invalid. | 400 | 参数dataInterval不符合规范 |
PARAM_INVALID | param: statusCode is null or invalid. | 400 | 参数statusCode不符合规范 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/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/visitor/top-url" \ -X "POST" \ -H "X-Time-Zone:GMT+08:00" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "dateFrom": "2018-09-09T00:00:00+08:00", "dateTo": "2018-09-09T00:10:00+08:00", "domain": [ "www.test.com" ], "statusCode": "404" }'
{ "result": [ { "domain": "www.test.com", "details": [ { "timestamp": "2018-09-09 00:05", "urlData": [ { "url": "http://www.test.com/test25.html", "visitorData": [ { "isp": "其它", "province": "广东", "value": 63 } ] }, { "url": "http://www.test.com/test24.html", "visitorData": [ { "isp": "E家宽", "province": "广东", "value": 61 } ] } ] } ] } ] }