# 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/workflows/crates-io
- Handle: `@crates-io`
- Category: [Developer tools](https://fous.com/workflows/category/developer-tools)
- Source website: https://crates.io
- Last verified: Sep 29, 2026
- Fous is not affiliated with crates.io.

## Methods

### Get crate

Operation `get_crate`, version 1. 1 credit per call.

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 call.

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

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_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.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

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=120) 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.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_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);
```

Or describe the data in plain language: send `{"api":"@crates-io","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## 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

### Is Fous affiliated with crates.io?

No. Fous is not affiliated with crates.io. This workflow reads the public crates.io website and returns its data.

### How much does it cost?

Each run costs 1 credit. 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; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check 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/workflows/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/workflows/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/workflows/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/workflows/rubygems.md): Discover and share Ruby gems.
- [NuGet API](https://fous.com/workflows/nuget.md): The .NET package gallery for discovering and sharing packages.
- [WordPress.org API](https://fous.com/workflows/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/workflows/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/workflows/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 workflows](https://fous.com/workflows/category/developer-tools)
