Mock API tools compared: Zyvra, WireMock, Mockoon, json-server and hosted mocks

There are many ways to mock an API, and no single best one. This page describes the common options and when each is a good fit, so you can pick the one that matches your job. Details change, so check each tool’s own site before you decide.

The short version

ToolWhat it isGood for
json-serverA small Node tool that serves a REST API from a JSON fileThe fastest possible fake REST backend for a front-end prototype
WireMockAn open-source HTTP mock server, mostly used from Java, standalone or in DockerDetailed request matching and stubbing, especially in Java test suites
MockoonA desktop app (with a command-line tool) for designing mock APIsA friendly interface for a mock you click together, with environment files you can share
Hosted mock servicesMock APIs run in a vendor’s cloud (Postman’s mock servers and many standalone services)Sharing a mock URL with people outside your network, with no setup
ZyvraA local mock server, API client and test runner in one programRealistic mocks with rules, stored state and failures, kept as files in Git, and run in CI

json-server

You write a JSON file, run one command, and get a REST API with list, read, create, update and delete. It is excellent for a prototype and needs almost no learning. It is not trying to model rules, failure modes or contracts, so it fits where “the data is the API” is enough.

WireMock

WireMock is mature and widely used. You describe stubs (which request gets which response) in JSON or in code, and it can match requests in great detail, record traffic and verify what was called. It is a natural choice in a Java or JVM codebase, and it also runs as a standalone server or a Docker container. Teams that live in code often like that mocks are written as code.

Mockoon

Mockoon is a desktop application: you add routes and responses in a visual interface, and you can run the same environment from a command line. It suits people who want to design mocks by pointing and clicking and then share the environment file.

Hosted mock services

Hosted mocks give you a public URL with nothing to install. They are the easiest way to share a mock with a client or a partner outside your network. The trade-offs are that the mock lives in someone else’s cloud, usually needs an account, depends on the network and may have limits on use. Postman’s mock servers are in this group.

Zyvra

Zyvra runs on your computer and has no account. A mock can pick its answer from the request with rules, switch between scenarios, remember what it was sent, send webhooks, and fail on purpose (slow, errors, dropped connections, rate limits). You can create a mock from an OpenAPI spec, a browser recording or a collection, and update it when the spec changes without losing your rules. It also includes an API client and a test runner, so the same project runs in CI with zyvra run and a JUnit report. Projects are plain YAML files that go into Git.

It is younger than WireMock and has no cloud sharing, so it is a weaker fit if you need a public URL for outsiders, or if your whole stack is JVM code and you want mocks written as code.

How to choose

  • Need a throwaway REST backend in two minutes: json-server.
  • Mocks written as code in a Java project: WireMock.
  • Want to build mocks in a visual app: Mockoon.
  • Need to hand someone outside your team a URL: a hosted service.
  • Want realistic behaviour, failures, an API client and CI in one local tool, with files in Git: Zyvra.

You are not limited to one. Start with what a mock API is and how Zyvra does it, or look at testing API failures and API tests in CI.

Questions people ask

What is the best tool for mocking an API?

It depends on the job. json-server is the quickest for a simple REST API from a JSON file, WireMock is strong in Java projects and for detailed request matching, Mockoon is a friendly desktop app, a hosted service is easy to share with people outside your team, and Zyvra is for a local mock with rules, stored state and failures plus an API client and CI runner.

Which mock API tools run locally and offline?

WireMock, Mockoon, json-server and Zyvra all run on your own computer. Hosted mock services run in someone else's cloud, so they need a network connection and usually an account.

Can I mock an API from an OpenAPI spec?

Several tools can. Zyvra imports OpenAPI 3.x into a mock service and lets you update it when the spec changes, keeping the rules and faults you added.