# npm & PyPI Package Monitor — Versions & Downloads (`vertaizen/package-registry-monitor`) Actor

Monitor npm & PyPI packages via the open registry APIs — latest version, publish date, monthly downloads, dependencies & maintainers. Monitor mode returns only CHANGES: new versions & download swings. Supply-chain security, devtools & investor signals. Pay per package.

- **URL**: https://apify.com/vertaizen/package-registry-monitor.md
- **Developed by:** [Diego Moragues](https://apify.com/vertaizen) (community)
- **Categories:** Developer tools, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 package checks

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## npm & PyPI Package Monitor — Supply-Chain, Version & Download Tracking

The **npm & PyPI package monitor** is a **supply-chain security** and **dependency monitoring** tool that watches your packages straight from the **open registry APIs** — no auth, no browser, no proxies. For any list of packages you get the **latest version**, **publish date**, **last-month downloads**, **dependencies**, **maintainers** and **repository**. Turn on **monitor mode** and it becomes a **package release monitor**: scheduled runs return only what **changed** — a **new version**, a **new maintainer**, or a significant **download swing** — so you catch a risky update or a compromised package early, and never miss a release you depend on.

Built on 100% public data: `registry.npmjs.org`, `api.npmjs.org`, `pypi.org` and `pypistats.org`. The highest-value angle is **supply-chain monitoring** — knowing the moment a dependency ships a new version or changes hands is a security signal, not just a devtools nicety.

### Why a package monitor beats a one-off registry lookup

| | **This Package Monitor** | Manual `npm view` / PyPI page checks |
|---|---|---|
| npm **and** PyPI in one run | ✅ Mixed list | ❌ Two tools |
| Only NEW versions on later runs | ✅ `new-version` diff | ❌ Re-check by hand |
| Download-swing detection | ✅ `download-change` (≥10%) | ❌ |
| New-maintainer / dependency drift | ✅ Emitted for review | ❌ |
| Webhook alerts on change | ✅ | ❌ |
| Supply-chain framing | ✅ Purpose-built | Ad hoc |
| Pay-per-result | ✅ | — |

### What you get for each package

```json
{
  "package": "react",
  "registry": "npm",
  "latestVersion": "18.3.1",
  "publishedAt": "2024-04-26T19:11:00.000Z",
  "totalVersions": 2100,
  "lastMonthDownloads": 92000000,
  "downloadsChangePct": 4.2,
  "dependencies": ["loose-envify"],
  "maintainers": ["react-bot", "fb"],
  "homepage": "https://react.dev/",
  "repository": "https://github.com/facebook/react",
  "changeType": "baseline",
  "previousVersion": null,
  "checkedAt": "2026-07-02T12:00:00.000Z"
}
````

`changeType` is one of `"baseline"` (first time seen), `"new-version"` (a new release since last run), or `"download-change"` (downloads moved ≥10% on the same version). Outside monitor mode it is `null` — every package is a full snapshot.

### How to use it

1. **Add packages** — as `npm:name`, `pypi:name`, or a plain name (defaults to npm). Scoped npm packages like `npm:@babel/core` work too.
2. **(Optional) Include downloads / dependencies** — toggle the extra fields you want.
3. **(Optional) Enable monitor mode** — and schedule the actor (e.g. daily). Each run outputs only CHANGES per package. Combine with a **webhook** to push new releases to Slack, email or your CI.

### Use cases

Each of these is a real search buyers make:

- **"Monitor dependencies for supply-chain security"** — watch the packages your org depends on for unexpected version bumps, new maintainers, or repository changes that can signal a compromised package.
- **"Get an alert when a dependency ships a new version"** — schedule monitor mode + a webhook and get pinged the moment a release lands, so silent updates never slip into your build.
- **"Track npm/PyPI download trends for investor research"** — monthly download growth is a leading adoption signal for open-source-backed companies and devtools.
- **"Detect dependency drift over time"** — compare a package's declared dependencies across releases to catch surprise additions.
- **"Feed live package data to an AI agent"** — stream npm and PyPI intelligence to an LLM workflow via the Apify MCP server.

#### Dependency & supply-chain monitoring

The use with real budget behind it: point the actor at your production dependency list in monitor mode. Every run flags **new versions** (review before you upgrade), **download swings** (a sudden collapse or spike can indicate a problem), and gives you the current **maintainer list and repository** — so a package quietly changing hands or repo doesn't reach your build unnoticed. Wire it to a webhook and your security channel gets the signal first.

### Pricing

**Pay per package** — one charge per package result delivered to the dataset (`package-check` event). No subscription, no minimum. Packages that fail (typo, unpublished, unreachable) are **never pushed and never charged** — they are listed in the `FAILED` record of the run's key-value store. In monitor mode you are only charged for packages that actually changed.

### FAQ

#### Which registries are supported?

Two, both via their official public APIs: **npm** ([`registry.npmjs.org`](https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md) + `api.npmjs.org` for downloads) and **PyPI** ([`pypi.org/pypi/{pkg}/json`](https://docs.pypi.org/api/json/) + `pypistats.org` for downloads). No API key is required for either.

#### Can I get alerts when a dependency ships a new version?

Yes — that's the core workflow. Enable `monitorMode`, schedule the actor (e.g. daily), and attach an Apify [webhook or integration](https://docs.apify.com/platform/integrations) to the run. Every `new-version` change is pushed to Slack, email, or your CI the moment it's detected.

#### Does it detect new maintainers (a potential compromise signal)?

Every result includes the current `maintainers` list and `repository`, so you can diff them run over run to catch a package quietly changing hands or repo — one of the clearest early signals of a supply-chain risk. Combine with the `new-version` flag to review any release that also changed maintainers.

#### How does monitor mode decide what changed?

On the first run it stores each package's latest version and last-month downloads as a **baseline** (emitted once). On later runs it compares: a different latest version → `new-version`; the same version but downloads moved by ≥10% → `download-change`; otherwise nothing is output (and nothing is charged). State is kept in the named key-value store `PACKAGE-MONITOR-STATE`.

#### What happens to packages that don't exist or fail?

They are collected and written to the `FAILED` key-value record instead of the dataset, so a typo or an unpublished package never costs you anything. The run still succeeds for the rest.

#### PyPI download stats sometimes look empty — why?

Download counts for PyPI come from `pypistats.org`, a community service that can be rate-limited or briefly unavailable. When that happens the actor sets `lastMonthDownloads` to `null` and keeps going — version, dependency and maintainer data still come through from PyPI itself.

#### Can I track dependencies and maintainers?

Yes. Maintainers are always included. Dependencies of the latest release are included when you enable **Include dependencies** (capped by **Max dependencies per package**).

#### Can AI agents use this actor?

Yes. The input is a flat list of package identifiers and the output is clean JSON, so it works out of the box with the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) and any LLM / agent pipeline that needs live npm and PyPI package intelligence.

#### Does it scrape or use anything private?

No. It only calls the public, unauthenticated registry and stats endpoints listed above. There is no login, no scraping of HTML pages, and no proxy needed.

# Actor input Schema

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

Packages to check. Use `npm:name` or `pypi:name` (a plain name defaults to npm). Examples: `npm:react`, `pypi:requests`, `express`, `npm:@babel/core`.

## `maxVersionsPerPackage` (type: `integer`):

Safety cap on how many dependency names are returned per package (when 'Include dependencies' is on).

## `includeDownloads` (type: `boolean`):

Fetch last-month download counts (npm downloads API + PyPI pypistats). PyPI download stats are skipped gracefully if the stats API is unreachable.

## `includeDependencies` (type: `boolean`):

Include the list of the latest version's runtime dependencies for each package.

## `monitorMode` (type: `boolean`):

Remember each package's latest version and last-month downloads between runs, and output only CHANGES: a new published version, or a significant download swing (≥10%). The first run records a baseline. Ideal for scheduled runs + webhooks (new-release alerts).

## Actor input object example

```json
{
  "packages": [
    "npm:react",
    "pypi:requests",
    "npm:express"
  ],
  "maxVersionsPerPackage": 20,
  "includeDownloads": true,
  "includeDependencies": false,
  "monitorMode": false
}
```

# 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:react",
        "pypi:requests",
        "npm:express"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vertaizen/package-registry-monitor").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:react",
        "pypi:requests",
        "npm:express",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("vertaizen/package-registry-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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:react",
    "pypi:requests",
    "npm:express"
  ]
}' |
apify call vertaizen/package-registry-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=vertaizen/package-registry-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "npm & PyPI Package Monitor — Versions & Downloads",
        "description": "Monitor npm & PyPI packages via the open registry APIs — latest version, publish date, monthly downloads, dependencies & maintainers. Monitor mode returns only CHANGES: new versions & download swings. Supply-chain security, devtools & investor signals. Pay per package.",
        "version": "1.0",
        "x-build-id": "Ygw8hygJWm5mgfEON"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/vertaizen~package-registry-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-vertaizen-package-registry-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/vertaizen~package-registry-monitor/runs": {
            "post": {
                "operationId": "runs-sync-vertaizen-package-registry-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/vertaizen~package-registry-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-vertaizen-package-registry-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "packages"
                ],
                "properties": {
                    "packages": {
                        "title": "Packages",
                        "type": "array",
                        "description": "Packages to check. Use `npm:name` or `pypi:name` (a plain name defaults to npm). Examples: `npm:react`, `pypi:requests`, `express`, `npm:@babel/core`.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxVersionsPerPackage": {
                        "title": "Max dependencies per package",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Safety cap on how many dependency names are returned per package (when 'Include dependencies' is on).",
                        "default": 20
                    },
                    "includeDownloads": {
                        "title": "Include download stats",
                        "type": "boolean",
                        "description": "Fetch last-month download counts (npm downloads API + PyPI pypistats). PyPI download stats are skipped gracefully if the stats API is unreachable.",
                        "default": true
                    },
                    "includeDependencies": {
                        "title": "Include dependencies",
                        "type": "boolean",
                        "description": "Include the list of the latest version's runtime dependencies for each package.",
                        "default": false
                    },
                    "monitorMode": {
                        "title": "Monitor mode — only CHANGES",
                        "type": "boolean",
                        "description": "Remember each package's latest version and last-month downloads between runs, and output only CHANGES: a new published version, or a significant download swing (≥10%). The first run records a baseline. Ideal for scheduled runs + webhooks (new-release alerts).",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
