Skip to content

Get Stats

Retrieve aggregate statistics about tracked vulnerabilities.

Endpoint

GET /api/v1/stats

Response

json
{
  "success": true,
  "data": {
    "total": 150,
    "bySeverity": {
      "critical": 12,
      "high": 45,
      "medium": 68,
      "low": 20,
      "unknown": 5
    },
    "withFix": 42,
    "assigned": 15
  },
  "timestamp": "2024-01-15T12:00:00.000Z"
}

Response Fields

FieldTypeDescription
totalnumberTotal number of tracked CVE issues
bySeverityobjectBreakdown of issues by severity level
bySeverity.criticalnumberCritical severity count
bySeverity.highnumberHigh severity count
bySeverity.mediumnumberMedium severity count
bySeverity.lownumberLow severity count
bySeverity.unknownnumberUnknown severity count
withFixnumberIssues with an available fix
assignednumberIssues assigned to a contributor

Example

bash
curl https://api.vulnpatch.dev/api/v1/stats

Code Examples

javascript
async function displayStats() {
  const response = await fetch('https://api.vulnpatch.dev/api/v1/stats');
  const { data } = await response.json();

  console.log(`Total CVEs: ${data.total}`);
  console.log(`Critical: ${data.bySeverity.critical}`);
  console.log(`High: ${data.bySeverity.high}`);
  console.log(`With Fix: ${data.withFix}`);
}
python
import requests

response = requests.get('https://api.vulnpatch.dev/api/v1/stats')
stats = response.json()['data']

print(f"Total CVEs: {stats['total']}")
print(f"Critical: {stats['bySeverity']['critical']}")
print(f"With Fix: {stats['withFix']}")

Use Cases

  • Dashboard widgets: Display current vulnerability counts
  • Monitoring: Track vulnerability trends over time
  • Alerting: Trigger alerts when critical CVEs spike

Caching

This endpoint is cached for 5 minutes. The X-Cache header indicates cache status.

Helping secure open source