Mock API Response Generator

Runs in browser Mocking

Pick a resource name and fields to get consistent mock responses for common REST patterns — including envelopes, pagination metadata and error formats (RFC 9457 problem details).

TEST DATA ONLY — all generated names, contacts, identifiers and numbers are synthetic and do not belong to real people or accounts.
Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use Mock API Response Generator

  1. Enter the resource name (plural) and the fields you want in each item.
  2. Pick the response kind, envelope and item count.
  3. Generate; copy the body for MSW/Mirage handlers or the raw HTTP for WireMock.

Mock API Response Generator features

  • List, detail, created, updated, deleted, empty, validation-error and not-found responses
  • Plain, { data, meta }, JSend, JSON:API and HAL envelopes
  • Field placeholders inferred from names or given explicitly (price:price:5-500)
  • Realistic headers: Content-Type, Date, ETag, Location, X-Total-Count, X-Request-Id
  • Raw HTTP text for stub servers and documentation; integer or UUID ids; seedable

Mock API Response Generator example

Product list in a JSON:API envelope

Input:

Resource: products
Fields: name:product, price:price:5-500
Response: list, envelope: JSON:API, items: 2

Output:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
X-Total-Count: 47

{ "data": [ { "type": "products", "id": "1", "attributes": { "name": "Coffee Maker", "price": 404.9 }, "links": { "self": "https://api.example.com/v1/products/1" } }, … ], "meta": { "total": 47, "page": 1, "pageSize": 2 }, "links": { … } }

Frequently asked questions about Mock API Response Generator

Which response patterns are covered?

List with pagination metadata, detail, created (201 with Location), updated, deleted (204), empty list, validation error (422) and not found (404) — in plain, { data, meta }, JSend, JSON:API or HAL envelopes.

How do I define fields?

One per line: name, or name:tag, or name:tag:args (price:price:5-500). Without a tag the placeholder is inferred from the field name, so createdAt, email and isActive just work.

What is in the raw HTTP output?

The status line, realistic headers (Content-Type, Date, ETag, Location, X-Total-Count, X-Request-Id) and the body — paste it into a stub server, WireMock mapping or a README.

Can I use it with MSW or Mirage?

Yes. Copy the body into your handler, or generate a full dataset with the Mock API Dataset Generator for json-server-style backends.