# crates.io API

> Returns Rust crate details, search results, versions, dependencies and owners from crates.io.

Category: Developer & Tech. Region: global. 15 endpoints at `https://api.hoshime.com/v1/crates/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/crates
## GET /v1/crates/crate

Description, latest versions, licence, downloads and links of one crate.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `categories` (Category[]), `categories[].name` (string), `createdAt` (string), `description` (string), `documentation` (string), `downloads` (integer (int64)), `homepage` (string), `keywords` (Keyword[]), `keywords[].name` (string), `license` (string), `maxStableVersion` (string), `name` (string), `newestVersion` (string), `recentDownloads` (integer (int64)), `repository` (string), `updatedAt` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/crate?name=serde" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/search

Crates that match a search, 20 per page, best match first.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms. (e.g. serde) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `downloads` (integer (int64)), `maxStableVersion` (string), `name` (string), `newestVersion` (string), `recentDownloads` (integer (int64)), `repository` (string), `updatedAt` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/search?query=serde" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/versions

Every published version of one crate, newest first, 30 per page.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `checksum` (string), `crateSize` (integer (int64)), `createdAt` (string), `downloads` (integer (int64)), `license` (string), `number` (string), `publishedBy` (string), `rustVersion` (string), `yanked` (boolean)

```bash
curl "https://api.hoshime.com/v1/crates/versions?name=serde" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/version

One version of a crate: its licence, checksum, size, minimum Rust version and publisher.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `version` | string | yes | Exact version, such as 1.0.0. (e.g. 1.0.0) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `checksum` (string), `crateSize` (integer (int64)), `createdAt` (string), `downloads` (integer (int64)), `license` (string), `number` (string), `publishedBy` (string), `rustVersion` (string), `yanked` (boolean)

```bash
curl "https://api.hoshime.com/v1/crates/version?name=serde&version=1.0.0" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/dependencies

The dependencies of one version of a crate, with their version requirements and kinds.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `version` | string | yes | Exact version, such as 1.0.0. (e.g. 1.0.0) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `crate` (string), `kind` (string), `optional` (boolean), `requirement` (string), `target` (string)

```bash
curl "https://api.hoshime.com/v1/crates/dependencies?name=serde&version=1.0.0" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/owners

The users and teams that own one crate and may publish it.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `kind` (string), `login` (string), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/owners?name=serde" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/downloads

Downloads of one crate per day over the last 90 days, all versions added up, oldest day first.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `daily` (DailyCount[]), `daily[].date` (string), `daily[].downloads` (integer (int64)), `name` (string), `total` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/crates/downloads?name=serde" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/reverseDependencies

Crates that depend on one crate, newest versions of each dependent, 30 per page.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `crate` (string), `downloads` (integer (int64)), `kind` (string), `requirement` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/crates/reverseDependencies?name=serde" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/summary

crates.io as a whole: its crate and download counts, and the crates that are new, most downloaded or just updated.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `justUpdated` (CrateRef[]), `justUpdated[].description` (string), `justUpdated[].downloads` (integer (int64)), `justUpdated[].name` (string), `justUpdated[].updatedAt` (string), `justUpdated[].version` (string), `mostDownloaded` (CrateRef[]), `mostDownloaded[].description` (string), `mostDownloaded[].downloads` (integer (int64)), `mostDownloaded[].name` (string), `mostDownloaded[].updatedAt` (string), `mostDownloaded[].version` (string), `newCrates` (CrateRef[]), `newCrates[].description` (string), `newCrates[].downloads` (integer (int64)), `newCrates[].name` (string), `newCrates[].updatedAt` (string), `newCrates[].version` (string), `numCrates` (integer (int64)), `numDownloads` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/crates/summary" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/categories

The crates.io categories, such as command-line-utilities or web-programming, with their descriptions and crate counts.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `crateCount` (integer (int64)), `description` (string), `name` (string), `slug` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/categories" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/categoryCrates

Crates in one crates.io category, such as command-line-utilities, most downloaded first, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `slug` | string | yes | Category slug, such as command-line-utilities. The categories endpoint lists them. (e.g. command-line-utilities) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `downloads` (integer (int64)), `maxStableVersion` (string), `name` (string), `newestVersion` (string), `recentDownloads` (integer (int64)), `repository` (string), `updatedAt` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/categoryCrates?slug=command-line-utilities" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/readme

The README of one crate version as HTML, the page crates.io renders for it.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `version` | string | yes | Exact version, such as 1.0.200. (e.g. 1.0.200) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `html` (string), `name` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/crates/readme?name=serde&version=1.0.200" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/versionDownloads

Downloads of one crate version per day over the last 90 days, oldest day first.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Crate name, or crates.io crate URL. (e.g. serde) |
| `version` | string | yes | Exact version, such as 1.0.200. (e.g. 1.0.200) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `daily` (DailyCount[]), `daily[].date` (string), `daily[].downloads` (integer (int64)), `name` (string), `total` (integer (int64)), `version` (string)

```bash
curl "https://api.hoshime.com/v1/crates/versionDownloads?name=serde&version=1.0.200" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/user

A crates.io user's profile by GitHub login: name, avatar, GitHub page and the day the account was created.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `login` | string | yes | GitHub login of the user, such as dtolnay. (e.g. dtolnay) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatar` (string), `createdAt` (string), `id` (string), `login` (string), `name` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/user?login=dtolnay" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/crates/userCrates

Crates one crates.io user publishes, by GitHub login, most recently updated first, 20 per page.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `login` | string | yes | GitHub login of the user, such as dtolnay. (e.g. dtolnay) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `description` (string), `downloads` (integer (int64)), `maxStableVersion` (string), `name` (string), `newestVersion` (string), `recentDownloads` (integer (int64)), `repository` (string), `updatedAt` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/crates/userCrates?login=dtolnay" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
