Get Stats
Retrieve aggregate statistics about tracked vulnerabilities.
Endpoint
GET /api/v1/statsResponse
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
| Field | Type | Description |
|---|---|---|
total | number | Total number of tracked CVE issues |
bySeverity | object | Breakdown of issues by severity level |
bySeverity.critical | number | Critical severity count |
bySeverity.high | number | High severity count |
bySeverity.medium | number | Medium severity count |
bySeverity.low | number | Low severity count |
bySeverity.unknown | number | Unknown severity count |
withFix | number | Issues with an available fix |
assigned | number | Issues assigned to a contributor |
Example
bash
curl https://api.vulnpatch.dev/api/v1/statsCode 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.