# crates.io API

> crates.io returns Rust crate details, versions, and download data as a workflow and API.

crates.io returns crate details, downloads, links, and recent releases through Get crate; enter a crate name or crates.io link. Search crates returns matching crate summaries, versions, downloads, and update dates; enter keywords and optionally choose sorting and result count.

- Page: https://fous.com/tools/crates-io
- Handle: `@crates-io`
- Category: [Developer tools](https://fous.com/tools/category/developer-tools)
- Source website: https://crates.io
- Last verified: Sep 29, 2026

## Methods

### Get crate

Operation `get_crate`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Look up a Rust crate by name or crates.io link. Returns its latest version, downloads, links, dates, license, and 10 most recent releases.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `crate` | string | yes | `"https://crates.io/crates/itoa"` | Crate name or crates.io crate link, for example serde or https://crates.io/crates/serde. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "crate"
  ],
  "properties": {
    "crate": {
      "type": "string",
      "description": "Crate name or crates.io crate link, for example serde or https://crates.io/crates/serde.",
      "examples": [
        "https://crates.io/crates/itoa",
        "serde"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "crate": "https://crates.io/crates/itoa"
    },
    {
      "crate": "serde"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `name` | string | `"itoa"` | Crate name. |
| `license` | string or null | `"MIT OR Apache-2.0"` | License of the latest version. |
| `versions` | array |  | Ten most recently published versions, newest first. |
| `versions[].version` | string | `"1.0.18"` | Version number. |
| `versions[].page_link` | string | `"https://crates.io/crates/itoa/1.0.18"` | Crate version page. |
| `versions[].release_date` | string | `"2026-03-20"` | Publication date. |
| `page_link` | string | `"https://crates.io/crates/itoa"` | Crate page on crates.io. |
| `description` | string or null | `"Fast integer primitive to string conversion"` | Crate summary. |
| `created_date` | string | `"2016-06-25"` | Date the crate was created. |
| `latest_version` | string | `"1.0.18"` | Latest published version. |
| `repository_link` | string or null | `"https://github.com/dtolnay/itoa"` | Source repository link. |
| `total_downloads` | integer | `1393318701` | Downloads across all time. |
| `recent_downloads` | integer or null | `326472705` | Downloads during the last 90 days. |
| `last_updated_date` | string | `"2026-03-20"` | Date the crate was last updated. |
| `documentation_link` | string or null | `"https://docs.rs/itoa"` | Documentation link. |

**Example input**

```json
{
  "crate": "https://crates.io/crates/itoa"
}
```

**Example output**

```json
{
  "name": "itoa",
  "license": "MIT OR Apache-2.0",
  "versions": [
    {
      "version": "1.0.18",
      "page_link": "https://crates.io/crates/itoa/1.0.18",
      "release_date": "2026-03-20"
    },
    {
      "version": "1.0.17",
      "page_link": "https://crates.io/crates/itoa/1.0.17",
      "release_date": "2025-12-27"
    },
    {
      "version": "1.0.16",
      "page_link": "https://crates.io/crates/itoa/1.0.16",
      "release_date": "2025-12-21"
    }
  ],
  "page_link": "https://crates.io/crates/itoa",
  "description": "Fast integer primitive to string conversion",
  "created_date": "2016-06-25",
  "latest_version": "1.0.18",
  "repository_link": "https://github.com/dtolnay/itoa",
  "total_downloads": 1393318701,
  "recent_downloads": 326472705,
  "last_updated_date": "2026-03-20",
  "documentation_link": "https://docs.rs/itoa"
}
```

### Search crates

Operation `search_crates`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Find Rust crates by keywords, sorted by relevance, total downloads, recent downloads, or newest creation. Returns up to 100 results with versions, descriptions, download counts and update dates.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `sort` | string | no | `"downloads"` | Order results by relevance, total downloads, recent downloads, or newest crate creation, such as downloads. |
| `query` | string | yes | `"http client"` | Words to search for, such as http client. |
| `max_results` | integer | no | `20` | Maximum number of crates to return, from 1 to 100, such as 20. |

**Input schema**

```json
{
  "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.",
      "x-fous-developer": true
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "sort": "downloads",
      "query": "serde",
      "max_results": 3
    },
    {
      "query": "http client"
    },
    {
      "sort": "recent_downloads",
      "query": "web framework",
      "max_results": 4
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `crates` | array |  | Crates matching the search words, in the requested order. |
| `crates[].link` | string | `"https://crates.io/crates/hashbrown"` | Crate page on crates.io. |
| `crates[].name` | string | `"hashbrown"` | Crate name. |
| `crates[].description` | string or null | `"A Rust port of Google's SwissTable hash map"` | Crate summary. |
| `crates[].latest_version` | string or null | `"0.17.1"` | Latest version shown by crates.io. |
| `crates[].total_downloads` | integer | `2552943604` | All-time crate downloads. |
| `crates[].recent_downloads` | integer | `682578958` | Downloads in the last 90 days. |
| `crates[].last_updated_date` | string or null | `"2026-05-09"` | Date the crate was last updated. |

**Example input**

```json
{
  "sort": "downloads",
  "query": "serde",
  "max_results": 3
}
```

**Example output**

```json
{
  "crates": [
    {
      "link": "https://crates.io/crates/hashbrown",
      "name": "hashbrown",
      "description": "A Rust port of Google's SwissTable hash map",
      "latest_version": "0.17.1",
      "total_downloads": 2552943604,
      "recent_downloads": 682578958,
      "last_updated_date": "2026-05-09"
    },
    {
      "link": "https://crates.io/crates/bitflags",
      "name": "bitflags",
      "description": "A macro to generate structures which behave like bitflags.\n",
      "latest_version": "2.13.2",
      "total_downloads": 1916593883,
      "recent_downloads": 443914672,
      "last_updated_date": "2026-09-10"
    },
    {
      "link": "https://crates.io/crates/quote",
      "name": "quote",
      "description": "Quasi-quoting macro quote!(...)",
      "latest_version": "1.0.47",
      "total_downloads": 1677967564,
      "recent_downloads": 382774116,
      "last_updated_date": "2026-07-19"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@crates-io",
  "visibility": "public",
  "operation": "get_crate",
  "version": 1,
  "input": {
    "crate": "https://crates.io/crates/itoa"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@crates-io\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_crate\",\n  \"version\": 1,\n  \"input\": {\n    \"crate\": \"https://crates.io/crates/itoa\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@crates-io",
  "visibility": "public",
  "operation": "get_crate",
  "version": 1,
  "input": {
    "crate": "https://crates.io/crates/itoa"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/crates-io`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_crate`: Get crate. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_crates`: Search crates. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-crates-io https://api.fous.com/mcp/tools/crates-io --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare Rust crates by recent downloads.
- Check a crate’s license and latest version.
- Track recent releases and update dates.
- Find crates matching a technical keyword.
- Review crate documentation and source repository links.

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this crates.io tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a crates.io account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from crates.io when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What is a crate’s latest version?

Get crate returns the latest published version when you provide a crate name or crates.io link.

### Which crates match a search term?

Search crates finds matching crates from your search words, with optional sorting by relevance, downloads, or creation date.

### How many downloads does a crate have?

Get crate returns all-time and last-90-day download counts. Search crates also returns both counts for matching crates.

## Related

- [PyPI API](https://fous.com/tools/pypi.md): PyPI provides package metadata, links, and current/latest plus 10 recent versions; release dates reflect first file uploads, and keyword searches return up to 100 packages.
- [npm API](https://fous.com/tools/npm.md): npm provides package details, search results and latest versions, plus weekly download and publish data; daily and historical download counts may lag by a day or more.
- [GitHub API](https://fous.com/tools/github.md): GitHub returns public repository matches and details, up to 25 trending projects, issues, pull requests, and newest-first published releases; release or commit dates may be unavailable.
- [RubyGems API](https://fous.com/tools/rubygems.md): Discover and share Ruby gems.
- [NuGet API](https://fous.com/tools/nuget.md): The .NET package gallery for discovering and sharing packages.
- [WordPress.org API](https://fous.com/tools/wordpress-org.md): WordPress.org’s public plugin directory returns up to 100 ranked search matches with ratings, installations, compatibility and links, plus best-match details and the latest-version changelog when available.
- [Docker Hub API](https://fous.com/tools/docker-hub.md): Docker Hub helps find and publish container images, search public images, and view image details and recently updated tags; pull totals may lag or be unavailable.
- [Chrome Web Store API](https://fous.com/tools/chrome-web-store.md): Chrome Web Store finds extensions by keywords or name and returns public listing details, with some listings omitting developer, user, or rating information.
- [All Developer tools tools](https://fous.com/tools/category/developer-tools)
