# crates.io Package Version Delta Monitor (`collinjreynolds/crates-io-version-delta-monitor`) Actor

Monitors public crates.io crates for new versions via the official HTTP API and emits only deltas. First run baselines without charging. PPE event: version-delta. Respects crates.io User-Agent + 1 RPS guidance.

- **URL**: https://apify.com/collinjreynolds/crates-io-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 crates.io crate 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

## crates.io Package Version Delta Monitor

Watch public **crates.io crates** for **new versions** via the official HTTP API (`crates.io/api/v1/crates/{crate}`). Only **deltas** since the last run are written to the dataset — ideal for Rust dependency monitoring, SBOM/ops agents, and scheduled changelogs.

**Pricing (pay per event):** **`$0.001` per `version-delta`** (each newly detected crate 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:** Publishing to Apify Store under standing auth (B). Real `exampleRunInput` (`serde`/`tokio`/`clap` — not helloWorld); dataset uses `crate_description` (not reserved `description`/`title`); silent-baseline tests green.

### Why use this

- **API-only** — official crates.io 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 crates
- **Schedule-friendly** — pair with an Apify schedule for continuous monitoring
- **Semver prereleases** + **yanked** filterable

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `crates` | yes | List of crates.io crate names |
| `sinceVersion` | no | On first run for a crate, treat this version and older (by `created_at`) as already seen |
| `includePrereleases` | no | Include semver prereleases (default true) |
| `includeYanked` | no | Include yanked versions (default false) |
| `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
{
  "crates": ["serde", "tokio", "clap"],
  "includePrereleases": true,
  "includeYanked": false,
  "resetState": false
}
```

### Output

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

- `crate`, `version`, `published_at`, `crate_description`, `is_prerelease`, `is_yanked`, `is_latest`, `registry_url`, `download_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 crate lists focused — Actor sleeps ~1s between crates to respect crates.io ≤1 RPS guidance.
3. Set a clear User-Agent (this Actor does) and a user **max total charge** on the run.

### ToS / scope

Uses the public crates.io HTTP API only. See [AGREEMENT.md](./AGREEMENT.md) and https://crates.io/data-access.

### Store / Console

- **Store:** https://apify.com/collinjreynolds/crates-io-version-delta-monitor
- **Console:** https://console.apify.com/actors/ (see LEDGER for Actor ID)
- Hygiene: PPE `version-delta` **$0.001**; LIMITED\_PERMISSIONS; DEVELOPER\_TOOLS/AI; memory 512; timeout 300; identifying User-Agent + ≤1 RPS; first-run silent baseline (0 deltas).

# Actor input Schema

## `crates` (type: `array`):

List of public crates.io crate names (e.g. serde, tokio, clap).

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

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

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

If false, skip semver prerelease versions (hyphenated, e.g. 1.0.0-alpha.1).

## `includeYanked` (type: `boolean`):

If false, skip yanked crate versions when seeding/emitting.

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

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

## Actor input object example

```json
{
  "crates": [
    "serde",
    "tokio",
    "clap"
  ],
  "includePrereleases": true,
  "includeYanked": false,
  "resetState": false
}
```

# Actor output Schema

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

Dataset items for newly detected versions (crate, 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 = {
    "crates": [
        "serde",
        "tokio",
        "clap"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("collinjreynolds/crates-io-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 = { "crates": [
        "serde",
        "tokio",
        "clap",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("collinjreynolds/crates-io-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 '{
  "crates": [
    "serde",
    "tokio",
    "clap"
  ]
}' |
apify call collinjreynolds/crates-io-version-delta-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,collinjreynolds/crates-io-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/dmcwxcUQZaaGVtxYm/builds/j23j2JhD0v8yrCH5t/openapi.json
