# PyPI Package Version Delta Monitor (`collinjreynolds/pypi-package-version-delta-monitor`) Actor

Monitors public PyPI packages for new versions via the official JSON API and emits only deltas. First run baselines without charging. PPE event: version-delta.

- **URL**: https://apify.com/collinjreynolds/pypi-package-version-delta-monitor.md
- **Developed by:** [Collin Reynolds](https://apify.com/collinjreynolds) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 new pypi package versions

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

## PyPI Package Version Delta Monitor

Watch public **PyPI packages** for **new versions** via the official JSON API (`pypi.org/pypi/{package}/json`). Only **deltas** since the last run are written to the dataset — ideal for dependency monitoring, SBOM/ops agents, and scheduled changelogs.

**Pricing (pay per event):** **`$0.001` per `version-delta`** (each newly detected package version). Actor start is a small platform event (~`$0.00005`). First run baselines quietly (0 dataset items / 0 delta charges) so you are not billed for history.

**Status:** **Store-ready locally — NOT published.** Real `exampleRunInput` (`requests`/`httpx`/`pydantic` — not helloWorld); dataset uses `package_description` (not reserved `description`/`title`); silent-baseline tests green. Do **not** `apify push` / `isPublic` until parent clears the publication window.

### Why use this

- **API-only** — official PyPI project JSON (no HTML scraping)
- **Delta-only** — subsequent runs emit new versions only
- **First-run safe** — empty state seeds `LAST_SEEN` with zero PPE delta charges
- **No auth required** for public packages
- **Schedule-friendly** — pair with an Apify schedule for continuous monitoring
- **PEP 440 prereleases** detectable (`a`/`b`/`rc`/`dev` and hyphenated forms)

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `packages` | yes | List of PyPI project names |
| `sinceVersion` | no | On first run for a package, treat this version and older (by upload time) as already seen |
| `includePrereleases` | no | Include PEP 440 prereleases (default true) |
| `resetState` | no | Clear `LAST_SEEN` and re-baseline (0 emits that run) |

#### Example / exampleRunInput (not helloWorld)

Canonical: [`INPUT.example.json`](./INPUT.example.json) (= `.actor/example_run_input.json`).

```json
{
  "packages": ["requests", "httpx", "pydantic"],
  "includePrereleases": true,
  "resetState": false
}
```

### Output

Each dataset item is a newly detected version, for example:

- `package`, `version`, `published_at`, `package_description`, `is_prerelease`, `is_latest`, `registry_url`, `tarball_url`

### First-run behavior

| Situation | Dataset items | `version-delta` charges |
|-----------|---------------|-------------------------|
| Empty state, no `sinceVersion` | **0** | **0** (baseline only) |
| Empty state + `sinceVersion` | Only newer than that version | 1 per item |
| Later runs | New version strings only | 1 per item |

### Tips

1. Run once to baseline, then attach a **schedule** (e.g. hourly/daily).
2. Keep package lists focused — each project fetch is one HTTP GET.
3. Set a user **max total charge** on the run so costs stay predictable.

### ToS / scope

Uses the public PyPI JSON API only. See [AGREEMENT.md](./AGREEMENT.md). Respect PyPI / Warehouse terms and fair use.

### Store / Console

- **Store-ready locally — NOT published.** No Actor id. No `isPublic`. No `apify push` this turn.
- Publish-day checklist: PUT `exampleRunInput` from `INPUT.example.json`; PPE `version-delta` **$0.001**; LIMITED\_PERMISSIONS; DEVELOPER\_TOOLS/OPEN\_SOURCE/AI; memory 512; timeout 300; smoke must show first-run **0** deltas.

# Actor input Schema

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

List of public PyPI project names (e.g. requests, httpx, pydantic).

## `sinceVersion` (type: `string`):

If set and no LAST\_SEEN snapshot exists for a package, treat this version (and older by upload time) as already seen so only newer versions are emitted.

## `includePrereleases` (type: `boolean`):

If false, skip PEP 440 prerelease versions (a/b/rc/dev or hyphenated, e.g. 2.0.0a1).

## `resetState` (type: `boolean`):

If true, ignore and clear the stored LAST\_SEEN fingerprint map before this run.

## Actor input object example

```json
{
  "packages": [
    "requests",
    "httpx",
    "pydantic"
  ],
  "includePrereleases": true,
  "resetState": false
}
```

# Actor output Schema

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

Dataset items for newly detected versions (package, version, published\_at, etc.). First run baselines with 0 items.

# 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": [
        "requests",
        "httpx",
        "pydantic"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("collinjreynolds/pypi-package-version-delta-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": [
        "requests",
        "httpx",
        "pydantic",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("collinjreynolds/pypi-package-version-delta-monitor").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": [
    "requests",
    "httpx",
    "pydantic"
  ]
}' |
apify call collinjreynolds/pypi-package-version-delta-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,collinjreynolds/pypi-package-version-delta-monitor"
        }
    }
}
```

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/2lzTlZSEDTt38upxM/builds/coFKGgrvElsPb1jx2/openapi.json
