json-server is an npm package that turns a db.json file into a full REST API with one command: every top-level key becomes a collection with GET, POST, PUT, PATCH and DELETE, writes are saved back to the file, and filtering, sorting and pagination come from query parameters. For a front-end that needs a working backend on day one, very little is faster.
| json-server | Fun API Playground | |
|---|---|---|
| What it is | An npm package that serves a JSON file as REST | A hosted and in-browser simulated API catalog |
| Data model | Yours, from db.json | 39 fixed domains |
| Auth and roles | None built in | Bearer roles, signed JWTs, OAuth 2.0 flows |
| Validation errors | None built in | 400 and 422 with field-level messages |
| Concurrency | Not modelled | ETag / If-Match with a real 412 |
| Rate limiting | None | Real 429 with Retry-After |
| Runs in CI with no network | Yes | Yes, through the browser engine; the HTTP API needs the network |
| Setup | npm install and a JSON file | None |
It is a CRUD mirror of your file. It has no authentication, no roles, no validation beyond what the file shape implies, no concurrency control, no rate limits and no business rules, so it answers almost everything with 200 or 201. That makes it a stand-in for a database, not for an API somebody else designed — your client never meets a 409, a 412, a 422 or a 429 unless you write middleware to produce one.
Here the rules come built in and were written by somebody other than you: tickets sell out with a 409, stale versions are refused with 412, validation fails with 422, rate limits answer 429 with Retry-After, tokens expire. Nothing has to be installed or run, the same behaviour is available in the browser and over HTTPS, and each API ships an OpenAPI 3.1 document and a Postman collection.
Use json-server when you need your own data model behind a working REST API in minutes. Use this when the point is to see how a client copes with an API that has rules of its own.
Checked against json-server as of 2026-09.
All 39 mock REST APIs · Getting started guide · About this playground
Last updated