CruxDevCruxDev Tools Prompts
dev Utility • Zero-Server Privacy • 100% Client-Side

Fake REST API / Mock Data Generator

Generate realistic mock JSON API responses — users, products, posts, addresses, payments — with configurable schemas and counts.

Overview

Generates mock JSON API responses for three ready-made schemas: users, products, and posts. Choose a schema, set a count from 1 to 100, and the tool produces a JSON array whose fields mimic a typical REST response for that entity. A regenerate button reseeds everything, and the output is clickable to copy. All of it runs locally with no request, which makes it a fixture generator rather than a hosted mock server.

How It Works

Select Users, Products, or Posts from the schema buttons. Set the count; the array regenerates automatically whenever the schema or count changes. Users get an id, first and last name, a firstname.lastname@gmail.com style email, and an age between 18 and 77. Products get a name, a price between 5.00 and about 505.00 in USD, an in-stock flag, and a rating. Posts get a title, body text, an author name, a createdAt timestamp within the last 30 days, and a like count. Press Regenerate for a new batch and click the output to copy it.

Step-by-Step Usage Guide

  1. Choose a schema: users, products, or posts.
  2. Set the number of records, up to 100.
  3. Press Regenerate if you want a different random batch.
  4. Click the output panel to copy the JSON array into your project or test.

Technical Specifications & Standards

The generator is a set of template arrays and Math.random picks, which has consequences for how realistic the data is. The users schema draws first and last names from fixed pools of ten each, and builds emails as firstname.lastname@gmail.com, so two records with the same drawn pair collide on the email field; uniqueness is not enforced anywhere, and the same applies to post authors. Product prices are uniformly random between 5 and roughly 505 with two decimals, and ratings between 1.0 and 5.0, so distributions are flat rather than shaped like real catalogs. Post timestamps are computed as now minus a random number of days up to 30, serialized with toISOString, so they are valid ISO-8601 in UTC. Ids are simply the 1-based loop index, so they are always unique and ordered, unlike most real id sequences. The catalog description mentions configurable schemas, but the three entity shapes are fixed; there is no field-level customization, no API endpoint emulation, and no latency or status-code simulation. If you need custom fields or an actual HTTP mock, generate here and transform the JSON, or use a dedicated mock server.

Targeted Use Cases

  • Seeding a frontend with realistic list data before the real API exists.
  • Populating a development database or an in-memory store for manual testing.
  • Generating payload examples for API documentation and design reviews.
  • Producing fixtures for unit tests that need more than two or three records.

Notes & Gotchas

  • Do not rely on email uniqueness; the generator can produce duplicate addresses by design.
  • Copy a batch when a test depends on stable data, since regeneration draws fresh randomness.
  • Adjust generated data afterward if you need realistic distributions, because prices and ratings here are uniform random.
  • Keep generated data out of production databases; the gmail addresses belong to a fixed name pool, not to real people.

Frequently Asked Questions

Can I customize the fields in each schema?

No. The three schemas are fixed in code. You can generate the JSON and edit it afterward, but the tool has no field-level configuration despite the general description.

Why do two generated users sometimes share an email address?

Emails are built from a small pool of first and last names in firstname.lastname form, with no uniqueness check. With enough records, collisions are expected; treat the email field as a placeholder, not a unique key.

Is this an actual REST API I can call?

No. It generates JSON that looks like an API response, but everything happens in your browser with no server and no endpoints. Copy the output and serve it yourself.

How random is the data?

It uses JavaScript's Math.random, which is fine for fixtures but not cryptographic, and draws from fixed pools of names and text. Distributions are uniform, so prices and ratings will look flatter than real-world data.