API Documentation

RESTful API for accessing CVE vulnerability data programmatically.

Quick Start

Base URL: http://www.clamvn.com/api/

All responses are in JSON format with the following structure:

{
  "success": true,
  "data": { ... },
  "error": null,
  "message": null
}

Authentication

This API is currently public and does not require authentication.

Rate Limiting: Please be respectful with API usage. The service has internal rate limiting to comply with upstream data sources.

API Endpoints

GET /api/cves

Retrieve CVEs with optional filtering and pagination.

Query Parameters
Parameter Type Description Default
page integer Page number for pagination 1
per_page integer Number of results per page (max 100) 20
severity string Filter by severity: LOW, MEDIUM, HIGH, CRITICAL -
search string Search in CVE descriptions -
Example Request
GET http://www.clamvn.com/api/cves?severity=HIGH&page=1&per_page=10
Example Response
{
  "success": true,
  "data": {
    "cves": [
      {
        "id": "CVE-2024-XXXX",
        "description": "Vulnerability description...",
        "published": "2024-01-15T10:00:00.000",
        "last_modified": "2024-01-15T12:00:00.000",
        "base_score": 8.5,
        "severity": "HIGH",
        "vector_string": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
        "vendors": ["vendor1", "vendor2"],
        "affected_products_count": 15
      }
    ],
    "pagination": {
      "page": 1,
      "per_page": 10,
      "total": 150,
      "pages": 15
    }
  }
}
GET /api/cves/{cve_id}

Retrieve detailed information for a specific CVE.

Path Parameters
Parameter Type Description
cve_id string CVE identifier (e.g., CVE-2024-1234)
Example Request
GET http://www.clamvn.com/api/cves/CVE-2024-1234
Example Response
{
  "success": true,
  "data": {
    "id": "CVE-2024-1234",
    "description": "Detailed vulnerability description...",
    "published": "2024-01-15T10:00:00.000",
    "last_modified": "2024-01-15T12:00:00.000",
    "base_score": 8.5,
    "severity": "HIGH",
    "vector_string": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
    "vendors": ["vendor1", "vendor2"],
    "affected_products_count": 15,
    "affected_products": [
      {
        "vendor": "vendor1",
        "product": "product1",
        "version": "1.0.0"
      }
    ],
    "references": [
      "https://example.com/advisory",
      "https://vendor.com/security"
    ],
    "weaknesses": ["CWE-79", "CWE-89"]
  }
}
GET /api/stats

Get CVE statistics and summary information.

Example Request
GET http://www.clamvn.com/api/stats
Example Response
{
  "success": true,
  "data": {
    "total_recent_cves": 1250,
    "severity_distribution": {
      "CRITICAL": 45,
      "HIGH": 187,
      "MEDIUM": 623,
      "LOW": 345,
      "UNKNOWN": 50
    },
    "top_vendors": [
      ["microsoft", 89],
      ["google", 67],
      ["apple", 45]
    ],
    "last_updated": "2024-01-15T12:00:00.000"
  }
}
GET /api/search

Search CVEs by keyword in descriptions.

Query Parameters
Parameter Type Description Required
q string Search query (minimum 3 characters) Yes
page integer Page number for pagination No
per_page integer Number of results per page (max 100) No
Example Request
GET http://www.clamvn.com/api/search?q=sql injection&page=1
GET /api/severity/{severity}

Get CVEs filtered by specific severity level.

Path Parameters
Parameter Type Description
severity string Severity level: LOW, MEDIUM, HIGH, CRITICAL
Example Request
GET http://www.clamvn.com/api/severity/CRITICAL?page=1&per_page=20

Error Responses

All error responses follow this format:

{
  "success": false,
  "error": "Error type",
  "message": "Human readable error description"
}
Common HTTP Status Codes
Status Code Description
200 Success
400 Bad Request - Invalid parameters
404 Not Found - CVE or endpoint not found
405 Method Not Allowed
500 Internal Server Error

API Response

Click "Test Endpoint" on any API method above to see live results

Integration Examples

JavaScript (Fetch API)
fetch('http://www.clamvn.com/api/cves?severity=HIGH')
  .then(response => response.json())
  .then(data => {
    if (data.success) {
      console.log(data.data.cves);
    }
  });
Python (requests)
import requests

response = requests.get(
    'http://www.clamvn.com/api/cves',
    params={'severity': 'HIGH'}
)

if response.status_code == 200:
    data = response.json()
    if data['success']:
        cves = data['data']['cves']
cURL
curl -X GET \
  "http://www.clamvn.com/api/cves?severity=HIGH&page=1" \
  -H "Accept: application/json"
PHP
$response = file_get_contents(
    'http://www.clamvn.com/api/cves?severity=HIGH'
);

$data = json_decode($response, true);

if ($data['success']) {
    $cves = $data['data']['cves'];
}