# Package Health & Vulnerability Audit (`saffo/package-health-audit`) Actor

Maintenance status, license, downloads and known vulnerabilities with fixed versions for npm, crates.io and RubyGems packages, one row per package version.

- **URL**: https://apify.com/saffo/package-health-audit.md
- **Developed by:** [Saffo](https://apify.com/saffo) (community)
- **Categories:** Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 package checkeds

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

## Package Vulnerability Audit: npm, crates.io and RubyGems health check

Maintenance status, license, downloads and known vulnerabilities with fixed versions for npm, crates.io and RubyGems packages, one row per package version.

### What it does

Give it a list of npm, crates.io (cargo) and RubyGems packages, optionally pinned to a version, and it returns one row per package version. Each row holds the latest version and whether yours is outdated, the license, release dates and how often the package was released in the last year, npm deprecation and cargo/RubyGems yank state, the number of direct runtime dependencies, download counts, and every known vulnerability that affects that exact version, with its severity, CVSS vector and the versions that fix it.

On top of the raw data it adds a maintenance status (active, maintained, stale, abandoned), risk flags such as `severe-vulnerability` or `outdated`, and a rule-based 0-100 health score, so you can triage a dependency list without opening three registries and an advisory database. Ecosystems can be mixed in one run. Data is read live from the registries' public APIs and from [OSV.dev](https://osv.dev/) at run time. No maintainer, author or publisher data is ever returned.

### Who it is for

- Developers and platform teams checking a dependency before adding or upgrading it: is the pinned version vulnerable, which version fixes it, is the package still released?
- Security and compliance reviewers who need a table of licenses and known advisories for a list of open-source packages.
- AI agents and scripts that audit dependencies as one step of a larger task and want structured JSON instead of web pages.

### How to use it

1. Open the actor on [Apify Store](https://apify.com/saffo/package-health-audit) and go to its Input tab.
2. Fill in `packages`; every other field has a default (see Input below).
3. Click **Start**. The run ends at the limits below, or earlier at the "Maximum cost per run" you set.
4. When the run ends, open the Output tab: view the results as a table, or export them as JSON, CSV or Excel.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `packages` | array | required | Packages to audit, one per entry, as "ecosystem:name" or "ecosystem:name@version" with ecosystem npm, cargo or rubygems (for example "npm:lodash@4.17.20", "cargo:serde", "rubygems:rails@7.0.0"). A name without prefix uses the default ecosystem; without a version the latest stable version is checked. |
| `defaultEcosystem` | string | `"npm"` | Ecosystem used for entries without a prefix; one of npm, cargo, rubygems. |
| `maxItems` | integer | `200` | Stop after this many package rows (duplicates in the list are removed first). At most 5000 per run. |

Example input:

```json
{
  "packages": [
    "npm:express",
    "cargo:serde",
    "rubygems:rails"
  ],
  "maxItems": 3
}
```

Write each entry as `ecosystem:name` or `ecosystem:name@version`, with ecosystem `npm`, `cargo` or `rubygems`. Scoped npm names work with a version too (`npm:@babel/core@7.0.0`). Entries without a prefix use **Default ecosystem**; entries without a version are checked at the latest stable version. Duplicates are removed before **Max packages** applies. Pinned versions look like this:

```json
{
  "packages": ["npm:lodash@4.17.20", "cargo:time@0.1.45", "rubygems:nokogiri@1.10.0", "left-pad"],
  "defaultEcosystem": "npm"
}
```

### Output

Each result is one dataset item:

| Field | Type | Description |
|---|---|---|
| `url` | string | Web address of the item: its own page, or the page it was read from. |
| `title` | string | Title of the item as shown on the page. |
| `ecosystem` | string | Registry of the package; one of npm, cargo, rubygems. |
| `status` | string | Lookup result; one of ok, package-not-found, version-not-found, error. Only rows with ok are charged. |
| `requestedVersion` | string or null | Version given in the input entry; null when the entry had no version. |
| `checkedVersion` | string or null | Version that was audited, the requested one or else the latest stable version. |
| `latestVersion` | string or null | Latest stable version in the registry (npm dist-tag latest, crates.io max_stable_version, RubyGems version). |
| `isLatest` | boolean or null | True when checkedVersion equals latestVersion. |
| `license` | string or null | License of the checked version as published (SPDX expression where the registry uses one); null when none is declared. |
| `checkedVersionReleasedAt` | string or null | Publication time of the checked version (ISO 8601, UTC). |
| `latestReleasedAt` | string or null | Publication time of the latest stable version (ISO 8601, UTC). |
| `firstReleasedAt` | string or null | Publication time of the first version of the package (ISO 8601, UTC). |
| `daysSinceLatestRelease` | integer or null | Whole days from latestReleasedAt to fetchedAt. |
| `versionCount` | integer or null | Number of distinct published version numbers, yanked or deprecated ones included. |
| `releasesLast365Days` | integer or null | Number of distinct versions published in the 365 days before fetchedAt. |
| `maintenanceStatus` | string or null | From daysSinceLatestRelease; active up to 90 days, maintained up to 365, stale up to 730, abandoned above. |
| `deprecated` | boolean or null | True when npm marks the checked version deprecated; null for cargo and rubygems, which have no such flag. |
| `deprecationMessage` | string or null | Deprecation text npm shows for the checked version; null when not deprecated. |
| `yanked` | boolean or null | True when the checked version is yanked (cargo, rubygems); null for npm. |
| `dependencyCount` | integer or null | Number of direct runtime dependencies of the checked version. |
| `recentDownloads` | integer or null | Downloads in the window given by recentDownloadsDays (npm 30 days, cargo 90 days); null for rubygems. |
| `recentDownloadsDays` | integer or null | Length in days of the recentDownloads window; null when recentDownloads is null. |
| `totalDownloads` | integer or null | All-time downloads of the package (cargo, rubygems); null for npm, whose API has no all-time count. |
| `vulnerabilityCount` | integer or null | Number of distinct known advisories (after alias merging) affecting the checked version. |
| `maxSeverity` | string or null | Highest severity among the advisories; one of critical, high, moderate, low, unknown, none. |
| `latestVersionVulnerabilityCount` | integer or null | Advisories affecting latestVersion, so a user sees whether upgrading clears them. |
| `vulnerabilities` | array or null | Advisories affecting the checked version, highest severity first. |
| `riskFlags` | array or null | Risk markers, any of vulnerable, severe-vulnerability, deprecated, yanked, outdated, stale, abandoned, no-license, single-release, unmaintained-advisory. |
| `healthScore` | integer or null | Rule-based 0-100 score from the risk flags; null when status is not ok. |
| `fetchedAt` | string | When the page was read (ISO 8601, UTC). |

Example output (real items from a test run):

```json
[
  {
    "url": "https://www.npmjs.com/package/express/v/5.3.0",
    "title": "express",
    "ecosystem": "npm",
    "status": "ok",
    "requestedVersion": null,
    "checkedVersion": "5.3.0",
    "latestVersion": "5.3.0",
    "isLatest": true,
    "license": "MIT",
    "checkedVersionReleasedAt": "2026-10-09T12:56:54Z",
    "latestReleasedAt": "2026-10-09T12:56:54Z",
    "firstReleasedAt": "2010-12-29T19:38:25Z",
    "daysSinceLatestRelease": 41,
    "versionCount": 290,
    "releasesLast365Days": 7,
    "maintenanceStatus": "active",
    "deprecated": false,
    "deprecationMessage": null,
    "yanked": null,
    "dependencyCount": 28,
    "recentDownloads": 826990589,
    "recentDownloadsDays": 30,
    "totalDownloads": null,
    "vulnerabilityCount": 0,
    "maxSeverity": "none",
    "latestVersionVulnerabilityCount": 0,
    "vulnerabilities": [],
    "riskFlags": [],
    "healthScore": 100,
    "fetchedAt": "2026-11-20T05:09:42Z"
  },
  {
    "url": "https://crates.io/crates/serde/1.0.229",
    "title": "serde",
    "ecosystem": "cargo",
    "status": "ok",
    "requestedVersion": null,
    "checkedVersion": "1.0.229",
    "latestVersion": "1.0.229",
    "isLatest": true,
    "license": "MIT OR Apache-2.0",
    "checkedVersionReleasedAt": "2026-07-18T23:05:13Z",
    "latestReleasedAt": "2026-07-18T23:05:13Z",
    "firstReleasedAt": "2014-12-05T20:20:39Z",
    "daysSinceLatestRelease": 124,
    "versionCount": 316,
    "releasesLast365Days": 1,
    "maintenanceStatus": "maintained",
    "deprecated": null,
    "deprecationMessage": null,
    "yanked": false,
    "dependencyCount": 2,
    "recentDownloads": 446673785,
    "recentDownloadsDays": 90,
    "totalDownloads": 1745600890,
    "vulnerabilityCount": 0,
    "maxSeverity": "none",
    "latestVersionVulnerabilityCount": 0,
    "vulnerabilities": [],
    "riskFlags": [],
    "healthScore": 100,
    "fetchedAt": "2026-11-20T05:09:42Z"
  }
]
```

A pinned, older version shows what an upgrade would fix. In a test run, `npm:lodash@4.17.20` returned four advisories (two high, two moderate) fixed in 4.17.21, 4.17.23 and 4.18.0, the flags `vulnerable`, `severe-vulnerability` and `outdated`, a health score of 55, and `latestVersionVulnerabilityCount` 0 for the latest version 4.18.1.

The health score starts at 100 and subtracts 40 for a critical or high advisory (else 20 for any advisory), 30 for a deprecated or yanked version, 25 for abandoned (else 15 for stale), 10 for no declared license and 5 for not being the latest version.

Entries that could not be audited (package not found, version not found, unknown prefix, registry error) are not saved to the dataset and are not charged. They are listed with the reason in the run's key-value store under the key `NOT_CHECKED`.

Download the dataset as JSON, CSV or Excel, or read it through the Apify API.

### Pricing

Pay per event: a small fee per run plus a fee per result saved. Platform usage is included in these prices.

| Event | When it is charged | Free plan | Bronze plan | Silver plan | Gold plan | Platinum plan | Diamond plan |
|---|---|---|---|---|---|---|---|
| Run started (`run-started`) | Flat fee once per run; covers starting the run and reading the input. | $0.025 | $0.02 | $0.018 | $0.016 | $0.016 | $0.016 |
| Package checked (`package-checked`) | One package version audited and saved to the dataset with status ok. | $0.0037 | $0.003 | $0.0027 | $0.0024 | $0.0024 | $0.0024 |

Example (lowest plan price): a run that saves 100 results costs $0.016 + 100 × $0.0024 = **$0.256**. That is $2.40 per 1,000 results plus $0.016 per run. You pay only for results saved to the dataset; set "Maximum cost per run" in the run options and the actor stops there.

Only packages audited with status `ok` are charged; not-found and failed entries are free. For example, auditing 200 packages costs $0.02 + 200 × $0.003 = $0.62.

### Limits

- One run saves at most 5,000 results and loads at most 30,000 pages. Larger jobs: split the start URLs over several runs.

- Default memory 512 MB; no proxy.

- When a limit is reached, the run ends normally and keeps every result saved so far; the status message says which limit it was.

- Covered registries: npm, crates.io and RubyGems. PyPI, Maven, Go and others are not covered.

- Each package takes three to five API requests; they count as pages in the limit above.

- crates.io allows one API request per second, so cargo packages are audited at about one per second; npm and RubyGems packages go faster.

- Vulnerability data is only as complete as OSV.dev. RustSec notices such as "unmaintained" are shown as the `unmaintained-advisory` flag, not as vulnerabilities.

- `dependencyCount` counts direct runtime dependencies only, not the whole dependency tree.

- `recentDownloads` covers 30 days on npm and 90 days on crates.io; RubyGems has no recent count, and npm has no all-time count.

- The health score is a rule-based heuristic, not a security guarantee.

Data sources and attribution: package data from the npm public registry, the crates.io API and index, and the RubyGems.org API; vulnerability data from [OSV.dev](https://osv.dev/), including the GitHub Advisory Database (CC-BY 4.0), RustSec (CC0 1.0) and OpenSSF Malicious Packages (Apache 2.0). This actor is not affiliated with or endorsed by npm, GitHub, the Rust Foundation, Ruby Central or Google.

### Use with AI agents

AI agents can call this actor as a tool through the Apify MCP server. Add it to an MCP client (Claude Desktop, Cursor, VS Code and others):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=saffo/package-health-audit"
    }
  }
}
```

Or call it over HTTP and get the results in the response:

```sh
curl -X POST "https://api.apify.com/v2/acts/saffo~package-health-audit/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"packages":["npm:express","cargo:serde","rubygems:rails"],"maxItems":3}'
```

### FAQ

#### How much does it cost?

You pay per event: from $0.0024 per package checked plus $0.016 per run. The Pricing section lists the price on every Apify plan. Platform usage is included, and the run stops at the maximum cost per run you set.

#### Can I use it from an AI agent or my own code?

Yes. Add it to any MCP client through the Apify MCP server, or call the Apify API; the examples under Use with AI agents show both. Results come back as JSON.

#### How many results can one run return?

Up to 5,000 results from at most 30,000 pages. For more, split the input over several runs.

#### Does it collect personal data?

No. It saves only the fields listed under Output and leaves out names, e-mail addresses, phone numbers and profiles of private persons.

#### Does it scan my package.json, Cargo.toml or Gemfile?

No, manifest files are not parsed. Paste the dependency names into **Packages**, with versions (`npm:lodash@4.17.20`) when you want to audit the exact versions you use.

#### Why is a package flagged outdated but not vulnerable?

`outdated` only means the checked version is not the latest stable one; `vulnerable` means OSV.dev lists at least one advisory for that exact version. An old version with no known advisory gets `outdated` (−5 on the score) but not `vulnerable`. Compare `vulnerabilityCount` with `latestVersionVulnerabilityCount` to see whether upgrading clears the advisories.

### Related actors

More actors by the same author on Apify Store:

- [Brand Ownership Lookup: Parent Company & Ultimate Owner](https://apify.com/saffo/brand-ownership-lookup): For each brand, product or company name, returns the owning company, the chain up to the ultimate parent with its LEI and stock tickers, and its major institutional shareholders, all from Wikidata.
- [Google Play Developer Portfolio Tracker](https://apify.com/saffo/play-developer-portfolio): Every app a Google Play developer page lists, with rating, installs, price, monetisation, release and update dates and its change since the last run, one row per app.
- [Google Play Ratings by Country](https://apify.com/saffo/play-ratings-by-country): Compares the star rating Google Play shows in each country for the apps you list, with star shares, price, spread and change since the last run, one report per app. Not affiliated with Google.

### Support

Open an issue on the actor's Issues tab.

### Changelog

#### 0.1 (2026-11-20)

- First release: audits npm, crates.io and RubyGems packages (latest version, license, release dates, deprecation and yank state, direct dependencies, downloads) with known vulnerabilities and fixed versions from OSV.dev, risk flags and a health score.

# Changelog

This Actor's version history is a separate document: https://apify.com/saffo/package-health-audit/changelog.md

# Actor input Schema

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

Packages to audit, one per entry, as "ecosystem:name" or "ecosystem:name@version" with ecosystem npm, cargo or rubygems (for example "npm:lodash@4.17.20", "cargo:serde", "rubygems:rails@7.0.0"). A name without prefix uses the default ecosystem; without a version the latest stable version is checked.

## `defaultEcosystem` (type: `string`):

Ecosystem used for entries without a prefix; one of npm, cargo, rubygems.

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

Stop after this many package rows (duplicates in the list are removed first). At most 5000 per run.

## Actor input object example

```json
{
  "packages": [
    "npm:express",
    "cargo:serde",
    "rubygems:rails"
  ],
  "defaultEcosystem": "npm",
  "maxItems": 200
}
```

# Actor output Schema

## `results` (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 = {
    "packages": [
        "npm:express",
        "cargo:serde",
        "rubygems:rails"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("saffo/package-health-audit").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 = { "packages": [
        "npm:express",
        "cargo:serde",
        "rubygems:rails",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("saffo/package-health-audit").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 '{
  "packages": [
    "npm:express",
    "cargo:serde",
    "rubygems:rails"
  ]
}' |
apify call saffo/package-health-audit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,saffo/package-health-audit"
        }
    }
}
```

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/zF1RFzuVUo3c7dCyC/builds/1pv7KmKkzxIR2ghxZ/openapi.json
