# RubyGems API

> Returns Ruby gem details, search results, versions, reverse dependencies, owners and the most recently published gems.

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

Latest version, description, licence, downloads and runtime dependencies of one gem.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Gem name, or rubygems.org gem URL. (e.g. rails) |
| `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: `authors` (string), `dependencies` (Dependency[]), `dependencies[].name` (string), `dependencies[].requirements` (string), `description` (string), `downloads` (integer (int64)), `homepage` (string), `licenses` (License[]), `licenses[].name` (string), `name` (string), `sourceCode` (string), `url` (string), `version` (string), `versionCreatedAt` (string), `versionDownloads` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/rubygems/gem?name=rails" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/rubygems/search

Gems that match a search, 30 per page, as RubyGems ranks them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms. (e.g. rails) |
| `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: `authors` (string), `description` (string), `downloads` (integer (int64)), `name` (string), `url` (string), `version` (string)

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

## GET /v1/rubygems/versions

Every published version of one gem, newest first, 30 per page, with its licences, Ruby requirement and downloads.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Gem name, or rubygems.org gem URL. (e.g. rails) |
| `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: `createdAt` (string), `downloads` (integer (int64)), `licenses` (License[]), `licenses[].name` (string), `number` (string), `platform` (string), `prerelease` (boolean), `rubyVersion` (string), `sha256` (string)

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

## GET /v1/rubygems/reverseDependencies

Names of the gems that depend on one gem, 50 per page, as RubyGems lists them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Gem name, or rubygems.org gem URL. (e.g. rails) |
| `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: `name` (string), `url` (string)

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

## GET /v1/rubygems/owners

The accounts that own one gem and may publish new versions of it.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Gem name, or rubygems.org gem URL. (e.g. rails) |
| `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: `handle` (string), `id` (string)

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

## GET /v1/rubygems/latestGems

The 50 gems whose newest version was published most recently on RubyGems.

Scope: `social:read` · Units: 1 · Cached: 5 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: `authors` (string), `description` (string), `licenses` (License[]), `licenses[].name` (string), `name` (string), `url` (string), `version` (string)

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

## GET /v1/rubygems/downloads

The number of gem downloads RubyGems has served in total.

Scope: `social:read` · Units: 1 · Cached: 30 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: `total` (integer (int64))

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

## GET /v1/rubygems/version

One published version of a gem with its runtime dependencies, Ruby requirement, checksum, download count and gem file link.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Gem name, or rubygems.org gem URL. (e.g. rails) |
| `number` | string | yes | Version number, such as 8.1.4.1. (e.g. 8.1.4.1) |
| `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: `createdAt` (string), `dependencies` (Dependency[]), `dependencies[].name` (string), `dependencies[].requirements` (string), `description` (string), `downloads` (integer (int64)), `gemUrl` (string), `licenses` (License[]), `licenses[].name` (string), `name` (string), `number` (string), `platform` (string), `rubyVersion` (string), `sha256` (string), `url` (string), `versionDownloads` (integer (int64)), `yanked` (boolean)

```bash
curl "https://api.hoshime.com/v1/rubygems/version?name=rails&number=8.1.4.1" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
