RubyGems API
Free RubyGems API with no key: gem metadata, versions, download counts, dependencies, licence and source URLs. CORS enabled. Tested curl example.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the RubyGems API?
The RubyGems API is a free, key-free registry API returning metadata for any published Ruby gem — current version, download counts, dependencies, licences and source code URLs.
RubyGems exposes clean, flat JSON for every gem. Unlike some registries the response is immediately readable: name, version, downloads, authors, licences and dependencies all sit at the top level with no envelope to unwrap.
The split between `downloads` (all-time) and `version_downloads` (this version only) is useful for judging adoption of a recent release, which a single total cannot tell you.
Quick facts
- Base URL
https://rubygems.org/api/v1- Authentication
- No API key for reads. Publishing gems requires an API key.
- Rate limit
- About 10 requests per second; heavier consumers should use the published data dumps.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the RubyGems API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Fetch metadata for a Ruby gem
GET https://rubygems.org/api/v1/gems/rails.json
curl 'https://rubygems.org/api/v1/gems/rails.json'const res = await fetch("https://rubygems.org/api/v1/gems/rails.json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://rubygems.org/api/v1/gems/rails.json", timeout=20)
res.raise_for_status()
print(res.json()){
"name": "rails",
"downloads": 777445565,
"version": "8.1.3.1",
"version_created_at": "2026-07-29T15:02:41.060Z",
"version_downloads": 2902228,
"platform": "ruby",
"authors": "David Heinemeier Hansson",
"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.",
"licenses": [
"MIT"
],
"metadata": {
"changelog_uri": "https://github.com/rails/rails/releases/tag/v8.1.3.1",
"bug_tracker_uri": "https://github.com/rails/rails/issues",
"source_code_uri": "https://github.com/rails/rails/tree/v8.1.3.1",
"mailing_list_uri": "https://discuss.rubyonrails.org/c/rubyonrails-talk",
"documentation_uri": "https://api.rubyonrails.org/v8.1.3.1/",
"rubygems_mfa_required": "true"
},
"yanked": false,
"sha": "ccd11a36bfc171bf9c66d585d14c0ece91c0c9dde840aae60c0118d6f5c9c52a",
"spec_sha": "5b60af49df6edf722925a85d144f1118abda22485a820da2c516e97cab8347b8",
"project_uri": "https://rubygems.org/gems/rails",
"gem_uri": "https://rubygems.org/gems/rails-8.1.3.1.gem",
"homepage_uri": "https://rubyonrails.org",
"wiki_uri": null,
"documentation_uri": "https://api.rubyonrails.org/v8.1.3.1/",
"mailing_list_uri": "https://discuss.rubyonrails.org/c/rubyonrails-talk",
"source_code_uri": "https://github.com/rails/rails/tree/v8.1.3.1",
"bug_tracker_uri": "https://github.com/rails/rails/issues",
"changelog_uri": "https://github.com/rails/rails/releases/tag/v8.1.3.1",
"funding_uri": null,
"dependencies": {Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
gems/<name>.json | path | Required | Gem name. rails |
versions/<name>.json | path | Optional | All published versions of a gem. rails |
search.json?query= | path | Optional | Search gems by keyword. http |
Response fields
namestring- Gem name.
versionstring- Current released version.
downloadsinteger- All-time download count.
version_downloadsinteger- Downloads of the current version only.
authorsstring- Gem authors as a single string.
licensesarray- Licence identifiers.
source_code_uri / homepage_uristring- Repository and homepage links, often null.
dependenciesobject- Runtime and development dependencies.
What you can build with the RubyGems API
- Display the current version of a gem in documentation or a badge
- Check whether a dependency has a newer release
- Audit gem licences for compliance
- Compare adoption between gems using download counts
Common errors and how to fix them
404
Gem name not found.
Fix: Gem names are case-sensitive and use hyphens or underscores exactly as published.
null source_code_uri
Not every gem declares its repository.
Fix: Fall back to homepage_uri, then to the RubyGems page itself.
RubyGems API — frequently asked questions
Is the RubyGems API free?
Yes, reads require no API key. An API key is only needed to publish or yank gems.
How do I get the latest version of a gem?
Request /api/v1/gems/<name>.json and read the `version` field, which always reflects the current release.
What is the difference between downloads and version_downloads?
`downloads` is all-time across every version; `version_downloads` counts only the current version, which is a better signal of whether a recent release has been adopted.
Can I see a gem's dependencies?
Yes, the `dependencies` object separates runtime from development dependencies, each with version requirements.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Validator
Free online JSON validator: validate JSON and find syntax errors with the exact line and column. See root type, key counts and depth — instant and 100% private.
RubyGems is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.