CDN加速

文档中心 API文档 获取Bot请求趋势

获取Bot请求趋势

更新时间:2022-09-02 16:58:36

适用产品

BotGuard爬虫管理

接口描述

获取域名的Bot请求趋势

推荐使用 Open API在线调试

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

请求参数

Body 参数

参数名称类型必填描述
domain
String域名串,分号拼接
startTime
String开始时间,格式: yyyy-MM-dd HH:mm:ss
endTime
String结束时间,格式: yyyy-MM-dd HH:mm:ss
timeZone
Integer时区,默认8,即“GTM+8”。
lang
String语言:cn/en; 默认cn

返回参数

Body 参数

参数名称类型描述
code
String状态码,成功为“200”
message
String返回信息,成功为“Success”
data
GetRequestTrendsAndTriggerRulesDataResponseData返回数据
requestTrend
List请求趋势
time
String请求时间
detail
List趋势详情
name
String总请求数/已知类型BOT/未知类型BOT
value
Long请求数
triggerRule
List触发规则
time
String请求时间
detail
List触发规则详情
name
String规则名
value
Long请求数

错误码

错误代码(code)描述(message)HTTP状态码语义
22994001CUSTOMER_NOT_EXIST200客户不存在
22994000PARAM_ERROR_CODE 200查询参数错误
22995000INTERNAL_ERROR_CODE 200系统错误

示例

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/bot/report/trend-rule \
-X "POST"  \
-u "$username:$password"  \
-H "Date: $date"   \
-H "Accept: application/json"  \
-d {
        "domain":"example1.xxx.xxx;example2.xxx.xxx;example3.xxx.xxx;",
        "startTime":"2022-01-01 00:00:00",
        "endTime":"2022-01-01 23:59:59",
        "lang":"en",
}
返回示例
复制代码 复制成功
{
  "code" : 200,
  "message" : "",
  "data" : {
    "requestTrend" : [ {
      "time" : "2022-01-01 23:05:00",
      "detail" : [ {
        "name" : "Total Requests",
        "value" : 0
      }, {
        "name" : "Known Bots",
        "value" : 0
      }, {
        "name" : "Unknown Bots",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:10:00",
      "detail" : [ {
        "name" : "Total Requests",
        "value" : 0
      }, {
        "name" : "Known Bots",
        "value" : 0
      }, {
        "name" : "Unknown Bots",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:15:00",
      "detail" : [ {
        "name" : "Total Requests",
        "value" : 0
      }, {
        "name" : "Known Bots",
        "value" : 0
      }, {
        "name" : "Unknown Bots",
        "value" : 0
      } ]
    }], 
   "triggerRule" : [ {
      "time" : "2022-01-01 23:05:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:10:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:15:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:20:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:25:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:30:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:35:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:40:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }, {
      "time" : "2022-01-01 23:45:00",
      "detail" : [ {
        "name" : "Rule1",
        "value" : 0
      } ]
    }]
本篇文档内容对您是否有帮助?
有帮助
没帮助
提交成功!非常感谢您的反馈,我们会继续努力做到更好!