# cve-scraper (`kingofthejunes/cve-scraper`) Actor

CVE = Common Vulnerabilities and Exposures.
official ID for a security vulnerability so the world can track and fix it

- **URL**: https://apify.com/kingofthejunes/cve-scraper.md
- **Developed by:** [Kayode Balogun](https://apify.com/kingofthejunes) (community)
- **Categories:** Other
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NVD CVE Scraper

An Apify actor that fetches recent CVE (Common Vulnerabilities and Exposures) data from the National Vulnerability Database (NVD) using their official API.

### Features

- Fetches CVEs published in the last 7 days
- Uses the official NVD API 2.0 for reliable data access
- Extracts CVE ID, description, publication date, and metadata
- Outputs structured data to Apify dataset

### Why Use the API Instead of Scraping?

The NVD website loads CVE data dynamically via JavaScript, making traditional HTML scraping unreliable. The official API provides:

- Structured, reliable data
- Better performance
- No risk of breaking when the website UI changes
- Official support from NIST

### Input Configuration

You can customize the actor by modifying these parameters in the code:

```javascript
// Adjust the date range (currently set to last 7 days)
const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);

// Adjust results per page (max 2000)
resultsPerPage: '100'
```

### Output

Each scraped CVE includes:

- `cve`: CVE identifier (e.g., CVE-2024-12345)
- `description`: English description of the vulnerability
- `published`: Publication date
- `lastModified`: Last modification date
- `sourceIdentifier`: Source that reported the CVE

#### Example Output

```json
{
  "cve": "CVE-2024-12345",
  "description": "A buffer overflow vulnerability in XYZ software allows remote attackers to execute arbitrary code...",
  "published": "2024-11-15T10:15:00.000",
  "lastModified": "2024-11-15T10:15:00.000",
  "sourceIdentifier": "security@example.com"
}
```

### Rate Limits

The NVD API has rate limits:

- **Without API key**: ~5 requests per 30 seconds
- **With API key**: 50 requests per 30 seconds

For this actor (single request), rate limits shouldn't be an issue.

### Getting an API Key (Optional)

For higher rate limits or frequent runs:

1. Request a free API key at: https://nvd.nist.gov/developers/request-an-api-key
2. Add it to your code:

```javascript
const response = await fetch(apiUrl, {
    headers: {
        'User-Agent': 'Apify-CVE-Scraper/1.0',
        'apiKey': 'YOUR_API_KEY_HERE'
    }
});
```

### Installation

1. Create a new Apify actor
2. Copy the code into your actor's main file
3. Deploy and run

### Usage Examples

#### Run as Scheduled Actor

Set up a schedule to run daily and monitor new CVEs:

1. Go to your actor in Apify Console
2. Click "Schedule"
3. Set to run daily at your preferred time

#### Export Data

The scraped CVEs are stored in the actor's dataset and can be:

- Downloaded as JSON, CSV, or Excel
- Accessed via Apify API
- Pushed to external services using integrations

### Advanced Customization

#### Filter by Severity

Add CVSS score filtering to the API request:

```javascript
const params = new URLSearchParams({
    pubStartDate: sevenDaysAgo.toISOString(),
    pubEndDate: now.toISOString(),
    cvssV3Severity: 'CRITICAL', // or HIGH, MEDIUM, LOW
    resultsPerPage: '100'
});
```

#### Search by Keyword

Filter CVEs containing specific keywords:

```javascript
const params = new URLSearchParams({
    keywordSearch: 'buffer overflow',
    resultsPerPage: '100'
});
```

### API Documentation

Full NVD API documentation: https://nvd.nist.gov/developers/vulnerabilities

### Troubleshooting

**No CVEs returned**: Check that there were CVEs published in your date range. Try expanding the date range.

**API errors**: Ensure you're not hitting rate limits. Add delays between requests if making multiple API calls.

**Empty descriptions**: Some CVEs may not have English descriptions immediately upon publication.

### License

This actor uses public data from the National Vulnerability Database. Please review NVD's terms of use.

### Support

For issues or questions:

- Check NVD API status: https://nvd.nist.gov/general/news
- Review API documentation
- Contact Apify support for actor-specific issues

# Actor input Schema

## `startUrls` (type: `array`):

URLs to start with.

## `maxRequestsPerCrawl` (type: `integer`):

Maximum number of requests that can be made by this crawler.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev/"
    }
  ],
  "maxRequestsPerCrawl": 100
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://crawlee.dev/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kingofthejunes/cve-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": [{ "url": "https://crawlee.dev/" }] }

# Run the Actor and wait for it to finish
run = client.actor("kingofthejunes/cve-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://crawlee.dev/"
    }
  ]
}' |
apify call kingofthejunes/cve-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kingofthejunes/cve-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LjvEniGVs59wKnBOS/builds/uaknkz9D5YyQZ2MAP/openapi.json
