itecdn 5.x用户文档
itecdn 5.x / 用户 API

查询网站访问 Top 排行榜

GET/v1/monitor/site/top

按 IP、国家、省份、运营商、URL、域名端口、TLS 指纹或 Referer 聚合访问日志。需要登录;普通用户仅查询自己的 uid 且传入域名必须属于自己,管理员查询全量。榜单条数由系统 res_rank_size 配置决定。

身份认证

access-token

api-key + api-secret

认证定义
{
  "AccessToken": {
    "type": "apiKey",
    "in": "header",
    "name": "access-token",
    "description": "通过登录接口获得的短期访问令牌。"
  },
  "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "api-key",
    "description": "API Key;必须和 api-secret 同时发送。"
  },
  "ApiSecret": {
    "type": "apiKey",
    "in": "header",
    "name": "api-secret",
    "description": "API Secret;必须和 api-key 同时发送。"
  }
}

请求参数

参数位置类型必填说明与约束
typequerystring必填

排行维度。

完整参数定义
{
  "name": "type",
  "in": "query",
  "required": true,
  "description": "排行维度。",
  "schema": {
    "type": "string",
    "enum": [
      "top-ip",
      "top-country",
      "top-province",
      "top-isp",
      "top-url",
      "top-domain",
      "top-tls-fp",
      "top-referer"
    ]
  }
}
recent_timequerystring可选

最近时间窗口;提供时忽略 start/end,仅支持 10m、30m、60m。

完整参数定义
{
  "name": "recent_time",
  "in": "query",
  "required": false,
  "description": "最近时间窗口;提供时忽略 start/end,仅支持 10m、30m、60m。",
  "schema": {
    "type": "string",
    "enum": [
      "10m",
      "30m",
      "60m"
    ]
  }
}
startquerystring可选

自定义开始时间(含);未传 recent_time 时与 end 一同必填,格式 YYYY-MM-DD HH:mm:ss,跨度不超过 1.5 小时。

完整参数定义
{
  "name": "start",
  "in": "query",
  "required": false,
  "description": "自定义开始时间(含);未传 recent_time 时与 end 一同必填,格式 YYYY-MM-DD HH:mm:ss,跨度不超过 1.5 小时。",
  "schema": {
    "type": "string",
    "example": "2026-01-01 00:00:00"
  }
}
endquerystring可选

自定义结束时间(不含);未传 recent_time 时与 start 一同必填。

完整参数定义
{
  "name": "end",
  "in": "query",
  "required": false,
  "description": "自定义结束时间(不含);未传 recent_time 时与 start 一同必填。",
  "schema": {
    "type": "string",
    "example": "2026-01-01 01:00:00"
  }
}
domainquerystring可选

空格分隔域名筛选;普通用户只能传自身域名。

完整参数定义
{
  "name": "domain",
  "in": "query",
  "required": false,
  "description": "空格分隔域名筛选;普通用户只能传自身域名。",
  "schema": {
    "type": "string",
    "example": "www.example.invalid"
  }
}
server_portquerystring可选

源站端口精确筛选,必须为合法端口。

完整参数定义
{
  "name": "server_port",
  "in": "query",
  "required": false,
  "description": "源站端口精确筛选,必须为合法端口。",
  "schema": {
    "type": "string",
    "example": "443"
  }
}
ccquerystring可选

攻击流量模式:0(默认)全部流量;1 仅统计窗口内出现过 HTTP 444 的 IP。管理员生成攻击 IP 候选集时不应用域名和端口筛选。

完整参数定义
{
  "name": "cc",
  "in": "query",
  "required": false,
  "description": "攻击流量模式:0(默认)全部流量;1 仅统计窗口内出现过 HTTP 444 的 IP。管理员生成攻击 IP 候选集时不应用域名和端口筛选。",
  "schema": {
    "type": "string",
    "enum": [
      "0",
      "1"
    ],
    "default": "0"
  }
}

响应

HTTP 200

成功、参数和域名权限错误均返回 HTTP 200。日志库异常或无聚合时成功返回空数组。

application/json

oneOf

oneOf · 1 · object
字段类型必填说明与约束
codeinteger必填

网站资源排行查询成功时固定为 0。

约束 / 默认值 / 示例
{
  "enum": [
    0
  ]
}
msgstring必填

网站资源排行查询成功时固定为空字符串。

约束 / 默认值 / 示例
{
  "enum": [
    ""
  ]
}
dataarray <object>必填

排行数据。

展开字段结构

排行数据。

数组元素 · object
字段类型必填说明与约束
trafficnumber必填

bytes_sent 总和。

up_recvnumber必填

up_recv 总和。

countinteger必填

请求文档数。

约束 / 默认值 / 示例
{
  "minimum": 0
}
resstring必填

资源值:IP、地理字段、运营商、URL、域名端口、TLS 指纹或 Referer,由 type 决定。

oneOf · 2 · object
字段类型必填说明与约束
codestring必填

域名权限、类型、时间、recent_time、端口或认证失败的业务错误码。

约束 / 默认值 / 示例
{
  "enum": [
    "monitor_top-1",
    "monitor_top-2",
    "monitor_top-3",
    "monitor_top-4",
    "monitor_top-5",
    "monitor_top-6",
    "monitor_top-7",
    "monitor_top-8",
    "monitor_top-9",
    "login_required"
  ]
}
msgstring必填

排行类型、时间范围、域名权限或认证失败的具体原因。

datastring必填

发生业务错误时固定返回空字符串。

约束 / 默认值 / 示例
{
  "enum": [
    ""
  ]
}
完整 Schema
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "integer",
          "enum": [
            0
          ],
          "description": "网站资源排行查询成功时固定为 0。"
        },
        "msg": {
          "type": "string",
          "enum": [
            ""
          ],
          "description": "网站资源排行查询成功时固定为空字符串。"
        },
        "data": {
          "type": "array",
          "description": "排行数据。",
          "items": {
            "type": "object",
            "required": [
              "traffic",
              "up_recv",
              "count",
              "res"
            ],
            "properties": {
              "traffic": {
                "type": "number",
                "description": "bytes_sent 总和。"
              },
              "up_recv": {
                "type": "number",
                "description": "up_recv 总和。"
              },
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "请求文档数。"
              },
              "res": {
                "type": "string",
                "description": "资源值:IP、地理字段、运营商、URL、域名端口、TLS 指纹或 Referer,由 type 决定。"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "monitor_top-1",
            "monitor_top-2",
            "monitor_top-3",
            "monitor_top-4",
            "monitor_top-5",
            "monitor_top-6",
            "monitor_top-7",
            "monitor_top-8",
            "monitor_top-9",
            "login_required"
          ],
          "description": "域名权限、类型、时间、recent_time、端口或认证失败的业务错误码。"
        },
        "msg": {
          "type": "string",
          "description": "排行类型、时间范围、域名权限或认证失败的具体原因。"
        },
        "data": {
          "type": "string",
          "enum": [
            ""
          ],
          "description": "发生业务错误时固定返回空字符串。"
        }
      },
      "additionalProperties": false
    }
  ]
}

示例

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "traffic": 1048576,
      "up_recv": 1024,
      "count": 42,
      "res": "192.0.2.10"
    }
  ]
}

Top IP

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "traffic": 1048576,
      "up_recv": 1024,
      "count": 42,
      "res": "192.0.2.10"
    }
  ]
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request GET \
  "https://master.example.invalid/v1/monitor/site/top" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON