# Osv Vulnerability Scraper (`b2b_lead_generation/osv-vulnerability-scraper`) Actor

Extract known vulnerabilities, severities, and metadata for packages, CVEs, or GHSA IDs. Scrape open-source security data effortlessly and export clean results as JSON, CSV, or Excel datasets.

- **URL**: https://apify.com/b2b_lead_generation/osv-vulnerability-scraper.md
- **Developed by:** [B2B Lead Generation](https://apify.com/b2b_lead_generation) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### OSV Vulnerability Scraper: Open Source Vulnerabilities by Package

<p align="center">
  <img src="https://imgur.com/O8yoJgY.png" alt="OSV Vulnerability" style="max-width:100%; border-radius:14px; width:680px;" />
</p>

This tool reads package vulnerability records and writes one clean row per vulnerability. Pick a package, an identifier, or a batch of packages, set your item cap, and export your data as JSON, CSV, or Excel directly from the Apify dataset.

### Use cases

- **Dependency review**: provide a package name, ecosystem, and version to collect known vulnerabilities.
- **Advisory lookup**: paste an advisory identifier to keep summaries, aliases, and severity vectors.
- **Batch audit**: send several packages in a single query batch and hydrate each record.
- **Ticket export**: cap your run and drop the dataset straight into an issue tracker or spreadsheet.

### What data does this tool extract?

Three flexible modes let you target exactly what you need:

- `package_vulns`: Query vulnerabilities by ecosystem, package name, and optional version, automatically following pagination tokens.
- `vuln_details`: Retrieve specific vulnerability records by identifier.
- `batch_audit`: Run batch queries and automatically pull full details for every matched identifier.

Runs pause briefly between calls to keep requests smooth, and duplicate identifiers within the same run are automatically filtered out. Failed calls generate clear error records instead of stopping your workflow.

### Input

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `mode` | string | `package_vulns` | Choose between package query, vulnerability identifier lookup, or batch audit. |
| `packages` | array | PyPI jinja2 2.4.1 | Target packages with ecosystem, name, and optional version. |
| `vulnIds` | array | GHSA-462w-v97r-4m45 | Specific vulnerability identifiers to look up. |
| `maxItems` | integer | 100 | Maximum vulnerability rows to save (minimum 1, maximum 1000). |
| `requestDelaySecs` | number | 1 | Pause duration between requests. |
| `userAgent` | string | BigiByteActorResearch/1.0 | Custom client identification sent with requests. |
| `timeoutSecs` | integer | 300 | Maximum run duration in seconds (up to 3600). |
| `requestTimeoutSecs` | integer | 30 | Timeout per individual request. |
| `proxyConfiguration` | object | Disabled | Optional proxy settings. |

#### Example input

```json
{
  "mode": "package_vulns",
  "packages": [
    {"ecosystem": "PyPI", "name": "jinja2", "version": "2.4.1"}
  ],
  "maxItems": 100,
  "requestDelaySecs": 1,
  "userAgent": "B2BLeadGenerationResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {"useApifyProxy": false}
}

```

### Output example

```json
{
  "id": "GHSA-462w-v97r-4m45",
  "summary": "Jinja2 sandbox escape via string formatting",
  "details": "In Pallets Jinja before 2.10.1, str.format_map allows a sandbox escape.",
  "aliases": ["CVE-2019-10906", "PYSEC-2019-217"],
  "published": "2019-04-10T14:30:24Z",
  "modified": "2024-09-24T21:03:59.802687Z",
  "severity": [
    {
      "type": "CVSS_V3",
      "severityKind": "CVSS_V3",
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
    }
  ],
  "affected_package": "jinja2",
  "affected_ecosystem": "PyPI",
  "references": [
    {
      "type": "ADVISORY",
      "referenceKind": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-10906"
    }
  ],
  "queried_package": "jinja2@2.4.1",
  "scraped_at": "2026-10-12T00:00:00+00:00"
}

```

***

### FAQ

**Can I export CSV?**
Yes. Apify allows you to export your dataset as JSON, CSV, or Excel instantly.

**What happens if a vulnerability identifier cannot be found?**
You receive a single error row containing the status and message, while successful records continue to process normally.

**How many vulnerabilities can a single run save?**
`maxItems` defaults to 100 and can be adjusted up to 1000.

***

### Is web scraping legal?

This actor collects publicly available vulnerability information without bypassing access controls or requiring credentials. However, how you use the collected data matters:

- **Personal data:** If results contain personal information, ensure compliance with relevant privacy regulations like GDPR or CCPA.
- **Copyright:** Avoid republishing copyrighted text or descriptions without permission.
- **Terms of use:** Respect rate limits and usage guidelines.
- **Legal advice:** This overview is for informational purposes and does not constitute legal advice. For more details, read Apify's guide on [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

# Actor input Schema

## `mode` (type: `string`):

package_vulns posts each package to /v1/query. vuln_details loads /v1/vulns/{id}. batch_audit posts /v1/querybatch, then hydrates each returned id.

## `packages` (type: `array`):

Objects with ecosystem, name, and optional version. Used by package_vulns and batch_audit. Ecosystems include PyPI, npm, Go, Maven, crates.io, RubyGems, NuGet, and Packagist.

## `vulnIds` (type: `array`):

OSV, GHSA, or CVE ids for vuln_details. One id per line. Example: GHSA-462w-v97r-4m45.

## `maxItems` (type: `integer`):

Maximum vulnerability rows to save this run. Hard cap is 1000. Error rows do not count toward this limit.

## `requestDelaySecs` (type: `number`):

Seconds to wait before each OSV API call. Keeps the run polite even though the public API docs currently state no rate limit.

## `userAgent` (type: `string`):

User-Agent sent on every request. Include an app name and a contact so the host can identify the client.

## `timeoutSecs` (type: `integer`):

Stop the run after this many seconds and keep rows already collected. Default 300. Maximum 3600.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for one OSV API response before treating that call as failed. Default 30 seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy for OSV API requests. Leave useApifyProxy off unless the host blocks your IP. The public API does not need a proxy.

## Actor input object example

```json
{
  "mode": "package_vulns",
  "packages": [
    {
      "ecosystem": "PyPI",
      "name": "jinja2",
      "version": "2.4.1"
    }
  ],
  "vulnIds": [
    "GHSA-462w-v97r-4m45"
  ],
  "maxItems": 100,
  "requestDelaySecs": 1,
  "userAgent": "BigiByteActorResearch/1.0 (contact: research@bigibyte.com)",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Id, summary, details, aliases, dates, severity, affected package, and source URL.

## `errors` (type: `string`):

Failed OSV requests with URL, HTTP status, and message.

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

Every row from the run, without a table view applied.

# 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 = {
    "vulnIds": [
        "GHSA-462w-v97r-4m45"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b_lead_generation/osv-vulnerability-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 = {
    "vulnIds": ["GHSA-462w-v97r-4m45"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("b2b_lead_generation/osv-vulnerability-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 '{
  "vulnIds": [
    "GHSA-462w-v97r-4m45"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call b2b_lead_generation/osv-vulnerability-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b_lead_generation/osv-vulnerability-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/RjdpozwvcjX9kdITT/builds/0LmjXWyV0V6c2Tjrz/openapi.json
