crates.io API
Free crates.io API with no key: Rust crate metadata, versions, download counts, dependencies and repository links. CORS enabled. Tested curl example.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the crates.io API?
The crates.io API is the free, key-free registry API for Rust packages, returning crate metadata, every published version, download statistics, dependencies and repository links.
crates.io is the official Rust package registry, and its API is fully open for reads. A single crate request returns the description, licence, repository, documentation link, download totals and the complete version history.
The registry asks that automated clients send a descriptive User-Agent with contact details. This is enforced in practice — generic user agents can be blocked — so set one before building anything that polls.
Quick facts
- Base URL
https://crates.io/api/v1- Authentication
- No API key for reads. crates.io requires a descriptive User-Agent identifying your tool and a contact address.
- Rate limit
- Roughly 1 request per second for automated clients; bulk consumers should use the database dumps instead.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the crates.io API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Fetch metadata for a Rust crate
GET https://crates.io/api/v1/crates/serde
curl 'https://crates.io/api/v1/crates/serde'const res = await fetch("https://crates.io/api/v1/crates/serde");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://crates.io/api/v1/crates/serde", timeout=20)
res.raise_for_status()
print(res.json()){
"crate": {
"id": "serde",
"name": "serde",
"updated_at": "2026-07-18T23:05:13.266456Z",
"versions": [
2817185,
1748414,
1746112,
1739049,
1731560,
1730829,
1729657,
1729573,
1728804,
1728680,
1476368,
1453061,
1387964,
1370847,
1336088,
1317878,
1311481,
1311391,
1310780,
1262146,
1246742,
1236532,
1232938,
1231005,
1227207,
1195122,
1155749,
1145069,
1138012,
1131884,
1127880,
1117094,
1057075,
1029184,
1005793,
1001382,
962580,
947780,
947429,
935283,
924082,
881758,
881445,
879591,
876663,
876632,
865547,
864891,
862726,
859451,
858772,
857573,
856339,
855606,
853213,
851305,
850113,
850061,
850055,
842589,
842403,
842025,
841944,
840681,
837934,
837604,
818064,
797029,
792938,
792908,
773194,
761332,
754405,
752788,
749292,
747404,
745129,
744000,
691601,
685308,
681082,
676945,
671664,
647090,
646778,
626961,
606237,
598895,
595739,
594649,
587380,
582429,
577052,
541963,
489577,
488041,
487064,
475782,
469421,
465434,
418637,
416728,
415805,Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
crates/<name> | path | Required | Crate name. serde |
q | string | Optional | Search query on /crates. http client |
per_page | integer | Optional | Results per page on search, max 100. 10 |
sort | string | Optional | downloads, recent-downloads, recent-updates or alphabetical. downloads |
Response fields
crate.id / namestring- Crate identifier.
crate.descriptionstring- Short description.
crate.downloadsinteger- All-time download count.
crate.recent_downloadsinteger- Downloads in the last 90 days — a better activity signal.
crate.max_stable_versionstring- Latest stable release.
crate.repository / documentationstring- Source and docs URLs.
versionsarray- Every published version with yank status and licence.
What you can build with the crates.io API
- Display the current version of a Rust crate in documentation
- Compare crates by recent download activity when choosing a dependency
- Audit licences across a Cargo dependency tree
- Detect yanked versions in use
Common errors and how to fix them
403 or blocked
Missing or generic User-Agent.
Fix: Send a User-Agent naming your tool and a contact email, as crates.io policy requires.
404
Crate name not found.
Fix: Crate names use hyphens, not underscores, in the URL even when the Rust module uses underscores.
429
Polling too fast.
Fix: Keep to about one request per second; for bulk analysis use the published database dumps instead of the API.
crates.io API — frequently asked questions
Does the crates.io API need an API key?
No key is needed for reads, but crates.io requires a descriptive User-Agent header identifying your tool and a contact address. Requests without one can be blocked.
What is the difference between downloads and recent_downloads?
`downloads` is all-time and heavily favours old crates. `recent_downloads` covers the last 90 days and is a much better signal of whether a crate is actively used.
How do I check if a version was yanked?
Each entry in the `versions` array has a `yanked` boolean. Yanked versions remain downloadable for existing lockfiles but should not be newly adopted.
Can I use this for bulk analysis of the whole registry?
No — crates.io asks that bulk consumers use the daily database dumps rather than crawling the API, which is rate limited to about one request per second.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Validator
Free online JSON validator: validate JSON and find syntax errors with the exact line and column. See root type, key counts and depth — instant and 100% private.
crates.io is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.