# crates.io Rust Crates Scraper (`jonboyd544/crates-io-crates-scraper`) Actor

Search Rust crates on crates.io via the official API by keyword, category or keyword tag. Returns all-time and recent downloads, latest version, version count, dates, keywords, categories and repository links.

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

## Pricing

$2.00 / 1,000 results

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 Rust Crates Scraper

Search Rust crates on crates.io via the official API by keyword, category or keyword tag. Returns all-time and recent downloads, latest version, version count, dates, keywords, categories and repository links.

Uses only official/public data endpoints, paces requests to respect the source's rate limits, retries transient errors, removes duplicates and returns clean, flat, consistently typed JSON, CSV or Excel.

### Use cases

- Rust ecosystem and dependency research
- Tracking crate popularity over time
- Finding projects for developer marketing

### Input

| Field | Type | Description | Default |
|---|---|---|---|
| `query` | string | Search term (empty = all crates). | — |
| `category` | string | e.g. web-programming, cryptography. | — |
| `keyword` | string | e.g. tokio, cli. | — |
| `sort` | string | Result order. | "downloads" |
| `minDownloads` | integer | Only crates with at least this many all-time downloads. | 0 |
| `contact` | string | Your email or URL, added to the User-Agent as crates.io recommends. | — |
| `maxItems` | integer | Maximum number of results to save (and pay for). The run stops as soon as this many unique results are saved. | 100 |

Example input:

```json
{
  "query": "async",
  "maxItems": 20
}
```

### Output

Each result is one flat record with these fields (missing values are `null`, lists are `[]`):

| Field | Type |
|---|---|
| `name` | string |
| `description` | string |
| `version` | string |
| `downloads` | integer |
| `recentDownloads` | integer |
| `versionCount` | integer |
| `createdAt` | string |
| `updatedAt` | string |
| `keywords` | array |
| `categories` | array |
| `repository` | string |
| `homepage` | string |
| `documentation` | string |
| `url` | string |

Example result:

```json
{
  "name": "once_cell",
  "description": "Single assignment cells and lazy values.",
  "version": "1.21.4",
  "downloads": 1455979795,
  "recentDownloads": 353731287,
  "versionCount": 67,
  "createdAt": "2018-08-02T00:12:48.969947Z",
  "updatedAt": "2026-03-12T10:59:52.512992Z",
  "keywords": [],
  "categories": [],
  "repository": "https://github.com/matklad/once_cell",
  "homepage": null,
  "documentation": "https://docs.rs/once_cell",
  "url": "https://crates.io/crates/once_cell"
}
```

The **Overview** dataset view shows the key columns as a table; export everything as JSON, CSV, Excel or via API.

### Pricing

Pay per result: you are charged one `result` event for each saved record (suggested $1.00 per 1,000 results), plus nothing for duplicates, failed requests or empty runs. The run stops automatically at your **Max results** setting or at the maximum total charge you set for the run, whichever comes first.

### FAQ

**Is this legal / allowed?** It reads publicly available data from official public sources and follows their published rate limits. Check the source's terms for your use case.

**Why did I get fewer results than Max results?** Your filters matched fewer records, or the source caps how many it returns (see Limitations).

**What happens on errors?** Transient errors (timeouts, rate limits, 5xx) are retried with exponential backoff. Invalid input stops the run immediately with a message explaining what to fix.

**Can I schedule it?** Yes, use Apify Schedules; duplicates within a run are removed automatically.

### Limitations

- crates.io allows one request per second, so the actor reads about 100 crates per second.
- Results depend on the public source; if it is down, the actor retries with backoff and then fails with a clear message (you are not charged for results that were not saved).

# Actor input Schema

## `query` (type: `string`):

Search term (empty = all crates).

## `category` (type: `string`):

e.g. web-programming, cryptography.

## `keyword` (type: `string`):

e.g. tokio, cli.

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

Result order.

## `minDownloads` (type: `integer`):

Only crates with at least this many all-time downloads.

## `contact` (type: `string`):

Your email or URL, added to the User-Agent as crates.io recommends.

## `maxItems` (type: `integer`):

Maximum number of results to save (and pay for). The run stops as soon as this many unique results are saved.

## Actor input object example

```json
{
  "query": "async",
  "sort": "downloads",
  "minDownloads": 0,
  "maxItems": 100
}
```

# Actor output Schema

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

All scraped results (overview table view)

# 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 = {
    "query": "async",
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("jonboyd544/crates-io-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 = {
    "query": "async",
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("jonboyd544/crates-io-crates-scraper").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 '{
  "query": "async",
  "maxItems": 100
}' |
apify call jonboyd544/crates-io-crates-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jonboyd544/crates-io-crates-scraper"
        }
    }
}
```

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/trjlP7xTI3g44PjZ5/builds/KZipz2j9ofTM5aEvX/openapi.json
