Skip to main content

A simple JSON server

Project description


Fake REST API with zero coding.

This project is heavily inspired by json-server in JavaScript.

Requires Python 3.6+.


It's highly recommended to install with pipx.

$ pipx install

Or install with pip at your own risk:

$ pip3 install

Get Started

Create a db.json file with following content:

  "posts": []

Start a server:

$ json-server db.json

Create a post:

$ curl -H 'content-type: application/json' -d '{"content":"blablabla"}' http://localhost:3000/posts

List all posts:

$ curl http://localhost:3000/posts


Usage: json-server [OPTIONS] [FILENAME]

  Start a JSON server.

  FILENAME refers to the JSON file where your data is stored. `db.json` will
  be used if not specified.

  --version        Show the version and exit.
  -b, --bind TEXT  Set address to bind, default as `:3000`
  --help           Show this message and exit.


  • Collections must be contained in your data file before starting the server, otherwise the server cannot decide the type of resources.


# Start with default config
$ json-server

# Listen on port 3000
$ json-server -b :3000

# Specify a json file
$ json-server db.json

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for, version 0.1.9
Filename, size File type Python version Upload date Hashes
Filename, size (4.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page