# Ruby Gems API
> The RubyGems.org registry — home of the Ruby ecosystem — as an API. Look up any gem for its description, current version, total and per-version download counts, authors, license, homepage, source and documentation links, and its runtime and development dependencies; search the registry by keyword; and browse a gem's full version history with per-version download numbers. Live from the official RubyGems.org API. Ideal for package dashboards, dependency and supply-chain tooling, developer portals and Ruby ecosystem analytics. Open data from RubyGems.org.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/rubygems-api/..."
```

## Pricing
- **Free** (Free) — 3,480 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 48,100 calls/Mo, 8 req/s
- **Pro** ($12/Mo) — 237,800 calls/Mo, 20 req/s
- **Mega** ($33/Mo) — 1,193,000 calls/Mo, 50 req/s

## Endpoints

### Gems

#### `GET /v1/gem` — Full metadata for a gem

**Parameters:**
- `name` (query, required, string) — Gem name, e.g. rails, sinatra Example: `rails`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rubygems-api/v1/gem?name=rails"
```

**Response:**
```json
{
    "data": {
        "gem": {
            "info": "Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.",
            "name": "rails",
            "authors": "David Heinemeier Hansson",
            "version": "8.1.3",
            "licenses": [
                "MIT"
            ],
            "downloads": 748360793,
            "project_uri": "https://rubygems.org/gems/rails",
            "dependencies": {
                "runtime": [
                    {
                        "name": "actioncable",
                        "requirements": "= 8.1.3"
                    },
                    {
                        "name": "actionmailbox",
                        "requirements": "= 8.1.3"
                    },
                    {
                        "name": "actionmailer",
                        "requirements": "= 8.1.3"
                    },
                    {
                        "name": "actionpack",
                        "requirements": "= 8.1.3"
                    },
                    {
                        "name": "actiontext",
                        "requirements": "= 8.1.3"
                    },
                    {
                        "name": "actionview",
                        "requirements": "= 8.1.3"
                    },
                    {
                        "name": "activejob",
            
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search the registry

**Parameters:**
- `q` (query, required, string) — Search term Example: `http`
- `page` (query, optional, string) — Page number Example: `1`
- `limit` (query, optional, string) — Results per page (1-30, default 20) Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rubygems-api/v1/search?q=http&page=1&limit=20"
```

**Response:**
```json
{
    "data": {
        "page": 1,
        "count": 20,
        "query": "http",
        "results": [
            {
                "info": "An easy-to-use client library for making requests from Ruby. It uses a simple method chaining system for building requests, similar to Python's Requests.",
                "name": "http",
                "version": "6.0.3",
                "licenses": [
                    "MIT"
                ],
                "downloads": 203024816,
                "project_uri": "https://rubygems.org/gems/http"
            },
            {
                "info": "HTTP::Cookie is a Ruby library to handle HTTP Cookies based on RFC 6265.  It has with security, standards compliance and compatibility in mind, to behave just the same as today's major web browsers.  It has builtin support for the legacy cookies.txt and the latest cookies.sqlite formats of Mozilla Firefox, and its modular API makes it easy to add support for a new backend store.",
                "name": "http-cookie",
                "version": "1.1.6",
                "licenses": [
                    "MIT"
                ],
                "downloads": 645521136,
                "project_uri": "https://rubygems.org/gems/http-cookie"
            },
            {
                "info": "Parse Accept and Accept-Language HTTP headers.",
                "name": "http-accept",
                "version": "2.2.1",
                "licenses": [
                    "MIT"
                ],
    
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/versions` — Version history of a gem

**Parameters:**
- `name` (query, required, string) — Gem name, e.g. rails Example: `rails`
- `limit` (query, optional, string) — Max versions (1-100, default 30) Example: `30`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rubygems-api/v1/versions?name=rails&limit=30"
```

**Response:**
```json
{
    "data": {
        "gem": "rails",
        "count": 30,
        "total": 516,
        "versions": [
            {
                "number": "8.1.3",
                "summary": "Full-stack web application framework.",
                "licenses": [
                    "MIT"
                ],
                "downloads": 5148076,
                "created_at": "2026-03-24T20:27:42.098Z",
                "prerelease": false,
                "ruby_version": ">= 3.2.0"
            },
            {
                "number": "8.1.2.1",
                "summary": "Full-stack web application framework.",
                "licenses": [
                    "MIT"
                ],
                "downloads": 758863,
                "created_at": "2026-03-23T19:45:37.709Z",
                "prerelease": false,
                "ruby_version": ">= 3.2.0"
            },
            {
                "number": "8.1.2",
                "summary": "Full-stack web application framework.",
                "licenses": [
                    "MIT"
                ],
                "downloads": 4523319,
                "created_at": "2026-01-08T20:18:51.400Z",
                "prerelease": false,
                "ruby_version": ">= 3.2.0"
            },
            {
                "number": "8.1.1",
                "summary": "Full-stack web application framework.",
                "licenses": [
                    "MIT"
                ],
                "downloads": 2930884,
               
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Source & endpoints

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/rubygems-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Live RubyGems registry data. /v1/gem = full metadata + runtime/development dependencies + download counts for a gem; /v1/search = search the registry by keyword; /v1/versions = the version history of a gem with per-version downloads.",
        "source": "RubyGems.org (the Ruby community gem registry)",
        "endpoints": [
            "/v1/gem",
            "/v1/search",
            "/v1/versions",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T10:22:01.161Z",
        "request_id": "1fe94bdd-3448-40ed-88e9-d07fe2aa0610"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/rubygems-api
OpenAPI spec: https://www.oanor.com/api/rubygems-api/openapi.json
