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.
Official sources
- [1]ruby-grape/grape — GitHub repository(2026-10-06)
- [2]Grape — README(2026-10-06)
- [3]Grape — version source(2026-10-06)
- [4]Grape — grape.gemspec(2026-10-06)
- [5]Grape — CHANGELOG(2026-10-06)
- [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
Get the source
git clone --depth 1 https://github.com/ruby-grape/grape.git - 2
Enter the repository
cd grape - 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
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Hanami6,422 Stars
3 shared tag(s) · 2 shared category(s) · Same language
Compose maintainable Ruby applications from focused router, action, view, database, and asset components
Ruby - Faraday5,951 Stars
3 shared tag(s) · 2 shared category(s) · Same language
Use one Ruby HTTP API while composing adapters and middleware for each client workload
Ruby - Pagy4,994 Stars
3 shared tag(s) · 2 shared category(s) · Same language
add lightweight offset, keyset, countless, and other pagination strategies to Ruby applications
Ruby - Fiber40,204 Stars
3 shared tag(s) · 2 shared category(s)
combine Express-inspired routing, binding, and middleware on top of fasthttp
Go - Echo32,754 Stars
3 shared tag(s) · 2 shared category(s)
A Go web framework that adds routing, middleware, binding, and error handling around net/http
Go - Axum27,382 Stars
3 shared tag(s) · 2 shared category(s)
build Rust HTTP APIs with routing, extractors, and Tower middleware
Rust
Report incorrect information
Tell us if any listing information is incorrect or outdated.