crates.io API
A crates.io API that runs cargo search from code: query the Rust package registry and each crate comes back as one row — description, latest stable version, all-time and 90-day crate downloads, first-publish and last-update timestamps, and the homepage, documentation and repository links. Order results by relevance, downloads, recent downloads, recent updates or newest.
$0.0003 per delivered crate · $2 free every month · Failed runs never billed
$ curl $QD/crates_io/run \
-H "Authorization: Bearer $QD_API_KEY" \
-d '{}'
{ "status": "done", "count": 10,
"results": [
{
"name": "…",
"description": "…",
"version": "…",
"downloads": … } ],
"cost": 0.003 }
# 10 crates × $0.0003 · nothing delivered, nothing charged
What a crates.io API does
The Rust package registry API is keyless and genuinely searchable at origin — rarer than it sounds, since PyPI offers no equivalent. The value here is the shape: crates arrive in the same row schema as the npm and PyPI collectors, so one key and one format cover a polyglot dependency dataset instead of three registry clients.
Two download columns tell different stories: downloads is the all-time total that rewards old crates, while recent_downloads counts the last 90 days and shows what the ecosystem installs now. An exact_match flag marks the row whose name equals your query, so "serde" the crate is distinguishable from crates about serde.
What one crate looks like
Every delivered crate carries these fields. Nullable means the source did not publish it — the field stays empty instead of being guessed.
| Field | Type | What it holds |
|---|---|---|
rank | integer | 1-based position. |
name | string | Crate name. |
description | string · nullable | Description. |
version | string · nullable | Latest stable version. |
downloads | integer · nullable | All-time downloads. |
recent_downloads | integer · nullable | Downloads in the last 90 days. |
created_at | string · nullable | First publish. |
updated_at | string · nullable | Last update. |
homepage | string · nullable | Homepage. |
documentation | string · nullable | Docs URL. |
repository | string · nullable | Repository URL. |
exact_match | boolean | Query matched the name exactly. |
url | string | crates.io page. |
Inputs
The whole request. Anything you leave out falls back to the default shown in the catalog.
| Input | Type | Required | What it does |
|---|---|---|---|
query | string | yes | Crate name or keyword. |
sort | string | no | Result order. |
max_results | integer | no | How many crates to deliver at most (1–100). You pay only for delivered crates. |
Pricing
crates.io API pricing
$0.0003 per delivered crate. A run that delivers nothing costs nothing: blocked pages, challenges and retries are on us, and the $2 monthly allowance covers about 6,666 crates before you spend anything.
Pay as you go
- $2 free credit / month
- 60 requests / min
- List unit prices
Starter
- $15 free credit / month
- 300 requests / min
- 10% off unit prices
Growth
- $50 free credit / month
- 600 requests / min
- 20% off unit prices
Scale
- $250 free credit / month
- 1,200 requests / min
- 30% off unit prices
Same wallet, same key and same $2 monthly allowance as every other Data API. Prices are launch pricing read live from the billing config — GET /v1/scraper/collectors returns the price your key actually pays.
Integration
One POST, typed rows
Base URL https://api.quanticdata.io/v1, Bearer auth, the same key as every other Data API. Endpoint: POST /v1/.
curl -X POST https://api.quanticdata.io/v1/scraper/collectors/crates_io/run \
-H "Authorization: Bearer $QD_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
What people build with the crates.io API
Three shapes of work this endpoint was designed around.
Rust dependency shortlists
Search "http client" sorted by downloads and hand over the ranked rows — version, links, both download counts — to whoever picks the dependency.
Cross-registry comparison
The same query against this, npm and PyPI yields three tables in one schema, which turns an ecosystem comparison into a join instead of a chore.
Crate freshness checks
Low recent_downloads against a large all-time total, plus an old updated_at, flags the abandoned crates in a dependency list.
crates.io API versus rolling your own
The differences that actually cost time when you build this in-house.
| DIY scraper | This collector | |
|---|---|---|
| Registry search | Page through the web UI or raw API yourself | Ranked crate rows in one call, sorted how you ask |
| Activity signal | An all-time total that flatters old crates | A separate 90-day downloads column beside it |
| Exact hits | Guess whether the top result is the crate you named | An exact-match flag on the row that is |
Does crates.io have a real search endpoint?
Yes — unlike PyPI, the Rust registry supports keyword search natively, and this reads it directly: one row per crate with metadata, links and both download counts, no token required at the source.
What is the difference between downloads and recent_downloads?
downloads is the crate's all-time total; recent_downloads covers the last 90 days. Sorting by the recent figure surfaces what Rust projects install today rather than what they installed years ago.
Can I see a crate's dependencies in the results?
No — rows describe the crates themselves: version, downloads, dates and links. Dependency graphs are not part of the registry's search response, so resolving a tree stays a job for cargo.
Is there a free crates.io API?
Every account gets $2 of credit every month with no card, which is about 6,666 delivered crates on this endpoint at $0.0003 each. It renews monthly, and a run that delivers nothing is never billed — so a failed or blocked attempt does not eat the allowance.
How much does one run cost?
Multiply the rows you actually receive by $0.0003. A run capped at 100 crates — the maximum for this collector — costs $0.03 if every row comes back, and less when the source has fewer. Volume tiers take up to 30% off, and GET /v1/scraper/collectors returns the price your key actually pays.
Run the crates.io API now
$2 of free credit every month, no card. Your key returns its own prices from GET /v1/scraper/collectors.