# RubyGems API

> RubyGems returns gem versions, release dates, downloads, authors, licenses, and dependencies as a workflow and API.

RubyGems returns a gem’s latest version, release date, description, downloads, authors, license, links, and runtime dependencies. Get gem needs a gem name or RubyGems gem page link.

- Page: https://fous.com/tools/rubygems
- Handle: `@rubygems`
- Category: [Developer tools](https://fous.com/tools/category/developer-tools)
- Source website: https://rubygems.org
- Last verified: Sep 29, 2026

## Methods

### Get gem

Operation `get_gem`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get a Ruby gem’s latest version, release date, description, downloads, authors, license, links, and runtime dependencies from its name or RubyGems link.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `gem` | string | yes | `"https://rubygems.org/gems/rake"` | Gem name or RubyGems gem page link, such as rails or https://rubygems.org/gems/rails. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "gem"
  ],
  "properties": {
    "gem": {
      "type": "string",
      "description": "Gem name or RubyGems gem page link, such as rails or https://rubygems.org/gems/rails.",
      "examples": [
        "https://rubygems.org/gems/rake",
        "rails"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "gem": "https://rubygems.org/gems/rake"
    },
    {
      "gem": "rails"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `name` | string | `"rake"` | Gem name. |
| `authors` | array |  | Gem authors. |
| `license` | string or null | `"MIT"` | Declared license or licenses. |
| `description` | string or null | `"Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encoura` | Gem summary. |
| `release_date` | string or null | `"2026-04-16"` | Release date of the latest version, YYYY-MM-DD. |
| `homepage_link` | string or null | `"https://github.com/ruby/rake"` | Project homepage link. |
| `rubygems_link` | string | `"https://rubygems.org/gems/rake"` | RubyGems gem page link. |
| `latest_version` | string | `"13.4.2"` | Latest version. |
| `total_downloads` | integer | `1423548422` | Downloads across all versions. |
| `source_code_link` | string or null | `"https://github.com/ruby/rake"` | Source code link. |
| `runtime_dependencies` | array |  | Runtime dependencies and version requirements. |
| `runtime_dependencies[].name` | string | `"actioncable"` |  |
| `runtime_dependencies[].version_requirement` | string | `"= 8.1.4"` |  |
| `latest_version_downloads` | integer | `67888244` | Downloads for the latest version. |

**Example input**

```json
{
  "gem": "https://rubygems.org/gems/rake"
}
```

**Example output**

```json
{
  "name": "rake",
  "authors": [
    "Hiroshi SHIBATA",
    "Eric Hodel",
    "Jim Weirich"
  ],
  "license": "MIT",
  "description": "Rake is a Make-like program implemented in Ruby. Tasks and dependencies are\nspecified in standard Ruby syntax.\nRake has the following features:\n  * Rakefiles (rake's version of Makefiles) are complete…",
  "release_date": "2026-04-16",
  "homepage_link": "https://github.com/ruby/rake",
  "rubygems_link": "https://rubygems.org/gems/rake",
  "latest_version": "13.4.2",
  "total_downloads": 1423548422,
  "source_code_link": "https://github.com/ruby/rake",
  "runtime_dependencies": [],
  "latest_version_downloads": 67888244
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@rubygems",
  "visibility": "public",
  "operation": "get_gem",
  "version": 1,
  "input": {
    "gem": "https://rubygems.org/gems/rake"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@rubygems\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_gem\",\n  \"version\": 1,\n  \"input\": {\n    \"gem\": \"https://rubygems.org/gems/rake\"\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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@rubygems",
  "visibility": "public",
  "operation": "get_gem",
  "version": 1,
  "input": {
    "gem": "https://rubygems.org/gems/rake"
  },
  "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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/rubygems`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_gem`: Get gem. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-rubygems https://api.fous.com/mcp/tools/rubygems --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare gem downloads across projects
- Check the latest version before upgrading
- Review a gem’s runtime dependencies
- Find gem authors, license, and project links

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this RubyGems tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a RubyGems account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from rubygems.org when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### What is a gem’s latest version?

Use Get gem to retrieve the latest version and its release date.

### How many downloads does a gem have?

Use Get gem to see total downloads across all versions and downloads for the latest version.

### Which runtime dependencies does a gem require?

Use Get gem to retrieve runtime dependencies and their version requirements.

## Related

- [npm API](https://fous.com/tools/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.
- [PyPI API](https://fous.com/tools/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.
- [NuGet API](https://fous.com/tools/nuget.md): The .NET package gallery for discovering and sharing packages.
- [crates.io API](https://fous.com/tools/crates-io.md): crates.io is the Rust community package registry, returning current crate details and recent releases or up to 100 keyword-matched crates with version, download, and update information.
- [Docker Hub API](https://fous.com/tools/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.
- [GitHub API](https://fous.com/tools/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.
- [Maven Central API](https://fous.com/tools/maven-central.md): Find Java libraries, releases, and dependency coordinates on Maven Central.
- [WordPress.org API](https://fous.com/tools/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.
- [All Developer tools tools](https://fous.com/tools/category/developer-tools)
