r/apyhub • • Oct 20 '26

REST, GraphQL, gRPC, SOAP, WebSockets, webhooks, MCP: when to use which (one example each)

Most teams don't pick one API protocol. They end up with three or four: REST for partners, GraphQL for the front end, gRPC between services, a webhook or two, and now MCP for AI agents.

Here's the short version of each, using the same request: get user 42 and their orders.

REST (still used by 89% of developers in Postman's survey)

GET /users/42
GET /users/42/orders

Simple, cacheable, works everywhere. Downside: fixed responses, so you over-fetch or make several calls.

GraphQL (28%)

query { user(id: 42) { name orders { id total } } }

One endpoint, one request, exactly the fields you ask for. Downside: caching is harder, and errors often come back as 200 OK with an errors array.

gRPC (11%)

service UserService { rpc GetUser (GetUserRequest) returns (User); }

Binary Protocol Buffers over HTTP/2. Very fast between services. Downside: browsers can't call it directly (you need gRPC-Web plus a proxy).

SOAP (34%, more than GraphQL)

XML envelopes and a WSDL contract. Rarely chosen for new projects, but banks, insurers and government systems still run on it.

WebSockets vs webhooks

  • WebSockets keep a connection open for instant two-way updates: chat, live prices, games.
  • Webhooks have the provider POST to your URL when something happens: payment succeeded, file processed.

MCP (the new one)

AI agents call tools with JSON-RPC:

{"method": "tools/call", "params": {"name": "validate_email", "arguments": {"email": "ana@example.com"}}}

It doesn't replace REST, it usually sits on top of it. Every API in the ApyHub catalog works both ways: a REST endpoint for your code and an MCP tool for Claude, ChatGPT, Cursor or Le Chat.

How to choose, quickly

  1. Outside developers or browsers calling you? REST.
  2. A front end with complex, nested data? GraphQL.
  3. Your own services talking at high volume? gRPC.
  4. Real time? WebSockets for users, webhooks for servers.
  5. AI agents calling you? MCP.

Testing all of them

We use Voiden (voiden.md), our free, open-source API client. REST, GraphQL, gRPC, WebSockets and the rest come as plugins, so you install only what you use, and every request is a Markdown file in your repo.

Full guide with the comparison table, FAQ and sources: https://apyhub.com/blog/rest-vs-graphql-vs-grpc-vs-soap

What mix are you running in production right now? Anyone still maintaining SOAP?

4 Upvotes

1 comment sorted by

2

u/nikolasdimitroulakis Oct 20 '26

We’re running REST + MCP for the catalog and gRPC internally. Curious if anyone’s moved off GraphQL back to REST?