# Crates.io, RubyGems & NuGet Package Intelligence API (`regenerative_cornice/crates-rubygems-nuget-intel`) Actor

Query Rust Crates.io, RubyGems.org, and .NET NuGet registries in one unified JSON schema for versions, total & recent downloads, licenses, authors/owners, repo links, and update timestamps. Zero API keys. Built for DevTools, AppSec, VCs, n8n, and AI agents (MCP).

- **URL**: https://apify.com/regenerative_cornice/crates-rubygems-nuget-intel.md
- **Developed by:** [John Erlbacher](https://apify.com/regenerative_cornice) (community)
- **Categories:** Developer tools, Business, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 multi-registry package intels

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

## Crates.io, RubyGems & NuGet Package Intelligence API

**Query Rust (Crates.io), Ruby (RubyGems.org), and .NET (NuGet) official public package registries in a single unified JSON schema — extracting latest versions, total & recent downloads, SPDX licenses, descriptions, homepages, source repositories, authors/owners, version counts, and UTC update timestamps with zero API keys required.**

Built for **DevTools growth teams, software supply-chain & SBOM auditors, VC/open-source diligence, n8n/Make/Zapier automation workflows, and AI coding agents via Model Context Protocol (MCP)**.

***

### Why Use This Actor?

Enterprise engineering teams, security scanners, and developer-ecosystem analysts regularly track dependencies across **Rust**, **Ruby**, and **.NET** — yet each package registry exposes completely different REST conventions, pagination styles, license encodings, and author/owner schemas:

- **Crates.io** nests license metadata inside individual version records, separates crate owners onto a dedicated `/owners` endpoint, and enforces a strict descriptive `User-Agent` and 1 req/sec crawler policy.
- **RubyGems.org** returns gem metadata at `/api/v1/gems/{name}.json` with comma-separated author strings and stores total version history separately at `/api/v1/versions/{name}.json`.
- **.NET NuGet** serves download counts and version arrays from Azure Search (`azuresearch-usnc.nuget.org/query`), while SPDX `licenseExpression`, git `repository` URLs, and `published` timestamps live in NuGet v3 registration leaves and catalog entries.

This Actor abstracts all three official public APIs behind **one flat, deterministic JSON record format**:

- **Zero API Keys & 100% Official APIs**: Queries only documented public JSON endpoints (`crates.io`, `rubygems.org`, `azuresearch-usnc.nuget.org`, `api.nuget.org`). No HTML scraping, no cookies, no authentication tokens.
- **Crates.io Policy Compliant**: Automatically sends a descriptive `User-Agent` header and paces Crates.io requests cleanly while querying RubyGems and NuGet in parallel.
- **Flexible Input Parsing**: Accepts `ecosystem:name` prefixes (`crates:tokio`, `rubygems:rails`, `nuget:Newtonsoft.Json`), ecosystem aliases (`cargo:`, `rust:`, `ruby:`, `gem:`, `dotnet:`, `csharp:`), or full public package URLs (`https://crates.io/crates/serde`, `https://rubygems.org/gems/sidekiq`, `https://www.nuget.org/packages/Serilog`).
- **Clean Metadata Normalization**: Normalizes SPDX licenses (converting legacy slash syntax like `MIT/Apache-2.0` to `MIT OR Apache-2.0` and resolving NuGet catalog `licenseExpression`), upgrades git/SSH repository links to clean HTTPS URLs, deduplicates authors and owners, and formats all timestamps as canonical UTC ISO-8601 (`YYYY-MM-DDTHH:MM:SSZ`).
- **Lightweight & Resilient**: Built on `httpx` async I/O with configurable concurrency, exponential backoff retries on HTTP 429/5xx responses, graceful fallbacks for secondary enrichment endpoints, and a minimal 256–512 MB memory footprint.

***

### Input Parameters

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `packages` | `array<string>` | `["crates:tokio", "rubygems:rails", "nuget:Newtonsoft.Json"]` | List of packages in `ecosystem:name` format (`crates:tokio`, `rubygems:rails`, `nuget:Newtonsoft.Json`) or full Crates.io, RubyGems.org, or NuGet.org URLs. |
| `maxConcurrency` | `integer` | `5` | Maximum number of packages queried concurrently (`1`–`20`). Crates.io calls are additionally paced to respect its crawler guidelines. |

#### Example Input

```json
{
  "packages": [
    "crates:tokio",
    "crates:serde",
    "rubygems:rails",
    "rubygems:sidekiq",
    "nuget:Newtonsoft.Json",
    "nuget:Serilog",
    "https://crates.io/crates/axum",
    "https://rubygems.org/gems/puma",
    "https://www.nuget.org/packages/Dapper"
  ],
  "maxConcurrency": 5
}
```

***

### Output Schema & Example Record

Every valid package produces one structured JSON object in the default Apify Dataset with identical fields across Rust, Ruby, and .NET:

```json
{
  "packageId": "crates:tokio",
  "ecosystem": "crates",
  "packageName": "tokio",
  "latestVersion": "1.54.1",
  "totalDownloads": 1230462530,
  "recentDownloads": 325340416,
  "license": "MIT",
  "description": "An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications.",
  "homepageUrl": "https://tokio.rs",
  "repositoryUrl": "https://github.com/tokio-rs/tokio",
  "authorsOrOwners": [
    "Carl Lerche",
    "Alice Ryhl",
    "github:tokio-rs:core"
  ],
  "updatedAtUtc": "2026-10-21T21:05:43Z",
  "versionsCount": 201,
  "registryUrl": "https://crates.io/crates/tokio",
  "profiledAtUtc": "2026-11-22T19:05:00Z"
}
```

#### Cross-Registry Field Normalization Notes

| Field | Rust Crates.io (`crates`) | RubyGems.org (`rubygems`) | .NET NuGet (`nuget`) |
| --- | --- | --- | --- |
| `latestVersion` | `max_stable_version` (fallback `newest_version`) | `version` | Latest stable `version` (`prerelease=false`) |
| `totalDownloads` | All-time `downloads` | All-time `downloads` | All-time `totalDownloads` |
| `recentDownloads` | Trailing 90-day `recent_downloads` | Latest version `version_downloads` | Latest version `downloads` |
| `license` | Latest version SPDX `license` | Joined `licenses` array | Catalog `licenseExpression` |
| `authorsOrOwners` | Crate `/owners` (fallback `published_by`) | Parsed `authors` list | Deduplicated `authors` + `owners` |
| `updatedAtUtc` | Crate `updated_at` (UTC) | `version_created_at` (UTC) | Registration/catalog `published` (UTC) |
| `versionsCount` | Total published versions | Count from `/api/v1/versions/{name}.json` | Count of stable `versions` |
| `registryUrl` | `https://crates.io/crates/{name}` | `https://rubygems.org/gems/{name}` | `https://www.nuget.org/packages/{name}` |

***

### Pricing (Pay-Per-Event)

This Actor uses transparent **Pay-Per-Event (PPE)** pricing — you pay only when a valid package profile is successfully fetched and stored in your dataset. Missing packages (HTTP 404) and malformed specs are skipped at zero cost, and deterministic idempotency keys (`reg-{ecosystem}-{packageName}`) prevent duplicate billing.

| Event Name | Unit | Description | Price Range |
| --- | --- | --- | --- |
| `package-intel` | 1 package | One structured Rust Crates.io, RubyGems, or NuGet package profile | **$0.0025 – $0.004 / package** |

> Auditing 100 dependencies from a `Cargo.toml`, `Gemfile`, or `.csproj` file costs roughly **$0.25–$0.40** and completes in seconds. You can cap total spend per run directly in Apify Console.

***

### Automation & AI Agent Recipes

#### 1. Multi-Language SBOM & License Audit (n8n / Make + Slack)

1. **Trigger**: Schedule weekly or trigger on pull-request dependency changes (`Cargo.toml`, `Gemfile.lock`, `packages.config`).
2. **Apify Node**: Run `crates-rubygems-nuget-intel` with your organization's tracked packages.
3. **Filter / Alert**: Flag packages with missing or copyleft `license` values, stale `updatedAtUtc` timestamps, or sudden drops in `recentDownloads`, and post a concise digest to Slack or Jira.

#### 2. AI Coding Agents via Apify MCP Server

Connect `crates-rubygems-nuget-intel` to **Claude Desktop, Cursor, or Windsurf** via the [Apify MCP Server](https://mcp.apify.com) to inspect dependencies before adding them to production code:

- *"Query `crates:tokio`, `crates:async-std`, and `crates:smol` using `crates-rubygems-nuget-intel` and compare their recent downloads, licenses, and last update dates."*
- *"Profile `nuget:Newtonsoft.Json`, `nuget:Serilog`, and `rubygems:rails` to verify licenses, owners, and official repository links."*

***

### Official Public Data Sources

- **Rust Crates.io API**: `https://crates.io/api/v1/crates/{name}`
- **RubyGems.org API**: `https://rubygems.org/api/v1/gems/{name}.json`
- **.NET NuGet Search & V3 Registration API**: `https://azuresearch-usnc.nuget.org/query?q=packageid:{name}&prerelease=false`

# Actor input Schema

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

List of packages in 'ecosystem:name' format (e.g. 'crates:tokio', 'rubygems:rails', 'nuget:Newtonsoft.Json') or full Crates.io, RubyGems.org, or NuGet.org package URLs.

## `maxConcurrency` (type: `integer`):

Maximum number of packages fetched concurrently (1 to 20). Default 5 balances speed with respectful registry rate limits (Crates.io requests are additionally paced to respect its crawler policy).

## Actor input object example

```json
{
  "packages": [
    "crates:tokio",
    "rubygems:rails",
    "nuget:Newtonsoft.Json"
  ],
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Structured overview table of profiled Crates.io, RubyGems, and NuGet packages with versions, downloads, licenses, and repository URLs.

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

All normalized Rust Crates.io, RubyGems, and NuGet package intelligence records in the default dataset.

# 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": [
        "crates:tokio",
        "rubygems:rails",
        "nuget:Newtonsoft.Json"
    ],
    "maxConcurrency": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("regenerative_cornice/crates-rubygems-nuget-intel").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": [
        "crates:tokio",
        "rubygems:rails",
        "nuget:Newtonsoft.Json",
    ],
    "maxConcurrency": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("regenerative_cornice/crates-rubygems-nuget-intel").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": [
    "crates:tokio",
    "rubygems:rails",
    "nuget:Newtonsoft.Json"
  ],
  "maxConcurrency": 5
}' |
apify call regenerative_cornice/crates-rubygems-nuget-intel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,regenerative_cornice/crates-rubygems-nuget-intel"
        }
    }
}
```

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/gciG0dH654sIhWTeQ/builds/5QIw0IyEQglLmnu7B/openapi.json
