{
 "openapi": "3.1.0",
 "info": {
  "title": "ExploitPulse API",
  "version": "1",
  "summary": "Exploited and critical vulnerabilities as cited claims.",
  "description": "Read-only static JSON, rebuilt with the site. Every claim cites the sources that state it. Documentation: https://exploitpulse.com/sources#api",
  "license": {
   "name": "Apache-2.0",
   "identifier": "Apache-2.0"
  }
 },
 "servers": [
  {
   "url": "https://exploitpulse.com"
  }
 ],
 "paths": {
  "/data/v1/index.json": {
   "get": {
    "summary": "API index",
    "description": "Counts, build time and the endpoint list.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Index"
        }
       }
      }
     }
    }
   }
  },
  "/data/v1/cves.json": {
   "get": {
    "summary": "All CVE pages",
    "description": "One row per CVE page (CISA KEV, vendor-confirmed, critical advisory), newest first.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CveList"
        }
       }
      }
     }
    }
   }
  },
  "/data/v1/cve/{cve}.json": {
   "get": {
    "summary": "One CVE",
    "description": "The page's cited claims, its sources, tags and changelog.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Cve"
        }
       }
      }
     },
     "404": {
      "description": "No page for this CVE."
     }
    },
    "parameters": [
     {
      "name": "cve",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^CVE-\\d{4}-\\d{4,7}$"
      },
      "example": "CVE-2021-44228"
     }
    ]
   }
  }
 },
 "components": {
  "schemas": {
   "Source": {
    "type": "object",
    "required": [
     "id",
     "kind",
     "label",
     "url"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique on the page, cited by claims."
     },
     "kind": {
      "type": "string",
      "enum": [
       "cisa-kev",
       "vendor",
       "nvd",
       "cve",
       "report",
       "scan",
       "news",
       "distro"
      ]
     },
     "label": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "Claim": {
    "type": "object",
    "required": [
     "field",
     "value",
     "kind",
     "sources"
    ],
    "properties": {
     "field": {
      "type": "string",
      "description": "vendor, product, vulnerability, date_added, due_date, required_action, ransomware, weakness, exploitation, fixed_version, affected_version, cvss, severity, ... (new fields may be added within v1)"
     },
     "value": {
      "type": "string"
     },
     "kind": {
      "type": "string",
      "enum": [
       "text",
       "date",
       "version",
       "exploitation"
      ]
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "minItems": 1,
      "description": "Ids of the sources (in `sources`) that state this claim."
     }
    }
   },
   "Change": {
    "type": "object",
    "required": [
     "on",
     "field",
     "action",
     "text",
     "cites"
    ],
    "properties": {
     "on": {
      "type": "string",
      "format": "date"
     },
     "field": {
      "type": "string"
     },
     "action": {
      "type": "string",
      "enum": [
       "published",
       "status",
       "added",
       "changed",
       "removed"
      ]
     },
     "old": {
      "type": [
       "string",
       "null"
      ]
     },
     "new": {
      "type": [
       "string",
       "null"
      ]
     },
     "text": {
      "type": "string"
     },
     "cites": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "label": {
         "type": "string"
        },
        "url": {
         "type": "string",
         "format": "uri"
        }
       }
      }
     }
    }
   },
   "Tag": {
    "type": "object",
    "properties": {
     "slug": {
      "type": "string"
     },
     "label": {
      "type": "string"
     },
     "source": {
      "type": "string"
     }
    }
   },
   "Cve": {
    "type": "object",
    "required": [
     "schema",
     "cve",
     "title",
     "page_kind",
     "exploitation_status",
     "claims",
     "sources",
     "url"
    ],
    "properties": {
     "schema": {
      "const": "exploitpulse.api/1"
     },
     "cve": {
      "type": "string",
      "pattern": "^CVE-\\d{4}-\\d{4,7}$"
     },
     "title": {
      "type": "string"
     },
     "page_kind": {
      "type": "string",
      "enum": [
       "kev",
       "vendor",
       "critical"
      ]
     },
     "page_kind_label": {
      "type": "string"
     },
     "exploitation_status": {
      "type": "string",
      "enum": [
       "confirmed",
       "corroborated",
       "reported",
       "none"
      ]
     },
     "since": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "claims": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Claim"
      }
     },
     "sources": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Source"
      }
     },
     "tags": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Tag"
      }
     },
     "changes": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Change"
      }
     }
    }
   },
   "CveRow": {
    "type": "object",
    "required": [
     "cve",
     "title",
     "page_kind",
     "exploitation_status",
     "url",
     "api"
    ],
    "properties": {
     "cve": {
      "type": "string"
     },
     "title": {
      "type": "string"
     },
     "page_kind": {
      "type": "string",
      "enum": [
       "kev",
       "vendor",
       "critical"
      ]
     },
     "exploitation_status": {
      "type": "string"
     },
     "since": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "vendor": {
      "type": [
       "string",
       "null"
      ]
     },
     "product": {
      "type": [
       "string",
       "null"
      ]
     },
     "date_added": {
      "type": [
       "string",
       "null"
      ]
     },
     "due_date": {
      "type": [
       "string",
       "null"
      ]
     },
     "severity": {
      "type": [
       "string",
       "null"
      ]
     },
     "tags": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "url": {
      "type": "string",
      "format": "uri"
     },
     "api": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "CveList": {
    "type": "object",
    "required": [
     "schema",
     "generated",
     "count",
     "items"
    ],
    "properties": {
     "schema": {
      "const": "exploitpulse.api/1"
     },
     "generated": {
      "type": "string",
      "format": "date-time"
     },
     "count": {
      "type": "integer"
     },
     "counts": {
      "type": "object",
      "additionalProperties": {
       "type": "integer"
      }
     },
     "items": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/CveRow"
      }
     }
    }
   },
   "Index": {
    "type": "object",
    "properties": {
     "schema": {
      "const": "exploitpulse.api/1"
     },
     "generated": {
      "type": "string",
      "format": "date-time"
     },
     "count": {
      "type": "integer"
     },
     "counts": {
      "type": "object",
      "additionalProperties": {
       "type": "integer"
      }
     },
     "docs": {
      "type": "string",
      "format": "uri"
     },
     "openapi": {
      "type": "string",
      "format": "uri"
     },
     "endpoints": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
