How to use Mock API Response Generator
- Enter the resource name (plural) and the fields you want in each item.
- Pick the response kind, envelope and item count.
- 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: 2Output:
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.