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

- Page: https://fous.com/methods/crates.io/search-crates
- Method: `crates.io/search_crates`, version 1
- Website: crates.io
- Returns: name, latest version, description, total and recent downloads, last update date, link
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

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

## Output

From a run on Oct 23, 2026, shortened. Its input:

```json
{
  "query": "http client"
}
```

Its output:

```json
{
  "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"
    }
  ]
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
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"}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

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

## 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."
    }
  }
}
```

## Output schema

```json
{
  "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
}
```

## See more

- [crates.io API: Get crate details](https://fous.com/methods/crates.io/get-crate.md): Looks up a Rust crate by name or crates.io link and returns its latest version, downloads, links, dates, license and 10 most recent releases.
- [PyPI API: Search packages](https://fous.com/methods/pypi.org/search-packages.md): Searches 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.
- [GitHub API: Search repositories](https://fous.com/methods/github.com/search-repositories.md): Finds public GitHub repositories by keywords, with an optional language filter and sort order. Returns up to 100 matches.
- [Hugging Face API: Search models](https://fous.com/methods/huggingface.co/search-models.md): Finds public Hugging Face models by search words, with an optional task and sort order. License is null when the model does not publish one.
- [npm API: Search packages](https://fous.com/methods/npmjs.com/search-packages.md): Searches 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.
- [Chewy API: Search products](https://fous.com/methods/chewy.com/search-products.md): Search 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.
- [Docker API: Search container images](https://fous.com/methods/hub.docker.com/search-container-images.md): Finds 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.
- [AliExpress API: Search products](https://fous.com/methods/aliexpress.com/search-products.md): Searches 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.
- [All crates.io methods](https://fous.com/methods/crates.io.md)
