Fake REST API

Input
Output

Fake REST API

Public fake APIs return their data, not yours. Paste your own JSON, a list of users, products or orders, and Bracely serves it at an address in your browser: the whole list, and each item by its id, ready for a prototype or a demo.

Example: your own users at /mock/users

A list of users with Path set to /users. The list answers at /mock/users, and each user at /mock/users/{id}:

Your JSON

[
  {
    "id": 1,
    "name": "Ananya Rao",
    "role": "admin"
  },
  {
    "id": 2,
    "name": "Ravi Kumar",
    "role": "member"
  }
]

Output

GET · https://bracely.saurabhpagrut.in/mock/users · 200 ·  · 
GET · https://bracely.saurabhpagrut.in/mock/users/{id} one item from /users · 200 ·  ·

How do I use the Fake REST API?

  1. Paste a JSON list, such as users with ids, and set Path to /users.
  2. Press Start the mock.
  3. Fetch /mock/users for the list and /mock/users/2 for one user.

What does the Fake REST API do?

  • Your data, not someone else's
  • Each item by id, sku or slug
  • A delay to test loading states

When to use the Fake REST API

JSONPlaceholder and similar sites are handy, but their users and posts aren't your data. When a prototype or a demo needs your own records, with your field names, a fake REST API made from your JSON is closer to the real thing.

Paste a list of objects and set Path, say /users. The list answers at /mock/users, and each item answers at /mock/users/{id}, found by its id, or by _id, uuid, slug, code or sku when there's no id. Set a Delay to see your loading states, or write the routes out as keys (GET /users, POST /users) when you need more than one.

Frequently asked questions

How do I call it from my app?
From a page on this site, fetch("/mock/users"). Your own app on another address can't reach it, because a service worker only answers its own site's pages. Use it to try out the data in API request or API tests, or copy the JSON into your app's own mock.
Where are the routes kept?
In this browser's cache, until you press Stop. They survive a reload, and other Bracely tabs use the same routes.
Is my data uploaded?
No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.

More JSON tools

Bracely has 104 JSON tools in one page. Related ones:

Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut · About · Privacy policy
Last updated · Version 6.1 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram