# CVE Lookup API - NVD, CVSS, EPSS, CISA KEV (`stas_k/cve-lookup-api`) Actor

Half the work with CVE data is the joining: NVD, EPSS and CISA KEV answer in three shapes, and a missing source must not turn into a false not exploited. One row here carries CVSS, CWE, versions, EPSS and the KEV flag, or says in plain words why not, free.

- **URL**: https://apify.com/stas_k/cve-lookup-api.md
- **Developed by:** [Stas K](https://apify.com/stas_k) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 cve lookups

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CVE Lookup API - NVD, CVSS, EPSS, CISA KEV

One row per CVE id, with the four public sources already joined: NVD for the record and
CVSS, MITRE as a fallback when NVD has nothing, FIRST.org for the exploit probability,
CISA for the exploited-in-the-wild flag. No API key, yours or ours.

### What a row answers

- `description`, `published`, `lastModified` from NVD, or from MITRE when NVD has no record
- `baseScore`, `severity`, `vector`, `scoreSource` from CVSS (v3.1, then v3.0, then v2,
  and `scoreSource` always says which one answered)
- `cwe` as a list of weakness ids
- `affected` as product names with readable version ranges, for example
  `{"product": "log4j", "ranges": [">= 2.0, < 2.15.0"]}`
- `epss`, `epssPercentile`, `epssDate` from the FIRST.org model
- `kev`, `kevAdded`, `kevDueDate`, `kevRansomware`, `kevAction`, `kevName` from the CISA
  catalogue
- `otherIds`: a line that holds more than one CVE id is answered by its first id, and the
  rest are listed here instead of being dropped silently
- `references` and `sources`, where `sources` names what actually answered this row

`kev` is three-valued on purpose. `true` means CISA lists the CVE as exploited in the wild,
`false` means the catalogue was read and this id is not in it, `null` means the catalogue
could not be read at all and we are not claiming anything. Leaving `kev` out would be the
same claim as `false`, so it stays in the row as `null`.

### Money

The priced event is `cve-looked-up`, charged per delivered row. A row is delivered when it
carries a record. A row that carries no record is free and says why in `status` and
`reason`:

| status | meaning |
| --- | --- |
| `OK` | the row carries the record |
| `NOT_CHECKED_INVALID` | the line is not a CVE id, an empty line included |
| `NOT_CHECKED_DUPLICATE` | the same id came earlier in the list |
| `NOT_CHECKED_LIMIT` | beyond `maxCves` |
| `NOT_CHECKED_SOURCE` | NVD has no record and the MITRE record could not be read |
| `NOT_CHECKED_TIME` | the platform deadline was close |
| `NOT_CHECKED_CAP` | the spending cap was reached |
| `NOT_CHECKED_BILLING` | the run could not read its own price: nothing delivered, nothing charged |
| `NOT_CHECKED_ERROR` | the dataset refused the row, or the run stopped earlier |

The budget is read **before** the row is pushed, not after. The platform deliberately lets
one more row through on an exhausted budget so that it can kill the run, and that row would
be a charge for a row the buyer never gets to use. The push itself is
`Actor.push_data(..., charged_event_name=...)`: it writes the row and charges for it under
one lock, and its answer names how many events were actually charged.

`billable` on a row is the claim of the price at the moment of writing. The money actually
taken is `chargedEvents` in the run summary, never a field a row could invent.

### Honest numbers

A warm run of three CVEs takes about 2 seconds, most of it the CISA catalogue and the NVD
answers. NVD without a key is rate limited by the platform: this actor keeps a 0.35 s pace
between NVD calls, retries a 429 or a 5xx three times, and a source that stays silent turns
into a free `NOT_CHECKED_SOURCE` row instead of a charge. The CISA catalogue is read once per
run, so 50 ids cost one catalogue download, not fifty.

The clock is watched before every lookup: a request only starts when 100 seconds are left,
which is one worst-case NVD attempt plus room for the summary, and no retry is sent when
less than 30 seconds remain. A run that runs out of time ends its own tail with
`NOT_CHECKED_TIME` instead of being killed mid file.

`epss` is null when the feed has no row for that CVE. Null never means zero: a zero would
claim the CVE is not exploited, and we do not know that. `epssFeedOk` in the summary says
whether the feed answered at all, so a dead feed is never read as "no scores".

### What this actor does not do

- It does not scrape vendor advisories or exploit databases.
- It does not enrich with your private inventory, and it sends nothing about you to the
  sources.
- It does not guess a score. When no source publishes CVSS, the fields stay null and
  `scoreSource` says nothing was found.
- It does not return every reference ever listed: the first 8 are kept, newest NVD order.

### Input

- `cveIds`: one id per line. A link is accepted, the id is taken from it.
- `maxCves`: the list is cut here, cut ids come back free as `NOT_CHECKED_LIMIT`. 0 means no
  limit, and the summary reports the limit actually applied.
- `includeEpss`, `includeKev`, `includeAffected`: turn a source off when it is not needed.

### Run summary

One object per run in the named store `cve-lookup-summary` under `RUN_SUMMARY-<runId>`, and
the same text in the default store of the run under `RUN_SUMMARY`. `requested` always equals
`processed` plus `notChecked`, and it counts every line sent, blank lines included
(`blankLines` names how many of those were empty). `byStatus` is the full breakdown,
`stopReason` is null or one of `spending-cap`, `charge-error`, `dataset-write-error`,
`deadline`, `billing-price-unknown`, `unexpected-error`. `kevAvailable` says whether the
CISA catalogue was read, `kevCatalogVersion` names it, `epssFeedOk` says whether the FIRST
feed answered, `deliveredUncharged` counts rows that were written but not paid for, and
`unexpectedError` carries the reason when the run died on something unforeseen: a crash
never takes the summary down with it.

# Actor input Schema

## `cveIds` (type: `array`):

One CVE id per line, for example CVE-2021-44228. A full NVD or MITRE link is accepted and the id is taken from it, so https://nvd.nist.gov/vuln/detail/CVE-2021-44228 becomes CVE-2021-44228. Lines that do not hold a CVE id come back as their own free row with the reason.

## `maxCves` (type: `integer`):

The list is cut here. Ids beyond the limit come back as rows with status NOT_CHECKED_LIMIT, their own line in input, and are not charged. 0 means no limit, and the summary reports the number actually applied.

## `includeEpss` (type: `boolean`):

Adds the EPSS score, its percentile and the model date from the FIRST.org feed. The score is a probability that the CVE is exploited in the next 30 days, and it is null when the feed has no row for this CVE, never 0.

## `includeKev` (type: `boolean`):

Adds whether the CVE is in the CISA Known Exploited Vulnerabilities catalogue, with the date it was added, the federal remediation due date, the known ransomware flag and the required action.

## `includeAffected` (type: `boolean`):

Adds the CPE configurations from NVD reduced to plain product names with their version ranges, so a row answers which versions are vulnerable without parsing CPE strings.

## Actor input object example

```json
{
  "cveIds": [
    "CVE-2021-44228",
    "CVE-2024-3400",
    "CVE-2017-0144"
  ],
  "maxCves": 50,
  "includeEpss": true,
  "includeKev": true,
  "includeAffected": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per CVE id. status is OK when the row carries the record, or NOT_CHECKED\_\* with the reason written in plain words: INVALID (the line is not a CVE id, an empty line included), DUPLICATE (the same id came earlier), LIMIT (beyond maxCves), TIME (the run was close to the platform deadline), CAP (the spending cap was reached before this row was pushed), BILLING (the run could not read its own price, so nothing was delivered and nothing was charged), ERROR (the dataset refused the row, or the run stopped earlier), SOURCE (every source failed for this id). cve is the normalised id, and otherIds lists any further CVE ids that were on the same input line, so a line with two ids never loses one silently. description is the NVD text, or the MITRE text when NVD has no record; baseScore and severity come from CVSS v3.1 (v3.0 and v2 are used when 3.1 is absent and scoreSource says which one), vector is the CVSS vector, cwe lists the weakness ids. affected lists product names with their version ranges taken from the CPE configurations. epss is the 30 day exploit probability, epssPercentile its rank and epssDate the model date; null means the feed has no row for this CVE and never means zero. kev is true only when CISA lists the CVE as exploited in the wild, false when the catalogue was read and the id is absent, and null when the catalogue could not be read at all, which is not the same as not exploited; kevAdded, kevDueDate, kevRansomware, kevAction and kevName come from the same catalogue. published and lastModified are the record dates. sources names what actually answered for this row. billable is true only on a row that carries a delivered record; the money actually taken is in the run summary.

## `summary` (type: `string`):

Run summary. requested is how many lines were sent, blank lines included, uniqueCves how many different ids they held, duplicates how many lines repeated an id, blankLines how many lines were empty, processed plus notChecked always equals requested. delivered counts OK rows, rowsDelivered counts every row written, chargedEvents is what the platform actually charged, billingActive says whether this run could bill at all, stopReason is null, spending-cap, charge-error, dataset-write-error, deadline, billing-price-unknown or unexpected-error, and unexpectedError carries the reason when the run died on something unforeseen. byStatus is the full breakdown. cutByMaxCves is the tail the limit cut and maxCves the limit actually applied. deliveredUncharged counts rows delivered without money, writeErrors counts rows the dataset refused. kevRequested and kevAvailable say whether the CISA catalogue was asked for and read, kevCatalogVersion and kevCatalogCount describe it, epssRequested and epssFeedOk say whether the FIRST feed was asked for and answered, epssSkipped counts rows where it had no entry. datasetItemCount is our own count of written rows, datasetItemCountApi the same number as the platform reported it, datasetItemCountNote explains a gap. The named store keeps one object per run under RUN_SUMMARY-<runId>.

# 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 = {
    "cveIds": [
        "CVE-2021-44228",
        "CVE-2024-3400",
        "CVE-2017-0144"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stas_k/cve-lookup-api").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 = { "cveIds": [
        "CVE-2021-44228",
        "CVE-2024-3400",
        "CVE-2017-0144",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("stas_k/cve-lookup-api").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 '{
  "cveIds": [
    "CVE-2021-44228",
    "CVE-2024-3400",
    "CVE-2017-0144"
  ]
}' |
apify call stas_k/cve-lookup-api --silent --output-dataset

```

## MCP server setup

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

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/91dMgwuaT4nYIAa1f/builds/ogqhD9lSdEGeIrcQ7/openapi.json
