Freedom251 › API Mocking Tools
json-server

What json-server is
json-server creates a fake REST API from a JSON data file, giving developers a local endpoint for testing and prototyping without writing API code. It reads `db.json` or `db.json5` and starts a server at `http://localhost:3000`. Array resources support GET, POST, PUT, PATCH and DELETE requests; object resources support GET, PUT and PATCH. Requests can filter by comparison operators, membership, case-insensitive string matching and nested fields. Results can also be sorted and paginated with `_page` and `_per_page`, with a documented default page size of 10. Use `_embed` to include related resources, or `_dependent` with DELETE requests for dependents. json-server serves files from `./public` by default and can serve other directories supplied with `-s`. The package is installed with npm and its package metadata requires Node.js >=22.12.0. It is an MIT-licensed, open-source package available for free. The displayed v1 documentation is marked beta and warns that breaking changes are expected.
Who it suits
json-server suits developers who need a local REST API backed by JSON data for testing or prototyping. It is also useful when a project needs mock data, dynamic responses, filtering, sorting or pagination without building an API first.
What it does well
- Creates a fake REST API without coding.
- Reads JSON and JSON5 data files.
- Supports filtering, sorting and pagination.
- Can include related resources with `_embed`.
- Serves static files from `./public` by default.
- Free, open source and MIT-licensed.
What to know first
- Requires Node.js >=22.12.0.
- The displayed v1 documentation is beta and warns of breaking changes.
Limits
The displayed v1 documentation is beta and warns users to expect breaking changes. The package metadata requires Node.js >=22.12.0.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| json-server | MIT-licensed open-source package · runs locally from a JSON or JSON5 file | Free |
As github.com lists them, read 4 Oct 2026. The maker's own page has the final word.
Getting started
- Install the package with npm.
- Prepare a `db.json` or `db.json5` data file.
- Run json-server to start the local server at `http://localhost:3000`.
- Place static files in `./public`, or pass additional directories with `-s`.
- Use the available routes and query parameters to work with the data.
Verdict
Choose json-server for a free local REST API built from JSON or JSON5 files, with routes and query features for testing and prototyping. Look elsewhere if you need a version with no expected breaking changes or cannot use Node.js >=22.12.0.
Questions
How much does json-server cost?
The listed plan is free. The package is open source under the MIT License.
Is there a free plan or free trial?
Yes, a free plan is available. There is no free trial.
Which platforms does json-server support?
The listed platforms are API and self-hosted. It starts a local server at `http://localhost:3000`.
What data files can it use?
json-server reads `db.json` and `db.json5` files.
What does the beta status mean for buyers?
The displayed v1 documentation is marked beta and warns that breaking changes are expected.
Facts from json-server's own pages
- Compatibility
- The README describes the tool as a fake REST API; its repository topics include frontend, mock, REST and test. · github.com, 4 Oct 2026
- Data files
- It reads a db.json or db.json5 file and starts a local server at http://localhost:3000. · github.com, 4 Oct 2026
- Filtering
- Query filters support comparison operators, membership, case-insensitive string matching and nested fields. · github.com, 4 Oct 2026
- HTTP routes
- Array resources support GET, POST, PUT, PATCH and DELETE routes, while object resources support GET, PUT and PATCH. · github.com, 4 Oct 2026
- Install and runtime
- The package is installed with npm, and its package metadata specifies Node.js >=22.12.0. · github.com, 4 Oct 2026
- License
- The repository is licensed under the MIT License. · github.com, 4 Oct 2026
- Purpose
- json-server creates a fake REST API with zero coding for testing and prototyping. · github.com, 4 Oct 2026
- Relationships
- The _embed query parameter includes related resources, and DELETE supports a _dependent parameter for dependents. · github.com, 4 Oct 2026
- Security and compliance
- The opened project pages provide no security or compliance certification statements. · github.com, 4 Oct 2026
- Sorting and pagination
- Requests can sort results and paginate them with _page and _per_page; the documented default page size is 10. · github.com, 4 Oct 2026
- Static files
- It serves files from ./public by default and can serve additional directories passed with -s. · github.com, 4 Oct 2026
- Version status
- The README identifies the displayed v1 documentation as beta and warns users to expect breaking changes. · github.com, 4 Oct 2026
Where json-server stands on Freedom251
- API Mocking Tools#6 of 26