网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
查询多域名的5分钟粒度http和https状态码
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
dateFrom | String | 否 | 开始时间: 1.时间格式为yyyy-MM-ddTHH:mm:ss+08:00,例如,2021-05-19T10:00:00+08:00(为北京时间2021年5月19日10点0分0秒) 2.不能大于当前时间 3.最多可获取最近半年(183天)的数据 |
dateTo | String | 否 | 结束时间: 1.时间格式yyyy-MM-ddTHH:mm:ss+08:00 2.结束时间需大于开始时间,结束时间如果大于当前时间,取当前时间 3.dateFrom,dateTo二者都未传,默认查询过去的1小时;如仅有一个未传,抛异常 4.允许查询最大时间间隔:1天,即dateFrom和dateTo相差不能超过1天。(可联系技术支持调整) |
domain | List | 否 | 域名: 1、可传递域名数量上限默认为20个(可联系技术支持调整); 2、自动过滤掉无效域名(如传递非法域名,会被过滤掉,查询结果只返回有效域名的数据)。 |
groupBy | List | 否 | 可选值:domain 不传默认聚合所有频道数据 |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 请求结果状态码 |
message | String | 请求结果信息 |
data | List | |
domain | String | 域名,聚合全部域名数据不返回该字段 |
statusCodeDataList | List | |
statusCode | String | 状态码 |
detailList | List | |
timestamp | String | 时间片,返回开始时间和结束时间包含的时间片。 时间格式: 5分钟:yyyy-MM-dd HH:mm |
httpsValue | String | https数据 |
httpValue | String | http数据 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
24102013 | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json和xml格式,默认为json格式 |
24102002 | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
24102006 | The date specified is invalid. | 400 | dateFrom或dateTo不符合规范或时间区间不合法 |
24102007 | You cannot specify a period greater than xx minutes. | 400 | dateFrom和dateTo相差超过限制值 |
24102021 | Date format error. | 400 | 日期格式错误 |
24102019 | The request was rejected because the number of domain(xx) exceeds the limit (xx). | 400 | 传递的域名个数超过账号限制 |
24102008 | param: domain is null or invalid. | 400 | 参数domain不符合规范 |
24102008 | param: groupBy is null or invalid. | 400 | 参数groupBy不符合规范 |
24102019 | The request was rejected because the number of domain(xx) exceeds the limit (xx) | 400 | 域名个数超过限制 |
24102500 | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/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/status-code/protocol-version" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "dateFrom": "2021-05-19T10:00:00+08:00", "dateTo": "2021-05-19T12:00:00+08:00", "domain": [ "img.abc.com", "www.2222.com" ], "groupBy": [ "domain" ] }'
{ "code": "0", "message": "success", "data": [ { "domain": "img.abc.com", "statusCodeDataList": [ { "statusCode": "0", "detailList": [ { "timestamp": "2021-08-15 16:05", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:10", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:15", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:20", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:25", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:30", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:35", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:40", "httpsValue": "0" }, { "timestamp": "2021-08-15 16:45", "httpsValue": "0" } ] }, { "statusCode": "200", "detailList": [ { "timestamp": "2021-08-15 16:05", "httpsValue": "7012673945", "httpValue": "242350900" }, { "timestamp": "2021-08-15 16:10", "httpsValue": "6539871460" }, { "timestamp": "2021-08-15 16:15", "httpsValue": "6281694351", "httpValue": "80808041" }, { "timestamp": "2021-08-15 16:20", "httpsValue": "5975328386", "httpValue": "73423513" }, { "timestamp": "2021-08-15 16:25", "httpsValue": "5708792684", "httpValue": "9213242" }, { "timestamp": "2021-08-15 16:30", "httpsValue": "5342970210" }, { "timestamp": "2021-08-15 16:35", "httpsValue": "5067292447", "httpValue": "82344121" }, { "timestamp": "2021-08-15 16:40", "httpsValue": "4772716999", "httpValue": "9020800" }, { "timestamp": "2021-08-15 16:45", "httpsValue": "452244" } ] }, { "statusCode": "299", "detailList": [ { "timestamp": "2021-08-15 16:30", "httpValue": "29427971" } ] }, { "statusCode": "302", "detailList": [ { "timestamp": "2021-08-15 16:05", "httpsValue": "52629232" }, { "timestamp": "2021-08-15 16:10", "httpsValue": "2250823" }, { "timestamp": "2021-08-15 16:15", "httpsValue": "13537912" }, { "timestamp": "2021-08-15 16:20", "httpsValue": "180064" }, { "timestamp": "2021-08-15 16:25", "httpsValue": "142330" }, { "timestamp": "2021-08-15 16:30", "httpsValue": "85067" }, { "timestamp": "2021-08-15 16:35", "httpsValue": "118829" }, { "timestamp": "2021-08-15 16:40", "httpsValue": "115850" }, { "timestamp": "2021-08-15 16:45", "httpsValue": "174106" } ] }, { "statusCode": "403", "detailList": [ { "timestamp": "2021-08-15 16:05", "httpValue": "3017112" }, { "timestamp": "2021-08-15 16:10", "httpValue": "3017021" }, { "timestamp": "2021-08-15 16:15", "httpValue": "2368224" }, { "timestamp": "2021-08-15 16:20", "httpsValue": "45381", "httpValue": "32300" }, { "timestamp": "2021-08-15 16:25", "httpValue": "19410" }, { "timestamp": "2021-08-15 16:30", "httpValue": "38795" }, { "timestamp": "2021-08-15 16:35", "httpValue": "21575" }, { "timestamp": "2021-08-15 16:40", "httpValue": "25814" }, { "timestamp": "2021-08-15 16:45", "httpValue": "12946" } ] } ] } ] }