# Package Registry Stats: npm, PyPI, Maven, Cargo, Go (`datacrate/package-registry-stats`) Actor

Is this open-source package maintained, popular and safe? Downloads, dependents, latest release, licence, GitHub stars and security advisories for npm, PyPI, Maven, Cargo, NuGet, Go and more. Daily new-release feed with delta mode.

- **URL**: https://apify.com/datacrate/package-registry-stats.md
- **Developed by:** [Data Crate](https://apify.com/datacrate) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.64 / 1,000 package returneds

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 Registry Stats: npm, PyPI, Maven, Cargo, NuGet, Go and more

**Look up any open-source package, list the top packages of a registry, or follow a daily feed of new releases. One clean schema for npm, PyPI, Maven Central, crates.io, NuGet, Go, RubyGems, Packagist, pub.dev and CocoaPods.**

Each row has the latest version and release date, downloads, dependent repositories and packages, licence, GitHub stars, repository health (active, slow, stale, archived, deprecated) and the published security advisories with severity. No API keys, no browser, no proxies.

**First run cost:** the default run returns 6 packages for about **$0.005** at **$0.0008 per package** (the first 5 seconds of compute are covered by Apify). 1,000 packages cost about **$0.80**, less on higher Apify plans.

### Who it is for

- Engineering and security teams doing **dependency due diligence**: is this library maintained, widely used, safely licensed, and free of open advisories?
- **Open-source analysts and journalists** tracking which packages are growing.
- **Release monitors**: a daily feed of newly published versions in a registry, with delta mode so you only pay for what is new.
- Anyone who wants the same columns for npm, PyPI, Cargo, Maven and NuGet instead of five different scrapers.

### Modes

| Mode | What you get |
|---|---|
| `lookup` | Stats for the packages you list, e.g. `npm:react`, `pypi:requests`, `cargo:serde`, `maven:org.apache.commons:commons-lang3`, `nuget:Newtonsoft.Json`, `go:github.com/gin-gonic/gin`, or a package URL such as `pkg:npm/lodash`. Up to 500 per run. |
| `recentReleases` | Packages of one registry whose latest release is newer than N days (default 1 day), newest first. Filter out placeholder packages with `minDownloads`. |
| `top` | The most downloaded, most depended-on, most starred, or newest packages of a registry. |
| `keyword` | Packages tagged with a keyword (for example `machine-learning`) in one registry, ranked by your sort field. Ranks the first ~200 packages the index returns for that keyword, so treat it as a sample, not a complete census. |

Filters: `minDownloads`, `minDependentRepos`, `minStars`, `licenses` (SPDX ids), `onlyWithAdvisories`, `excludeDeprecated`.

**Delta mode** (`onlyNewSinceLastRun`): in `recentReleases` each package version is returned once; in `top`/`keyword` each package is returned once. Use a different `stateKey` per watchlist. The first run sets the baseline and returns everything. State is stored in the named key-value store `package-registry-stats-state`.

### Input

| Field | Meaning |
|---|---|
| `mode` | `lookup`, `recentReleases`, `top` or `keyword` |
| `packages` | lookup: `ecosystem:name` per line |
| `ecosystem` | npm, pypi, cargo, maven, nuget, go, rubygems, packagist, pub, cocoapods |
| `keyword` | keyword mode |
| `sinceDays` | recentReleases window (1 to 365) |
| `sortBy` | downloads, dependent_repos_count, dependent_packages_count, stargazers_count, latest_release_published_at, created_at |
| `minDownloads`, `minDependentRepos`, `minStars`, `licenses`, `onlyWithAdvisories`, `excludeDeprecated` | filters |
| `maxItems` | cap on rows and cost (default 50) |
| `onlyNewSinceLastRun`, `stateKey` | delta mode |

Default input (works with one click):

```json
{ "mode": "lookup", "packages": ["npm:react", "pypi:requests", "cargo:serde", "maven:org.apache.commons:commons-lang3", "nuget:Newtonsoft.Json", "go:github.com/gin-gonic/gin"], "maxItems": 50 }
```

A daily release feed for npm, skipping tiny placeholder packages:

```json
{ "mode": "recentReleases", "ecosystem": "npm", "sinceDays": 1, "minDownloads": 1000, "onlyNewSinceLastRun": true, "maxItems": 500 }
```

### Sample output (trimmed)

```json
{
  "purl": "pkg:pypi/requests",
  "ecosystem": "pypi",
  "name": "requests",
  "latestVersion": "2.34.2",
  "latestReleaseAt": "2026-05-14T19:25:26.000000Z",
  "daysSinceLatestRelease": 190,
  "downloads": 1509587786,
  "downloadsPeriod": "last-month",
  "dependentRepos": 679836,
  "dependentPackages": 32025,
  "licenses": ["Apache-2.0"],
  "repositoryUrl": "https://github.com/psf/requests",
  "stars": 54715,
  "health": "active",
  "advisoryCount": 8,
  "maxAdvisorySeverity": "HIGH",
  "advisories": [{ "id": "GHSA-...", "cve": "CVE-...", "severity": "HIGH", "title": "...", "url": "https://github.com/advisories/GHSA-..." }],
  "license": "CC-BY-SA-4.0",
  "attribution": "Package data: ecosyste.ms (https://ecosyste.ms), licensed CC BY-SA 4.0. ..."
}
```

Other columns: `registry`, `description`, `firstReleaseAt`, `versionsCount`, `homepage`, `registryUrl`, `installCommand`, `keywords`, `forks`, `openIssues`, `repoArchived`, `repoLastPushedAt`, `maintainersCount` (a count only, no names or emails), `critical`, `status`, `fundingLinks`, `isNew`, `checkedAt`.

### FAQ

**Where does the data come from?** The ecosyste.ms open API (packages.ecosyste.ms), which indexes the public registries and the GitHub Advisory Database. This actor does not scrape npmjs.com, pypi.org or any other registry website.

**Why are downloads empty for Maven and Go?** Those registries do not publish download counts. The column is `null`; use `dependentRepos` as the usage signal. `downloadsPeriod` tells you the window (npm and PyPI: last month; crates.io and NuGet: all-time totals).

**What does `advisoryCount` count?** Published, non-withdrawn advisories for the package across all versions, not only the latest one. Use it as a risk signal, then check the advisory for affected versions.

**How is `health` decided?** `deprecated` (registry status set), `archived` (repository archived), otherwise by days since the latest release: `active` up to 365, `slow` up to 730, `stale` beyond. It is a simple heuristic, not a security verdict.

**How fresh is it?** ecosyste.ms syncs registries continuously; new npm and PyPI releases usually appear within minutes to hours. Each row has `checkedAt`.

**Personal data?** None. Maintainer names and emails are deliberately not returned.

### Terms and licence evidence (checked 2026-11-20)

- ecosyste.ms docs, "Licences": "both the data and code are free to use in any capacity, including commercially, so long as ecosyste.ms is attributed". Data is **CC BY-SA 4.0**; every row carries `license` and `attribution` fields. If you redistribute a substantial portion of this data, the share-alike licence applies to you.
- `packages.ecosyste.ms/robots.txt`: `User-agent: * / Allow: /`.
- Rate limits are documented and unauthenticated access is allowed ("common pool"). The actor uses a few small requests per run and identifies itself with a descriptive User-Agent.

### Integrations

Schedule daily, send new releases to Slack or email with a webhook, or call it from an AI agent through the Apify MCP server. Dataset export: JSON, CSV, Excel.

### Pricing

Pay per result: **$0.0008 per package row** (volume tiers on higher Apify plans), plus Apify's usual start event. You pay only for rows returned; empty runs cost almost nothing. `maxItems` caps the bill.

### Changelog

- 1.0: first release (lookup, recentReleases, top, keyword; delta mode).

# Actor input Schema

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

lookup = stats for specific packages. recentReleases = packages that published a release in the last N days (a release feed). top = most downloaded / most depended-on packages of a registry. keyword = top packages tagged with a keyword.

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

One per line as ecosystem:name, e.g. npm:react, npm:@babel/core, pypi:requests, cargo:serde, maven:org.apache.commons:commons-lang3, nuget:Newtonsoft.Json, go:github.com/gin-gonic/gin. Package URLs (pkg:npm/lodash) also work.

## `ecosystem` (type: `string`):

Which package registry to scan.

## `keyword` (type: `string`):

Package keyword, e.g. machine-learning, cli, react, authentication.

## `sinceDays` (type: `integer`):

Only packages whose latest release is newer than this (1 to 365). Use 1 for a daily feed.

## `sortBy` (type: `string`):

Ranking field, highest first.

## `minDownloads` (type: `integer`):

Keep packages with at least this many downloads (period shown in the downloadsPeriod column; usually last month).

## `minDependentRepos` (type: `integer`):

Keep packages used by at least this many repositories.

## `minStars` (type: `integer`):

Keep packages whose linked repository has at least this many stars.

## `licenses` (type: `array`):

Keep only packages with one of these SPDX licences, e.g. MIT, Apache-2.0. Empty = any.

## `onlyWithAdvisories` (type: `boolean`):

Keep only packages with at least one published advisory.

## `excludeDeprecated` (type: `boolean`):

Drop packages marked deprecated/removed or whose repository is archived.

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

Upper bound on rows (and on cost).

## `onlyNewSinceLastRun` (type: `boolean`):

recentReleases, top and keyword modes: skip packages/versions already returned by an earlier run with the same state name. The first run returns everything and sets the baseline.

## `stateKey` (type: `string`):

Use different names to keep separate watchlists.

## Actor input object example

```json
{
  "mode": "lookup",
  "packages": [
    "npm:react",
    "pypi:requests",
    "cargo:serde",
    "maven:org.apache.commons:commons-lang3",
    "nuget:Newtonsoft.Json",
    "go:github.com/gin-gonic/gin"
  ],
  "ecosystem": "npm",
  "sinceDays": 1,
  "sortBy": "downloads",
  "minDownloads": 0,
  "minDependentRepos": 0,
  "minStars": 0,
  "licenses": [],
  "onlyWithAdvisories": false,
  "excludeDeprecated": false,
  "maxItems": 50,
  "onlyNewSinceLastRun": false,
  "stateKey": "default"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per package: downloads, dependents, latest release, licence, advisories and repository health.

# 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 = {
    "mode": "lookup",
    "packages": [
        "npm:react",
        "pypi:requests",
        "cargo:serde",
        "maven:org.apache.commons:commons-lang3",
        "nuget:Newtonsoft.Json",
        "go:github.com/gin-gonic/gin"
    ],
    "ecosystem": "npm",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacrate/package-registry-stats").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 = {
    "mode": "lookup",
    "packages": [
        "npm:react",
        "pypi:requests",
        "cargo:serde",
        "maven:org.apache.commons:commons-lang3",
        "nuget:Newtonsoft.Json",
        "go:github.com/gin-gonic/gin",
    ],
    "ecosystem": "npm",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("datacrate/package-registry-stats").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 '{
  "mode": "lookup",
  "packages": [
    "npm:react",
    "pypi:requests",
    "cargo:serde",
    "maven:org.apache.commons:commons-lang3",
    "nuget:Newtonsoft.Json",
    "go:github.com/gin-gonic/gin"
  ],
  "ecosystem": "npm",
  "maxItems": 50
}' |
apify call datacrate/package-registry-stats --silent --output-dataset

```

## MCP server setup

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

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/hNsdx5Fweml0C4crl/builds/edvReE5FOqlncOqM1/openapi.json
