There is no single best mock API tool, because "mock API" covers very different jobs: fake data for a tutorial, a stable fixture in CI, a way to test what happens when an API fails. This guide picks the best tools for each job, with what each costs and where it falls short.
Disclosure: we make ReqRes, and it appears below. We have tried to be fair, and we recommend other tools wherever they are the better fit. Facts about other tools come from their own documentation and pricing pages, checked on 28 September 2026.
At a glance
| Tool | Type | Free tier | Data persists | Real user auth | Best for |
|---|---|---|---|---|---|
| ReqRes | Hosted API and backend | No-signup demo; 250 req/day | Yes (projects) | Yes | Frontend, QA, teaching, agents |
| JSONPlaceholder | Hosted fake data | Free, no signup | No | No | Tutorials and first requests |
| DummyJSON | Hosted fake data | Free, no signup | No | Demo JWT | Richer fake data |
| json-server | Local CLI | Free, open source | To a local file | No | Offline fake REST from a JSON file |
| Mockoon | Local app, CLI, Docker | Free locally; cloud $100/mo (annual) | In memory | Simulated | Offline mocks in Git, CI |
| WireMock | Library, JAR, Docker; Cloud | Free open source; Cloud 1,000 calls/mo | Scenarios only | Stubbed | Backend integration tests |
| Beeceptor | Hosted mock server | 50 req/day, 3 rules | Capped per endpoint | Header rules | Rule-based mocks, many protocols |
Best for fake data in a frontend prototype
Pick: ReqRes demo API, JSONPlaceholder or DummyJSON. All three are free, hosted and need no signup.
- ReqRes (
https://reqres.in/api/users) adds realistic errors (a 404 for a missing user, a 400 for a login without a password) and?delay=3for loading states. - JSONPlaceholder has the most related resources (posts, comments, albums, todos).
- DummyJSON has the richest data (products, carts, recipes) plus search and a demo JWT login.
None of them store what you POST. When you need that, see the next section.
Best for real persistence and user auth
Pick: ReqRes. Most mock tools either fake writes or keep state only in memory. A ReqRes project stores records until you delete them, and app users can log in with a magic code, get a session and see only their own records. Every request is logged.
await fetch('https://reqres.in/api/collections/tasks/records', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_MANAGE_KEY', // pro_* key for writes, keep it server-side
},
body: JSON.stringify({ data: { title: 'Write tests', done: false } }),
});
Also consider: json-server if you only need persistence on your own machine (it writes to a local file). Mockoon and WireMock keep state while running but reset it; Beeceptor's CRUD storage is capped per endpoint and removes the oldest records first.
Best as a stable fixture in CI/CD
This depends on whether your pipeline should call the internet.
Offline, in the pipeline: Mockoon or WireMock.
- Mockoon has an official GitHub Action (
mockoon/cli-action) and a Docker image, and your mocks are JSON files in the repo. - WireMock is the standard for JVM projects, with JUnit and Testcontainers support and precise request verification.
Hosted and deterministic: ReqRes Agent Sandbox. Its endpoints return byte-identical responses for the same seed and world version, and every response carries an X-World-Version header you can pin in assertions, so a fixture never drifts under your tests. When you need it offline, the same sandbox runs as a Docker image:
docker run -p 8080:8080 ghcr.io/benhowdle89/reqres-agent-world:v1.1.0
For tests that create data and read it back, point them at a ReqRes project instead of a fake API that discards writes.
Best for testing error handling (429s, 500s, timeouts)
- WireMock for low-level faults: connection resets, malformed chunks, empty responses, fixed or random delays.
- Beeceptor for probabilistic chaos: latency profiles and weighted failures (for example, fail 1% of requests).
- Mockoon to build any failure yourself with rules, status codes and per-route latency.
- ReqRes for ready-made failures with realistic headers and nothing to configure. Three are free with no signup:
curl -i https://reqres.in/agent/v1/scenarios/rate-limited # 429 with Retry-After
curl -i https://reqres.in/agent/v1/scenarios/validation-error # 422
curl -i https://reqres.in/agent/v1/scenarios/malformed-json # 200 with a broken body
All 15 scenarios (timeouts, 5xx errors, redirect loops, partial content and more) and scripted failure sequences come with the ReqRes Agent Developer plan. See testing error handling.
Best for testing AI agents and tool calls
Pick: ReqRes Agent Sandbox. It was built for this: deterministic, seeded fixtures so an agent run can be replayed exactly, deliberate failure scenarios, scripted failure chains (such as a rate-limit storm or an auth token expiring mid-session), and recorded trajectories you can diff between runs. The free tier allows 100 requests a day per IP with no key. See ReqRes for AI agents.
Best for testing payment flows without real charges
Pick: your payment provider's own test mode first. If you use Stripe, its test mode with test cards is the most accurate way to test your real integration.
For practice and agent testing: the ReqRes Payments Sandbox (/sim/payments/v1/) simulates a payment lifecycle with no real money and no provider account: test tokens decide the outcome (success, decline, insufficient funds, expired card, fraud block, 3-D Secure), idempotency keys are enforced, and failed confirmations return HTTP 402. It is not affiliated with any payment provider.
Best for teaching API testing
Pick: ReqRes. It needs no signup to start, it returns realistic success and error responses, and each student can get their own project when the class moves on to persistent data and auth. For a full list of free APIs and practice exercises, see 10 free public APIs to practise API testing.
Best for mocking a third-party API exactly
Pick: Beeceptor or WireMock. When you need to reproduce another company's API response by response, rule-based tools win. Beeceptor supports REST, GraphQL, SOAP and gRPC and can proxy the real API; WireMock can record a real API and play it back.
A note on Mocky
Mocky (mocky.io) was a popular way to host a single fixed response. As of 28 September 2026 its URLs no longer serve mocks. See Mocky alternatives.
How to choose
- Does the data need to survive the request? If yes, rule out JSONPlaceholder, DummyJSON and Mocky-style static mocks.
- Does anyone else need to reach it? If yes, you need a hosted tool (ReqRes, Beeceptor, or a paid cloud tier of Mockoon or WireMock).
- Must it run offline? If yes, json-server, Mockoon or WireMock.
- Are you testing failures? Pick by how much control you need: WireMock (lowest level), Beeceptor (probabilistic), ReqRes (ready-made).
Detailed comparisons
- ReqRes vs Mockoon
- ReqRes vs WireMock
- ReqRes vs Beeceptor
- ReqRes vs json-server
- JSONPlaceholder alternatives
Common questions
What is the best mock API for testing a web app?
For a hosted API your whole team can use, with data that persists and real logins, ReqRes. For offline mocks kept in your repository, Mockoon. For backend integration tests on the JVM, WireMock. For rule-based mocks of third-party APIs, Beeceptor.
Which mock API services support persistence and user auth?
ReqRes supports both: stored records and app users with login and per-user data. json-server persists to a local file but has no auth. Mockoon, WireMock and Beeceptor keep limited or temporary state and simulate auth with rules.
Which mock API is best for CI/CD?
If your pipeline runs offline, Mockoon (official GitHub Action) or WireMock (Testcontainers). If it can call a hosted service, the ReqRes Agent Sandbox returns byte-identical responses for a given seed and world version, and also runs as a Docker image.
How can I test rate limits, 500s and timeouts?
Use WireMock or Mockoon to build the failures yourself, Beeceptor for weighted random failures, or ReqRes failure scenarios for ready-made responses such as a 429 with a Retry-After header.