crates.io API: Search crates
Finds Rust crates on crates.io by keywords, sorted by relevance, total downloads, recent downloads, or newest creation.
Unofficial. Not affiliated with or endorsed by crates.io.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Sort optional
sort Order results by relevance, total downloads, recent downloads, or newest crate creation, such as downloads.
relevance (default)
One of
relevance,downloads,recent_downloads,newest.- Query, required
query Words to search for, such as http client.
http client
- Max Results optional
max_results Maximum number of crates to return, from 1 to 100, such as 20.
20 (default)
Whole number from 1 to 100.
Input as JSON
{ "query": "http client"}Output
{ "crates": [ { "link": "https://crates.io/crates/cdk-http-client" , "name": "cdk-http-client", "description": "HTTP client abstraction for CDK", "latest_version": "0.18.2", "total_downloads": 24975, "recent_downloads": 17113, "last_updated_date": "2026-10-14" }, { "link": "https://crates.io/crates/http-client" , "name": "http-client", "description": "Types and traits for http clients.", "latest_version": "6.5.3", "total_downloads": 8016822, "recent_downloads": 688289, "last_updated_date": "2022-06-20" }, { "link": "https://crates.io/crates/http-client-gpui-unofficial" , "name": "http-client-gpui-unofficial", "description": "A HTTP client library for Zed and GPUI", "latest_version": "1.25.2", "total_downloads": 13009, "recent_downloads": 8918, "last_updated_date": "2026-10-22" } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"crates.io/search_crates","input":{"query":"http client"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "crates.io/search_crates" , "input": { "query": "http client" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "crates.io/search_crates" , "input": { "query": "http client" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run crates.io/search_crates# with {"query":"http client"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "query" ], "properties": { "sort": { "enum": [ "relevance", "downloads", "recent_downloads", "newest" ], "type": "string", "default": "relevance", "examples": [ "downloads" ], "description": "Order results by relevance, total downloads, recent downloads, or newest crate creation, such as downloads." }, "query": { "type": "string", "examples": [ "http client" ], "minLength": 1, "description": "Words to search for, such as http client." }, "max_results": { "type": "integer", "default": 20, "maximum": 100, "minimum": 1, "examples": [ 20 ], "description": "Maximum number of crates to return, from 1 to 100, such as 20." } }}Output schema
{ "type": "object", "required": [ "crates" ], "properties": { "crates": { "type": "array", "items": { "type": "object", "required": [ "name", "latest_version", "description", "total_downloads", "recent_downloads", "last_updated_date", "link" ], "properties": { "link": { "type": "string", "format": "uri", "description": "Crate page on crates.io." }, "name": { "type": "string", "description": "Crate name." }, "description": { "type": [ "string", "null" ], "description": "Crate summary." }, "latest_version": { "type": [ "string", "null" ], "description": "Latest version shown by crates.io." }, "total_downloads": { "type": "integer", "description": "All-time crate downloads." }, "recent_downloads": { "type": "integer", "description": "Downloads in the last 90 days." }, "last_updated_date": { "type": [ "string", "null" ], "format": "date", "description": "Date the crate was last updated." } }, "additionalProperties": false }, "description": "Crates matching the search words, in the requested order." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
crates.io/search_crates- Returns
- name, latest version, description, total and recent downloads, last update date, link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method crates.io/search_crates with the inputs above.
Ask your agent
- Find Rust crates for async HTTP clients, sorted by total downloads, top 10 results
- Which Rust crate handles JSON serialization? Show the most relevant matches
- Search crates.io for logging libraries sorted by newest creation date
- I need the most recently downloaded Rust crates for CLI argument parsing, up to 15 results
- List Rust crates about database connection pooling ranked by relevance, max 25
See more
All crates.io methodsLooks up a Rust crate by name or crates.io link and returns its latest version, downloads, links, dates, license and 10 most recent releases.
crates.io/get_crateSearches PyPI by keywords and returns matching packages in relevance order, each with its latest version and that version's release date. Returns up to 100 results.
pypi.org/search_packagesFinds public GitHub repositories by keywords, with an optional language filter and sort order. Returns up to 100 matches.
github.com/search_repositoriesFinds public Hugging Face models by search words, with an optional task and sort order. License is null when the model does not publish one.
huggingface.co/search_modelsSearches the npm registry for JavaScript packages by description or keywords, in npm's search order, and returns each package's latest version, weekly downloads and publish date.
npmjs.com/search_packagesSearch Chewy products by words, pet type, and sort order. Returns up to 72 products in Chewy's order, including listed and first-order Autoship prices when shown.
chewy.com/search_productsFinds public Docker Hub container images matching a software name, in Docker Hub search order, with publisher, badge, stars, last update and exact total pulls when Docker Hub publishes them. Can keep only Docker Official Images and Verified Publisher images.
hub.docker.com/search_container_imagesSearches AliExpress listings by product words, shipping destination, price range and sort order. Unpriced promotional cards are omitted; free shipping is marked only when the listing explicitly says so.
aliexpress.com/search_products