扫描 API

创建和管理扫描任务


扫描 API 用于创建和管理威胁扫描任务。

创建扫描任务

POST /v1/scans

请求体

{
  "domain": "example.com",
  "type": "ct_log"
}

扫描类型

类型描述
ct_logCT Log 证书透明度扫描
dnsDNS 相似域名扫描
google_searchGoogle 搜索扫描

响应示例

{
  "data": {
    "id": "scan_xxx",
    "domain": "example.com",
    "type": "ct_log",
    "status": "pending",
    "created_at": "2024-01-20T10:30:00Z"
  }
}

获取扫描状态

GET /v1/scans/:id

响应示例

{
  "data": {
    "id": "scan_xxx",
    "domain": "example.com",
    "type": "ct_log",
    "status": "completed",
    "progress": 100,
    "result": {
      "total_checked": 1250,
      "threats_found": 3
    },
    "created_at": "2024-01-20T10:30:00Z",
    "completed_at": "2024-01-20T10:35:00Z"
  }
}

扫描状态

状态描述
pending等待执行
running执行中
completed已完成
failed执行失败

获取扫描列表

GET /v1/scans

查询参数

参数类型描述
domainstring按域名筛选
typestring按类型筛选
statusstring按状态筛选
pagenumber页码
per_pagenumber每页数量

取消扫描

POST /v1/scans/:id/cancel

响应示例

{
  "data": {
    "id": "scan_xxx",
    "status": "cancelled"
  }
}

只有状态为 pendingrunning 的扫描任务可以取消。


    扫描 API | OpenBait