Cosmovex Tools

Want json-server without installing it? Paste your db.json and get a live URL

json-server online with Mock API Studio

The editor below holds a db.json in the format json-server reads: top-level arrays of posts and comments, with comments linked by postId. Press Create my API and each array is served at an HTTPS URL with the json-server routes (GET, POST, PUT, PATCH, DELETE on /posts and /posts/:id) and its 0.17 query parameters, with no npm install, no port and no tunnel.

  1. Paste your db.json over the sample, or keep it. Each top-level array becomes a route; a key holding a single object (like "profile") becomes a list resource, not a singular route.
  2. Set records per resource (up to 25 on Free). Your own rows are kept first and extra rows are generated from the field names, so a 2-row file can still produce 20 posts. Set the count to your row count to serve only your data.
  3. Press Create my API and swap http://localhost:3000 in your app for the base URL shown. Routes are the same: /posts, /posts/1, /comments?postId=1.
  4. Use the json-server 0.17 query style: ?_page=1&_limit=10, ?_sort=views&_order=desc, ?title_like=hello, ?views_gte=100, ?id_ne=2, and ?q= for full-text search.
  5. Writes follow REST conventions: POST returns 201 with the next id, PUT replaces, PATCH merges, DELETE returns 204; changes are stored in the project instead of rewriting a local file.
json server online mock json server onlinejson server online freehost json server onlinemy json server alternativejson-server hosted
Open Mock API Studio Free · Pro $5/mo · no account

What to know

json-server is the quickest way to fake a REST API locally, but it lives on your machine: a phone on another network, a preview deploy, a teammate or a CI job cannot reach localhost:3000 without a tunnel. Pasting the same db.json here gives a public HTTPS base URL with permissive CORS that answers whether your laptop is on or not, so a mobile build and a hosted preview can share one fake backend.

Query parameters follow json-server 0.17: _page and _limit with an X-Total-Count header and a Link header, _sort and _order, field filters with repeated keys for OR, and the _ne, _like, _gte and _lte suffixes, plus q for full-text search. json-server 1.x changed its syntax (field:gt=, _per_page, a paginated envelope, _embed); those forms are not understood here, and an operator such as views:gt=100 is treated as an exact filter on a field named "views:gt" and matches nothing. If your client was written for 1.x, change the operators to the 0.17 suffixes.

A few json-server features have no equivalent. Singular resources (a top-level object served at /profile) become one-record lists, _embed is not supported, and routes.json, middlewares and static files do not apply. _expand and nested routes such as /posts/1/comments exist but are part of Pro. Ids are numeric and increment like json-server's when your samples use numbers; string ids are kept, and new string ids are random.

Unlike a local db.json, the data is typed. Field types are inferred from your rows, so POST /posts with "views": "many" returns 422 naming the field where json-server would store it. That catches client bugs early, but if your app sends loosely typed data on purpose, edit the field type to string in the field table after creating the API.

Updated · Cosmovex

Questions

Is this the json-server npm package running in the cloud?

No. It is a separate hosted mock API that reads the same db.json shape and answers the same routes and 0.17-style query parameters. Behaviour differs in a few places: typed validation (422), no singular resources, no _embed, and 1.x operators like field:gt= are not supported.

Can I upload my existing db.json file?

Paste its contents into the editor; comments are allowed. The free plan takes up to 2 top-level arrays and 25 records per array; with more arrays you untick the extras or create with the first two. Larger files need Pro (50 resources, 5,000 records each).

Does it write changes back to my db.json?

No. Writes are stored in the hosted project, which is what lets several devices share them. Pro can export the whole project, data included, as a JSON file; Reset to seed returns to your original rows.

Will only my rows be served?

Your rows always come first. If the records-per-resource count is higher than your row count, extra rows are generated from the field names; set the count equal to your largest array to serve only your own data.

How is this different from hosting db.json on GitHub?

Services that read a db.json from a GitHub repo usually serve it read-only and reset writes. Here POST, PUT, PATCH and DELETE persist, you can edit rows in a grid on this page, and a live log shows each request your app makes.

What does it cost?

The free plan gives one project, 2 resources, 25 records each and 300 requests a day, with no account; its data is cleared after 48 hours without requests and restored from the seed when you reopen it. Pro is $5 a month for 10 projects, 50 resources, 5,000 records each, 20,000 requests a day, data that is never cleared, relations, latency and error injection.

The free plan covers everything on this page. Mock API Studio Pro ($5/mo, billed monthly) is described on the Mock API Studio page.