explaingit

mfridman/grpc-gateway

Analysis updated 2026-08-07 · repo last pushed 2025-06-18

GoAudience · developerComplexity · 3/5StaleLicenseSetup · moderate

TLDR

gRPC-Gateway auto-generates a proxy that translates REST JSON requests into gRPC calls, so you can offer both API styles from a single codebase without maintaining duplicate endpoints.

Mindmap

mindmap
  root((repo))
    What it does
      Translates REST to gRPC
      Auto-generates proxy server
      Returns JSON responses
    How it works
      Reads Protocol Buffers definitions
      Maps URLs via annotations
      External config file option
    Use cases
      Expose REST API to web clients
      Support third-party integrations
      Generate OpenAPI docs
    Tech stack
      Go
      Protocol Buffers
      gRPC
    Audience
      Backend teams
      API developers
      Microservice architects

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Expose a JSON REST API from your gRPC backend so web frontends and third parties can consume it without gRPC support.

USE CASE 2

Generate OpenAPI (Swagger) documentation for your gRPC services automatically so external developers can discover and test endpoints.

USE CASE 3

Keep gRPC and REST interfaces in sync by defining your API once in Protocol Buffers with HTTP annotations.

USE CASE 4

Support clients that cannot natively speak gRPC by placing a translation proxy in front of your microservices.

What is it built with?

GoProtocol BuffersgRPCOpenAPI

How does it compare?

mfridman/grpc-gateway0verflowme/cloudflared0verflowme/pulumi-vultr
LanguageGoGoGo
Last pushed2025-06-182024-10-192022-12-26
MaintenanceStaleStaleDormant
Setup difficultymoderatemoderatehard
Complexity3/52/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Protocol Buffers definitions and a basic understanding of gRPC service structure before you can generate the proxy.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

gRPC-Gateway is a tool that lets you offer a traditional, JSON-based REST API alongside a modern gRPC API without building and maintaining two separate codebases. It automatically generates a proxy server that sits in front of your application, translating incoming RESTful web requests into the gRPC format your backend understands, and then translates the responses back to JSON. At a high level, the tool works by reading your service definitions written in Protocol Buffers, a language-agnostic way to describe data. You add small annotations to these definitions to map specific web URLs and HTTP methods (like a POST request to /v1/example) to your internal functions. The tool then generates a reverse-proxy server that handles the translation automatically. If you cannot modify the original definition files, you can also configure these URL mappings using an external file. This is primarily used by backend teams who want the performance and developer experience of gRPC internally, but need to support external clients or tools that expect a standard REST API. For example, a team might build an internal microservice architecture using gRPC for speed, but use this tool to expose a JSON API to a web frontend, a third-party integration partner, or tools that don't support gRPC natively. It also generates OpenAPI (Swagger) documentation, making it easy for outside developers to understand and test the available endpoints. A notable tradeoff of this approach is that it relies on generated code and proxy architecture rather than hand-writing HTTP endpoints. This means you define your API once, ensuring both the gRPC and REST interfaces stay perfectly in sync. The project also provides signed release binaries, allowing teams to securely verify that the downloaded code hasn't been tampered with.

Copy-paste prompts

Prompt 1
Help me add HTTP annotations to my .proto file so gRPC-Gateway can map a GET request to /v1/users to my ListUsers RPC and a POST to /v1/users to my CreateUser RPC.
Prompt 2
Show me how to set up gRPC-Gateway in a Go project to generate a reverse proxy from my Protocol Buffers service definitions and serve a REST JSON API.
Prompt 3
I have an existing .proto file I cannot modify. How do I use gRPC-Gateway's external configuration file to map custom REST URLs to my gRPC methods?
Prompt 4
Walk me through generating OpenAPI (Swagger) documentation from my gRPC-Gateway annotated .proto file so external developers can test my API endpoints.

Frequently asked questions

What is grpc-gateway?

gRPC-Gateway auto-generates a proxy that translates REST JSON requests into gRPC calls, so you can offer both API styles from a single codebase without maintaining duplicate endpoints.

What language is grpc-gateway written in?

Mainly Go. The stack also includes Go, Protocol Buffers, gRPC.

Is grpc-gateway actively maintained?

Stale — no commits in 1-2 years (last push 2025-06-18).

What license does grpc-gateway use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is grpc-gateway to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is grpc-gateway for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.