Bot Shield

获取域名Bot访问量详情

更新时间:2023-02-03 10:30:45

统计域名的总请求次数、Bot请求数、缓解Bot攻击数及Top5 Bot类型的请求次数

  • 单用户调用频率:300/5min
  • 适用产品:Bot Shield
API鉴权说明详见:API鉴权概览

请求参数

Body 参数

参数名称描述
*domainString
域名串,分号拼接
*startTimeString
开始时间。格式: yyyy-MM-dd HH:mm:ss
*endTimeString
结束时间。格式: yyyy-MM-dd HH:mm:ss
timeZoneInteger
时区,默认8,即“GTM+8”
langString
语言类型。 默认cn en:英文 cn:中文

返回参数

Body 参数

参数名称描述
codeString
状态码,成功为“200”。
messageString
返回信息,成功为“Success”。
dataList
返回数据。
domainString
域名。
totalRequestLong
总请求数。
botRequestLong
Bot请求数。
reliefAttackLong
缓解攻击数。
typeTotalLong
攻击类型总数。
typeString
Bot类型TOP5。

错误码

错误代码(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://api.cdnetworks.com/api/bot/report/bot-visit-domain  \
-X "POST"  \
-u "$username:$password"  \
-H "Date: $date"   \
-H "Accept: application/json"  \
-H "Content-Type: application/json" \
-d '{ 
        "domain":"block3.baidu.com",
        "startTime":"2022-12-03 00:00:00",
        "endTime":"2023-12-03 23:59:59"
}'
返回示例
复制代码 复制成功
{
    "code": 200,
    "message": "SUCCESS",
    "data": [
        {
            "reliefAttack": 103,
            "botRequest": 123,
            "domain": "example1.xxx.xxx",
            "type": [
                {
                    "num": 123,
                    "name": "example1",
                    "percent": 100.000
                }
            ],
            "typeTotal": 123,
            "totalRequest": 0
        },
        {
            "reliefAttack": 0,
            "botRequest": 0,
            "domain": "example2.xxx.xxx",
            "type": [],
            "typeTotal": 0,
            "totalRequest": 0
        },
        {
            "reliefAttack": 150,
            "botRequest": 164,
            "domain": "example3.xxx.xxx",
            "type": [
                {
                    "num": 108,
                    "name": "example1",
                    "percent": 65.900
                },
                {
                    "num": 31,
                    "name": "example2",
                    "percent": 18.900
                },
                {
                    "num": 21,
                    "name": "example3",
                    "percent": 12.800
                },
                {
                    "num": 4,
                    "name": "example4",
                    "percent": 2.400
                }
            ],
            "typeTotal": 164,
            "totalRequest": 0
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!