# crates.io Scraper — Rust Packages & Downloads (`hipersoft/crates-scraper`) Actor

Search crates.io or look up exact Rust crates and get description, downloads, versions, license, keywords, categories, repository and documentation links. Clean public API, no key.

- **URL**: https://apify.com/hipersoft/crates-scraper.md
- **Developed by:** [hiper soft](https://apify.com/hipersoft) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.004 / crate scraped

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## crates.io Scraper — Rust Packages, Downloads, Versions & Licenses

Search crates.io or look up exact Rust crates by name and get back clean, structured JSON: description, all-time and recent download counts, latest and max-stable versions, license, keywords, categories, and repository, homepage and documentation links. It pulls from the official crates.io public API — **no account, no API key.** Built for Rust developers, dependency auditors and OSS analysts who need reliable, ready-to-use crate data. Export to JSON, CSV or Excel.

![crates.io Scraper input — search queries, exact crate names and sort order in the Apify Console](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/crates-scraper-input.png)

### Features

- 🔎 **Free-text search** — run any crates.io query (`web framework`, `async runtime`) and collect matching crates in bulk.
- 🎯 **Exact lookups** — pass precise crate names like `tokio` or `serde` and combine them with search results in one run.
- 📊 **Download metrics** — capture both all-time `downloads` and `recentDownloads` for popularity and trend analysis.
- 🗂️ **Rich detail** — optional per-crate detail adds `license`, `keywords`, `categories` and version count/size.
- ↕️ **Flexible sorting** — order results by relevance, all-time downloads, recent downloads, recent updates or newest.
- 🔗 **Ready-to-use links** — every record includes `repository`, `documentation` (docs.rs fallback), `homepage` and the canonical `cratesUrl`.
- ⚙️ **Reliable by design** — descriptive User-Agent plus retry-with-backoff so runs finish cleanly.

### What you get

Each crate becomes one clean JSON record.

![crates.io Scraper output example — Rust crates with downloads, versions, license and repository links as structured JSON](https://api.apify.com/v2/key-value-stores/SUfvnaFLd9z9eBCtV/records/crates-scraper-output.png?v=1)

```json
{
  "name": "tokio",
  "description": "An event-driven, non-blocking I/O platform for writing asynchronous I/O backed applications.",
  "downloads": 289456123,
  "recentDownloads": 41234567,
  "maxStableVersion": "1.38.0",
  "newestVersion": "1.38.0",
  "numVersions": 254,
  "license": "MIT",
  "latestVersion": "1.38.0",
  "latestSize": 812345,
  "keywords": ["async", "io", "non-blocking", "futures"],
  "categories": ["asynchronous", "network-programming"],
  "homepage": "https://tokio.rs",
  "documentation": "https://docs.rs/tokio",
  "repository": "https://github.com/tokio-rs/tokio",
  "createdAt": "2016-06-27T12:00:00.000000+00:00",
  "updatedAt": "2024-05-30T09:12:33.000000+00:00",
  "cratesUrl": "https://crates.io/crates/tokio"
}
```

#### Output schema

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | Crate name. |
| `description` | string | Short crate description. |
| `downloads` | integer | All-time download count. |
| `recentDownloads` | integer | Downloads in the recent period. |
| `maxStableVersion` | string | Highest stable version published. |
| `newestVersion` | string | Most recently published version (may be a pre-release). |
| `numVersions` | integer | Total number of published versions. |
| `license` | string | SPDX license identifier. |
| `latestVersion` | string | Version the detail metrics refer to. |
| `latestSize` | integer | Size of the latest version's `.crate` file in bytes. |
| `keywords` | array | Keywords assigned to the crate. |
| `categories` | array | crates.io categories the crate belongs to. |
| `homepage` | string (URL) | Project homepage URL. |
| `documentation` | string (URL) | Documentation URL (docs.rs fallback). |
| `repository` | string (URL) | Source repository URL. |
| `createdAt` | string (ISO date) | When the crate was first published. |
| `updatedAt` | string (ISO date) | When the crate was last updated. |
| `cratesUrl` | string (URL) | Canonical crates.io page for the crate. |

### Input

```json
{
  "queries": ["web framework", "async runtime"],
  "crates": ["tokio", "serde"],
  "sort": "downloads",
  "maxPerQuery": 50,
  "includeDetail": true
}
```

| Field | Description |
|-------|-------------|
| `queries` | Free-text crates.io searches (name, description, keywords). Each is scraped separately. |
| `crates` | Exact crate names to look up, combined with any search results. |
| `sort` | Result ordering: relevance, downloads, recent-downloads, recent-updates or new. |
| `maxPerQuery` | Maximum crates to collect per search query (1–1000). |
| `includeDetail` | Fetch each crate's detail for license, keywords, categories and version count/size. |

### Use cases

- Audit the licenses of crates used across your Rust workspace before shipping.
- Track download momentum to compare competing crates in a category.
- Build a catalog of crates for a topic (e.g. web frameworks) for research or content.
- Enrich an internal dependency dashboard with descriptions, versions and repo links.

### Pricing

Pay-per-event: you're billed a small amount per run and per item scraped — you only pay for what you get. See the **Pricing** tab for current rates.

### FAQ

**Do I need a crates.io account or API key?**
No. The actor reads from the official [crates.io](https://crates.io/) public JSON API, so no account, login or API key is required.

**How many crates can I scrape per run?**
Each free-text query can return up to 1000 crates (`maxPerQuery`), and you can add any number of exact crate names like `tokio` or `serde` in the `crates` field, all in one run.

**Is scraping crates.io allowed?**
This actor only reads publicly available crate data through the official crates.io API and sends a descriptive User-Agent as their crawler policy requests. Review the crates.io usage policy before large-scale or commercial reuse.

**What's the output format?**
Structured JSON — one record per crate with fields such as `description`, `downloads`, `recentDownloads`, `maxStableVersion`, `license`, `keywords`, `categories` and repository/docs links. Export as JSON, CSV, Excel or via the API.

**Can I sort or filter results?**
Yes. Use `sort` to order results by relevance, all-time downloads, recent downloads, recent updates or newest, and set `includeDetail` to add license, keywords, categories and version count/size per crate.

**Can I connect this Actor to other apps?**
The crates.io Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). It works with [Make](https://apify.com/integrations/make), [Zapier](https://apify.com/integrations/zapier), [Slack](https://docs.apify.com/platform/integrations/slack), [Airbyte](https://docs.apify.com/platform/integrations/airbyte), [GitHub](https://docs.apify.com/platform/integrations/github), [Google Drive](https://docs.apify.com/platform/integrations/drive) and [many more](https://apify.com/integrations), plus the [Apify API](https://docs.apify.com/api/v2), JavaScript/Python clients and MCP. Or use [webhooks](https://docs.apify.com/platform/integrations/webhooks) to trigger an action whenever a run finishes.

### Related Actors

Tracking packages across ecosystems? Pair this with our other developer-data scrapers:

- [npm Package Scraper](https://apify.com/hipersoft/npm-scraper) — search and look up npm packages with metadata, dependencies and downloads.
- [PyPI Package Scraper](https://apify.com/hipersoft/pypi-scraper) — metadata, dependencies, licenses and downloads for Python packages.
- [GitHub Scraper](https://apify.com/hipersoft/github-scraper) — repositories and user profiles with stars, topics, licenses and leads.
- [Docker Hub Scraper](https://apify.com/hipersoft/docker-hub-scraper) — image metadata, pulls, stars and tags from Docker Hub.

### Notes

This actor uses the public crates.io JSON API and reads only publicly available package data. It is an independent tool and is not affiliated with, endorsed by, or sponsored by crates.io or the Rust Foundation; "crates.io" and "Rust" are trademarks of their respective owners.

# Actor input Schema

## `queries` (type: `array`):

Free-text crates.io searches (name, description, keywords).

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

Look up specific crates by exact name, e.g. tokio, serde. Combined with any search results.

## `sort` (type: `string`):

Search result ordering.

## `maxPerQuery` (type: `integer`):

Maximum crates to collect per search query.

## `includeDetail` (type: `boolean`):

Fetch each crate's detail for license, keywords, categories and version count/size.

## Actor input object example

```json
{
  "queries": [
    "async runtime",
    "serialization"
  ],
  "crates": [
    "tokio",
    "serde"
  ],
  "sort": "relevance",
  "maxPerQuery": 50,
  "includeDetail": true
}
```

# 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 = {
    "queries": [
        "web framework"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hipersoft/crates-scraper").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 = { "queries": ["web framework"] }

# Run the Actor and wait for it to finish
run = client.actor("hipersoft/crates-scraper").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 '{
  "queries": [
    "web framework"
  ]
}' |
apify call hipersoft/crates-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/aEXdoUrmgwNDS8u79/builds/ihzD5Tu8ZEuVlEQzF/openapi.json
