Skip to content

JSON Server

Get a full fake REST API with zero coding in seconds.

Self-hostedNot yet verified
Report issue
MIT★ 74000Source project only — not browser-runnable

External Tool

This open-source tool is maintained externally. View the source on GitHub to learn more or run it yourself.

Browse developer tools →

What's next with JSON Server?

Choose how you want to get started.

Use it free

Open the official tool or demo — no account needed.

Free

Self-host it

Run the open-source version on your own infrastructure.

Open

What is JSON Server?

JSON Server is an open-source tool that enables developers to rapidly create a functional fake REST API with minimal setup. By leveraging a JSON file as a database, it simulates backend functionality for HTTP methods like GET, POST, PUT, and DELETE. This tool is widely used by front-end developers, API testers, and prototyping teams to mock server responses without implementing a full backend. It addresses the challenge of quickly establishing API endpoints for development and testing purposes, eliminating the need for complex server configurations or database integrations. The project's simplicity and speed make it ideal for scenarios where real-time data persistence isn't required, but API behavior needs to be validated early in the development cycle.

How it works

JSON Server is a lightweight, open-source tool that generates a mock REST API by reading a JSON file (db.json) as its database. It provides endpoints for standard HTTP methods, allowing developers to simulate backend interactions without writing server-side code. The tool is designed for rapid prototyping, testing, and frontend development. It enables teams to validate API structures, request/response formats, and data flow before implementing a real backend system. JSON Server supports CRUD operations through simple JSON file manipulation. For example, a POST request to /posts can create a new entry in the db.json file's posts array. It also allows filtering, sorting, and pagination via query parameters, such as /posts?_limit=5&_sort=title&_order=asc.

How to use it

  1. 1Install via npm: Run 'npm install json-server' in your project directory. 2. Create a db.json file with structured data, such as { "posts": [{ "id": "1", "title": "Example" }] }. 3. Start the server using 'npx json-server --watch db.json'. 4. Access the API at http://localhost:3000, where endpoints like /posts will return the data from the JSON file. Practical tips include using the --port flag to change the server's port, enabling middleware with --middlewares, and leveraging the UI at http://localhost:3000/ to interact with endpoints directly.

What it can do

  • mock REST API

Use cases

Assumptions and limitations

Assumptions

  • source: https://github.com/typicode/json-server
  • license: MIT — free to use
  • privacy: Self-hosted — you control your data

Limitations

  • No real database persistence; data is stored only in the JSON file and resets on server restart
  • Limited data validation beyond basic schema checks (no complex rules or constraints)
  • No built-in authentication or authorization mechanisms
  • Scalability issues for high-traffic applications due to single-threaded architecture
  • Lack of advanced features like real-time updates or relational database joins

Understanding the result

Get a full fake REST API with zero coding in seconds.

Tool details

  • Clearly flagged when a network request is needed.
  • No account, no sign-up, and no tracking of your content.
  • Powered by (MIT).
Built with
(typicode/json-server)
License
MIT
Runs locally
No — requires a network request
Verification
Not yet verified
Input
Query
Output
Text
Open-source source & license

Built with typicode/json-server. OpenToolVault provides the discovery and browser interface while crediting the original project maintainers.

Built with
License
MIT
View source on GitHub

Open-source project

OpenToolVault is an independent directory. We are not affiliated with or endorsed by this project.

References

Frequently asked

How does JSON Server handle data updates?

JSON Server updates data by modifying the db.json file directly. POST, PUT, and DELETE requests alter the file's contents, which are then served to subsequent requests. Changes persist until the server is restarted, as the tool does not use a traditional database system.

How does JSON Server process HTTP methods?

The tool maps HTTP methods to JSON file operations: GET retrieves data, POST adds new entries, PUT updates existing records, and DELETE removes items. It uses the JSON file's structure to determine which data to return or modify, with query parameters enabling filtering and sorting.

How do I create a custom endpoint?

To create a custom endpoint, add a route in the db.json file using the $schema property. For example, { "$schema": "./schema.json", "users": [...] } defines a /users endpoint. Additional routes can be specified in a routes.json file, which maps custom paths to database tables.

How does JSON Server compare to alternatives like MockServer or WireMock?

JSON Server is simpler and faster to set up but lacks advanced features like dynamic response generation or complex routing found in MockServer or WireMock. It is ideal for basic API mocking, while alternatives offer more flexibility for enterprise-level testing scenarios.

What should I do if the server fails to start?

Common issues include missing db.json files, syntax errors in the JSON, or port conflicts. Verify the file exists and is valid JSON/JSON5. Check the terminal for error messages, and ensure no other process is using port 3000. Use the --port flag to specify an alternative port.

Spotted something wrong with JSON Server, or want to maintain it? See how to help.