Mock API Response Generator

Create realistic fake JSON for users, products, posts, orders, comments and todos, then paste it into MSW, json-server or your tests.

Choose a resource and response shape

How to generate mock API JSON

  1. Choose a Resource: users, products, blog posts, orders, comments or todos.
  2. Set Number of items from 1 to 500.
  3. Pick a Response shape: a raw array, a { "data": [...] } envelope, a paginated response, a json-server db.json, or a single object like GET /users/1. For the paginated shape, set Total records and Page number, and the item count becomes items per page.
  4. Type a Seed for identical output every time, and tick Minify for compact JSON.
  5. Press Copy JSON or Download .json. The json-server shape downloads as db.json.

What each resource contains

Timestamps are ISO 8601 in UTC and rise with id. Emails use example.com, a domain reserved for documentation, and phone numbers use the fictional 555-0100 to 555-0199 block.

Using the output

With Mock Service Worker, return the data from a handler such as http.get('/api/users', () => HttpResponse.json(users)), importing http and HttpResponse as its quick start shows. With json-server, save the db.json shape and run npx json-server db.json to get /users and /users/1 on port 3000. To type the data, paste it into the JSON to TypeScript converter.

Worked example with a seed

Keep Users, 10 items and Raw array, then type 2026 in Seed. The status line reads "10 users, 2.7 KB, seed "2026"" and the first object is:

{
  "id": 1,
  "uuid": "36668497-9246-499e-8198-85d173daef6b",
  "firstName": "Daniel",
  "lastName": "Jones",
  "email": "daniel.jones@example.com",
  "phone": "(572) 555-0130",
  "role": "admin",
  "active": true,
  "createdAt": "2025-01-04T16:24:53Z"
}

With a seed, timestamps count back from 2026-01-01, so the file never changes with the date.

Limits and edge cases

One response holds up to 500 items, and a paginated collection can claim up to 100,000 records. A page past the last one shows an error. The data is static JSON made in your browser, not a live endpoint, and your real API's key names may differ, so rename them or tidy the file in the JSON formatter.

Frequently asked questions

How do I turn this JSON into a working fake REST API?

Choose the json-server db.json shape, download db.json and run npx json-server db.json. json-server needs an object with one array per resource and an id on every item, then serves routes such as /users and /users/1 on port 3000.

How do I mock a paginated API with this tool?

Choose the Paginated shape, set Total records and a Page number, and use Number of items as the page size. The response has a data array and a pagination object with page, perPage, total and totalPages, and the last page holds only the remaining records.

How do I get the same mock data every time?

Type any word or number in the Seed box. The same seed with the same resource, count and shape returns identical JSON, and timestamps count back from 2026-01-01 so snapshots do not change from day to day.

Is this a hosted API I can call with fetch?

No. The tool creates static JSON in your browser. To serve it over HTTP, save it as db.json for json-server, or return it from a Mock Service Worker handler in your app or tests.

Sources: json-server README; Mock Service Worker quick start; RFC 2606, Reserved Top Level DNS Names.