---
title: "crates.io API: Rust crate search, crate details as JSON"
description: "crates.io API for Rust crate search, crate details with downloads and version history, and reverse dependencies as JSON. 1 credit per successful call."
url: https://perceptlayer.com/apis/crates-io
---

[APIs](https://perceptlayer.com/apis) / [Apps and media](https://perceptlayer.com/verticals/apps) / crates.io

1 credit per call 3 endpoints 11 datapoints 

# crates.io API

crates.io API for Rust crate search, crate details with downloads and version history, and reverse dependencies as JSON. 1 credit per successful call.

[Get a free API key](https://perceptlayer.com/signup) Run it below

crates.io

GET /v1/crates-io/search?query=serde&per\_page=10 

```
{
  "success": true,
  "data": {
    "total": 26924,
    "page": 1,
    "has_more": true,
    "count": 10,
    "items": [
      {
        "name": "serde",
        "description": "A generic serialization/deserialization framework",
        "latest_version": "1.0.229",
        "downloads": 1817058559,
        "recent_downloads": 473498822,
        "created_at": "2014-12-05T20:20:39.487502Z",
        "updated_at": "2026-07-18T23:05:13.266456Z",
        "repository": "https://github.com/serde-rs/serde",
        "homepage": "https://serde.rs",
        "documentation": "https://docs.rs/serde",
        "url": "https://crates.io/crates/serde"
      },
      {
        "name": "serde-saphyr",
        "description": "YAML (de)serializer for Serde, emphasizing panic-free parsing, fast builds and good error reporting. Supports properties, include, tag and comment capture",
        "latest_version": "2.2.0",
        "downloads": 24968458,
        "recent_downloads": 19277102,
        "created_at": "2025-09-27T20:32:53.691021Z",
        "updated_at": "2026-11-18T17:29:51.155259Z",
        "repository": "https://github.com/bourumir-wyngs/serde-saphyr",
        "documentation": "https://docs.rs/serde-saphyr/latest/serde-saphyr/",
        "url": "https://crates.io/crates/serde-saphyr"
      },
      {
        "name": "clickhouse",
        "description": "Official Rust client for ClickHouse DB",
        "latest_version": "0.15.3",
        "downloads": 18479195,
        "recent_downloads": 6388959,
        "created_at": "2017-05-17T22:21:47.894469Z",
        "updated_at": "2026-10-13T08:26:54.451769Z",
        "repository": "https://github.com/ClickHouse/clickhouse-rs",
        "homepage": "https://clickhouse.com",
        "url": "https://crates.io/crates/clickhouse"
      }
    ]
  },
  "meta": {
    "request_id": "req_0e5468a6abb64ad1bd3920ec78ed7e68",
    "credits_charged": 1,
    "credits_remaining": 1997
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

Sample data

## What one call returns

A recorded run of `search`: the fields and shapes you will get, shortened to 3 items.

| # | name string | description string | latest\_version string | downloads integer | recent\_downloads integer | created\_at string | updated\_at string | repository url | homepage url | documentation url | url url |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | serde | A generic serialization/deserialization framework | 1.0.229 | 1817058559 | 473498822 | 2014-12-05T20:20:39.487502Z | 2026-07-18T23:05:13.266456Z | https://github.com/serde-rs/serde | https://serde.rs | https://docs.rs/serde | https://crates.io/crates/serde |
| 2 | serde-saphyr | YAML (de)serializer for Serde, emphasizing panic-free parsing, fast builds and good error reporting. Supports properties, include, tag and comment capture | 2.2.0 | 24968458 | 19277102 | 2025-09-27T20:32:53.691021Z | 2026-11-18T17:29:51.155259Z | https://github.com/bourumir-wyngs/serde-saphyr | — | https://docs.rs/serde-saphyr/latest/serde-saphyr/ | https://crates.io/crates/serde-saphyr |
| 3 | clickhouse | Official Rust client for ClickHouse DB | 0.15.3 | 18479195 | 6388959 | 2017-05-17T22:21:47.894469Z | 2026-10-13T08:26:54.451769Z | https://github.com/ClickHouse/clickhouse-rs | https://clickhouse.com | — | https://crates.io/crates/clickhouse |

Recorded from our API · 3 items shown · 11 datapoints per item GET /v1/crates-io/search?query=serde&per\_page=10

11 datapoints

### Identity

-   name string

### Contact

-   url url

### Location

-   latest\_version string

### Other

-   description string
-   downloads integer
-   recent\_downloads integer
-   created\_at string
-   updated\_at string
-   repository url
-   homepage url
-   documentation url

Playground

## Run this API

cURL shell 

```
curl "https://api.perceptlayer.com/v1/crates-io/search?query=serde&per_page=10" \
  -H "X-API-Key: $API_KEY"
```

crates.io · 3 endpoints

## Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

| Endpoint | Required parameters | Returns | Cost |
| --- | --- | --- | --- |
| [GET `/v1/crates-io/crate`](https://perceptlayer.com/apis/crates-io/crate) | `name` | `name` `description` `latest_version` `downloads` `recent_downloads` `created_at` +10 more | 1 credit |
| [GET `/v1/crates-io/reverse-dependencies`](https://perceptlayer.com/apis/crates-io/reverse-dependencies) | `name` +2 optional | `crate` `version` `requirement` `kind` `optional` `downloads` +1 more | 1 credit |
| [GET `/v1/crates-io/search`](https://perceptlayer.com/apis/crates-io/search) | `query` +3 optional | `name` `description` `latest_version` `downloads` `recent_downloads` `created_at` +5 more | 1 credit |

Overview

## About the crates.io API

## What you can get

The crates.io API returns Rust crate data from crates.io as JSON through 3 endpoints.

-   **Search:** `search` takes a `query`, with `sort` (relevance, downloads, recent-downloads, recent-updates, new or alpha), `page` and `per_page` (1 to 100).
-   **Crates:** `crate` takes a crate `name`.
-   **Reverse dependencies:** `reverse-dependencies` takes a crate `name`, with `page` and `per_page`.

The recorded `search` for "serde" returns `items`, each with `name`, `description`, `latest_version`, `downloads`, `recent_downloads`, `created_at`, `updated_at`, `repository`, `homepage`, `documentation` and `url`, plus `total` (26,924 in that recording), `page` and `has_more`. The first result, `serde`, was at `1.0.229` with 1,817,058,559 downloads. `crate` adds `latest_stable_version`, `version_count` (316 for serde), `keywords`, `categories` and `versions`, each with `version`, `created_at`, `downloads`, `yanked`, `license`, `rust_version`, `size_bytes` and `published_by`.

## How a call works

Search, then look up: `GET /v1/crates-io/search?query=serde&per_page=10` with your key in the `X-API-Key` header returns each crate's `name`; `crate` and `reverse-dependencies` take that `name`, for example `GET /v1/crates-io/reverse-dependencies?name=serde&per_page=10`. Check `has_more` before asking for the next `page`. Answers come from a cache for up to an hour, so download counts can be up to an hour old. Every successful call costs 1 credit; failed calls cost nothing.

Apps and media JSON REST MCP

### More apps and media APIs

[Apple App Store](https://perceptlayer.com/apis/apple-app-store) [Apple Podcasts](https://perceptlayer.com/apis/apple-podcasts) [arXiv](https://perceptlayer.com/apis/arxiv) [Audible](https://perceptlayer.com/apis/audible) [Bandcamp](https://perceptlayer.com/apis/bandcamp) [Chrome Web Store](https://perceptlayer.com/apis/chrome-web-store) [CISA KEV](https://perceptlayer.com/apis/cisa-kev) [ClinicalTrials.gov](https://perceptlayer.com/apis/clinicaltrials) [Coursera](https://perceptlayer.com/apis/coursera) [Crossref](https://perceptlayer.com/apis/crossref) [Discogs](https://perceptlayer.com/apis/discogs) [Docker Hub](https://perceptlayer.com/apis/docker-hub)

Use cases

### Vet a dependency: licence, minimum Rust version, yanked versions and release cadence

`Use the crates.io API to vet a dependency: licence, minimum Rust version, yanked versions and release cadence` 

### Rank crates for a job by all-time or recent downloads

`Use the crates.io API to rank crates for a job by all-time or recent downloads` 

### Measure a crate's reach through the crates that depend on it

`Use the crates.io API to measure a crate's reach through the crates that depend on it` 

### See how dependents use a crate, with each one's \`requirement\`, \`kind\` and \`optional\`

`` Use the crates.io API to see how dependents use a crate, with each one's `requirement`, `kind` and `optional` `` 

FAQ

## Questions

**How much does the crates.io API cost?**

Each successful call costs one credit, and each page of results is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

**What does \`reverse-dependencies\` return?**

Each dependent's \`crate\`, \`version\`, \`requirement\` (the version range it asks for), \`kind\`, \`optional\`, \`downloads\` and \`url\`, with a \`total\`. In the recording, \`serde\` had 146,477 reverse dependencies.

**Does \`crate\` return every version?**

It returns \`version\_count\` and a \`versions\` list, each with its date, downloads, licence, \`rust\_version\` and whether it was \`yanked\`. It does not return a crate's own dependency list.

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

No. You call this crates.io API with your Perceptlayer key in the \`X-API-Key\` header, with no crates.io login or token.

**Is this the official crates.io API?**

No. Perceptlayer is an independent service and is not affiliated with crates.io. It returns crates.io data as JSON with a Perceptlayer key, so there is no crates.io developer account, app review or partner approval to get first. It only reads data: if crates.io has an official API and you need to act on your own crates.io account, such as posting, managing orders or reading private data, use that one.

**Should I build a crates.io scraper instead?**

You can, but a crates.io scraper is code you maintain: page changes break it, requests get blocked, and crates.io's terms govern how you collect data. The crates.io API gives you 3 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

## Try the crates.io API with 100 free credits

No credit card. Failed calls are never billed.

[Get a free API key](https://perceptlayer.com/signup) [Read the docs](https://docs.perceptlayer.com)
