---
title: "RubyGems API: Search gems | Perceptlayer"
description: "Ruby gems on RubyGems.org matching a query, with latest version, downloads, licences, authors and source links. 30 per page."
url: https://perceptlayer.com/apis/rubygems/search
---

[APIs](https://perceptlayer.com/apis) / [RubyGems](https://perceptlayer.com/apis/rubygems) / Search gems

# RubyGems: Search gems

Ruby gems on RubyGems.org matching a query, with latest version, downloads, licences, authors and source links. 30 per page.

GET `/v1/rubygems/search`

## Parameters

Send parameters in the query string.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `query` | string | Required | Up to 200 characters Words to match in the gem name or description. |
| `page` | integer | Optional | Any Results page, from 1. |

## Example request

RubyGems

GET /v1/rubygems/search?query=rails 

```
{
  "success": true,
  "data": {
    "page": 1,
    "has_more": true,
    "count": 30,
    "items": [
      {
        "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": 827543057,
        "version_downloads": 6972057,
        "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"
      },
      {
        "name": "rails-i18n",
        "version": "8.1.2",
        "info": "A set of common locale data and translations to internationalize and/or localize your Rails applications.",
        "authors": "Rails I18n Group",
        "licenses": [
          "MIT"
        ],
        "downloads": 149474751,
        "version_downloads": 10678,
        "homepage_uri": "https://github.com/svenfuchs/rails-i18n",
        "url": "https://rubygems.org/gems/rails-i18n"
      },
      {
        "name": "rails-html-sanitizer",
        "version": "1.7.2",
        "info": "HTML sanitization for Rails applications",
        "authors": "Rafael Mendonça França, Kasper Timm Hansen, Mike Dalessio",
        "licenses": [
          "MIT"
        ],
        "downloads": 746339336,
        "version_downloads": 9695007,
        "homepage_uri": "https://github.com/rails/rails-html-sanitizer",
        "source_code_uri": "https://github.com/rails/rails-html-sanitizer/tree/v1.7.2",
        "documentation_uri": "https://www.rubydoc.info/gems/rails-html-sanitizer/1.7.2",
        "url": "https://rubygems.org/gems/rails-html-sanitizer"
      }
    ]
  },
  "meta": {
    "request_id": "req_579c613476c14c05959ca1d0f8a136d1",
    "credits_charged": 1,
    "credits_remaining": 446
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

[Run this endpoint in the playground](https://perceptlayer.com/apis/rubygems?try=search#playground) with your own parameters. 1 credit per successful call; failed calls are free.

## Response fields

Each item in `data.items` has these 11 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

| Field | Type |
| --- | --- |
| `name` | string |
| `version` | string |
| `info` | string |
| `authors` | string |
| `licenses` | string\[\] |
| `downloads` | integer |
| `version_downloads` | integer |
| `homepage_uri` | url |
| `source_code_uri` | url |
| `documentation_uri` | url |
| `url` | url |
