APIs / Apps and media / RubyGems

1 credit per call3 endpoints8 datapoints

RubyGems API

RubyGems API for Ruby gem search, gem details with dependencies and recent versions, and the gems that depend on a gem, as JSON. 1 credit per call.

RubyGems
GET/v1/rubygems/gem?name=rails
{
  "success": true,
  "data": {
    "name": "rails",
    "version": "8.1.4.1",
    "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.",
    "authors": "David Heinemeier Hansson",
    "licenses": [
      "MIT"
    ],
    "downloads": 827540814,
    "version_downloads": 6971151,
    "homepage_uri": "https://rubyonrails.org",
    "source_code_uri": "https://github.com/rails/rails/tree/v8.1.4.1",
    "documentation_uri": "https://api.rubyonrails.org/v8.1.4.1/",
    "url": "https://rubygems.org/gems/rails",
    "latest_version": "8.1.4.1",
    "latest_version_created_at": "2026-11-04T02:47:52.512Z",
    "platform": "ruby",
    "sha256": "365c3a0ad2713bd6e60628e5e826622d4ca8dee60b5a7e560e9b20844e9650bc",
    "changelog_uri": "https://github.com/rails/rails/releases/tag/v8.1.4.1",
    "bug_tracker_uri": "https://github.com/rails/rails/issues",
    "mfa_required": true,
    "dependencies": {
      "runtime": [
        {
          "name": "actioncable",
          "requirements": "= 8.1.4.1"
        },
        {
          "name": "actionmailbox",
          "requirements": "= 8.1.4.1"
        },
        {
          "name": "actionmailer",
          "requirements": "= 8.1.4.1"
        }
      ]
    },
    "version_count": 523,
    "versions": [
      {
        "version": "8.1.4.1",
        "created_at": "2026-11-04T02:47:52.512Z",
        "downloads": 6971867,
        "prerelease": false,
        "platform": "ruby",
        "ruby_version": ">= 3.2.0",
        "licenses": [
          "MIT"
        ],
        "summary": "Full-stack web application framework."
      },
      {
        "version": "8.1.4",
        "created_at": "2026-09-24T14:22:14.180Z",
        "downloads": 5053271,
        "prerelease": false,
        "platform": "ruby",
        "ruby_version": ">= 3.2.0",
        "licenses": [
          "MIT"
        ],
        "summary": "Full-stack web application framework."
      },
      {
        "version": "8.1.3.1",
        "created_at": "2026-07-29T15:02:41.060Z",
        "downloads": 15953528,
        "prerelease": false,
        "platform": "ruby",
        "ruby_version": ">= 3.2.0",
        "licenses": [
          "MIT"
        ],
        "summary": "Full-stack web application framework."
      }
    ]
  },
  "meta": {
    "request_id": "req_8408ad30fc04408c9727f7f7fca6e5fb",
    "credits_charged": 1,
    "credits_remaining": 486
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Sample data

What one call returns

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

#versionstringcreated_atstringdownloadsintegerprereleasebooleanplatformstringruby_versionstringlicensesstring[]summarystring
18.1.4.12026-11-04T02:47:52.512Z6971867falseruby>= 3.2.0[1 item]Full-stack web application framework.
28.1.42026-09-24T14:22:14.180Z5053271falseruby>= 3.2.0[1 item]Full-stack web application framework.
38.1.3.12026-07-29T15:02:41.060Z15953528falseruby>= 3.2.0[1 item]Full-stack web application framework.

Recorded from our API · 3 items shown · 8 datapoints per itemGET /v1/rubygems/gem?name=rails

8 datapoints

Location

  • platformstring

Other

  • versionstring
  • created_atstring
  • downloadsinteger
  • prereleaseboolean
  • ruby_versionstring
  • licensesstring[]
  • summarystring

Playground

Run this API

cURLshell
curl "https://api.perceptlayer.com/v1/rubygems/gem?name=rails" \
  -H "X-API-Key: $API_KEY"

RubyGems · 3 endpoints

Endpoints

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

EndpointRequired parametersReturnsCost
GET/v1/rubygems/gem
name
nameversioninfoauthorslicensesdownloads+15 more
1 credit
GET/v1/rubygems/reverse-dependencies
name+2 optional
nameurl
1 credit
GET/v1/rubygems/search
query+1 optional
nameversioninfoauthorslicensesdownloads+5 more
1 credit

Overview

About the RubyGems API

What you can get

The RubyGems API returns Ruby gem data from RubyGems.org as JSON through 3 endpoints.

  • Search: search takes a query (words in the gem name or description), with page. Results come 30 per page.
  • Gem: gem takes a gem name, for example rails.
  • Reverse dependencies: reverse-dependencies takes a gem name, with page and per_page (1 to 100, default 50). Gems come sorted by name.

The recorded search for "rails" returned items, each with name, version, info, authors, licenses, downloads, version_downloads, homepage_uri, source_code_uri, documentation_uri and url. Search reports no total; has_more says whether another page may follow.

The recorded gem for rails returned latest_version 8.1.4.1 with 827,540,814 downloads, licenses MIT and a version_count of 523. It adds latest_version_created_at, platform, sha256, changelog_uri, bug_tracker_uri, mfa_required, dependencies split into runtime and development (each with name and requirements), and up to 50 recent versions, each with version, created_at, downloads, prerelease, platform, ruby_version, licenses and summary. The recorded reverse-dependencies call for rack found 3,768 gems that depend on it (total), each with name and url.

How a call works

Search, then look up: GET /v1/rubygems/search?query=rails with your key in the X-API-Key header returns each gem's name; gem and reverse-dependencies take that name, for example GET /v1/rubygems/reverse-dependencies?name=rack&per_page=20. 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 mediaJSONRESTMCP

More apps and media APIs

Use cases

Let a coding agent check a gem's current version and minimum Ruby version before editing a `Gemfile`

Use the RubyGems API to let a coding agent check a gem's current version and minimum Ruby version before editing a `Gemfile`

Vet a gem: licence, MFA requirement for publishing, release cadence and source link

Use the RubyGems API to vet a gem: licence, MFA requirement for publishing, release cadence and source link

Measure a gem's reach by how many gems depend on it

Use the RubyGems API to measure a gem's reach by how many gems depend on it

List a gem's runtime dependencies with their version requirements

Use the RubyGems API to list a gem's runtime dependencies with their version requirements

FAQ

Questions

Is this the official RubyGems API?

No. Perceptlayer is an independent service and is not affiliated with RubyGems.org. The RubyGems.org API is free to call directly, with a limit of 10 requests a second per IP. This API calls it on your behalf and adds one key for every source on Perceptlayer, gem details and version history merged into one response shape, a cache of up to an hour, and no charge for failed calls.

Does `gem` return every version?

It returns `version_count` and the 50 most recent versions. In the recording, rails had 523 versions.

Why does `search` have no total?

RubyGems.org doesn't report one for searches. Pages hold 30 gems; when a page comes back full, `has_more` is true.

What does `reverse-dependencies` return?

The names of the gems that depend on a gem, with a link to each and the `total`. It doesn't return the version requirement each one uses; call `gem` on a dependent to see its `dependencies`.

Should I build a RubyGems scraper instead?

You can, but a RubyGems scraper is code you maintain: page changes break it, requests get blocked, and RubyGems's terms govern how you collect data. The RubyGems 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 RubyGems API with 100 free credits

No credit card. Failed calls are never billed.