OSS TanbouSign in with GitHub

Build REST-like Ruby APIs with routing, parameter validation, versioning, and Rack composition

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
10,009
Primary language
Ruby
License
MIT
Repository last updated
Oct 3, 2026
On this page

Overview

Grape is a Rack-based framework for building REST-like APIs in Ruby. It combines HTTP routing with parameter validation and coercion, versioning, content negotiation, error handling, middleware, and API mounting in a compact API-class model. Master identifies the next 4.1.0 line, while the changelog lists 4.0.1 as the latest released version.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Define routes, namespaces, and API versions with a Ruby DSL

HTTP routes such as GET, POST, PUT, and DELETE can be grouped into namespaces and mounted applications, with path, header, or parameter-based versioning and format negotiation. A Grape API is a Rack application and can also be mounted inside frameworks such as Rails.

Sources: [2]

Keep parameter types, coercion, and validation close to endpoint definitions

requires and optional declarations support type coercion, allowed-value checks, nested parameters, custom validators, and declared extraction so request validation and validation failures can be handled consistently at the API layer.

Sources: [2]

Best fit

Fits JSON APIs, internal services, and Ruby microservices that want an explicit API surface

It is useful when a backend does not need a full-stack UI framework, when an isolated API must be mounted into an existing Rails application, or when versioned REST-like endpoints should remain explicit and modular.

Sources: [2]

Before adoption

Master is the 4.1.0 Next line; verify Ruby and dependency requirements and pin a released gem

Master currently declares Grape::VERSION = 4.1.0, while the changelog labels 4.1.0 as Next and lists 4.0.1 as the latest release. The master gemspec requires Ruby 3.3.1 or newer, ActiveSupport 7.2 or newer, and Rack 2.2.4 or newer. Production deployments should pin a released gem and review 4.x routing, params, and middleware changes during upgrades.

Sources: [3][4][5]

Official sources

  1. [1]ruby-grape/grape — GitHub repository(2026-10-06)
  2. [2]Grape — README(2026-10-06)
  3. [3]Grape — version source(2026-10-06)
  4. [4]Grape — grape.gemspec(2026-10-06)
  5. [5]Grape — CHANGELOG(2026-10-06)
  6. [6]Grape — MIT License(2026-10-06)
Supplemental curator note

Grape fits backends that want an explicit API layer without adopting a full-stack UI framework. Because master is the 4.1.0 Next line, production use should pin a released gem and verify Ruby, ActiveSupport, Rack, and 4.x upgrade requirements.

Try it in 3 steps

  1. 1

    Get the source

    git clone --depth 1 https://github.com/ruby-grape/grape.git
  2. 2

    Enter the repository

    cd grape
  3. 3

    Check the official steps

    Continue with the commands in the README Installation, Quick Start, or Getting Started section.

    find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Check the official README

Growth

Growth trends · Last 30 days

10,009 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
93
Open PRs
30

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • grape
  • api
  • ruby
  • hacktoberfest
Stars
10,009
Forks
1,229
Watchers
193
Open issues
211
Contributors
374
Owner type
Organization
Primary language
Ruby
License
MIT
Repository last updated
Oct 3, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?