Sample JSON / Mock API Response Generator
Generate realistic mock API responses from a JSON Schema or example. REST single/array, paginated envelopes, JSON:API, GraphQL, error templates, and webhook payloads. Status codes, headers, MSW snippet. 100% client-side.
About Sample JSON / Mock API Response Generator
Generate realistic mock API responses from a JSON Schema or example. REST single/array, paginated envelopes, JSON:API, GraphQL, error templates, and webhook payloads. Status codes, headers, MSW snippet. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
How does the mock API response generator work?
Paste a JSON Schema (or an example JSON we infer a schema from), pick an endpoint type (REST, paginated, JSON:API, GraphQL, error, or webhook), set a count and seed, and we generate a realistic mock response that honors type, format, enum, minimum/maximum, and required-field constraints. You also get a matching HTTP status line, sensible headers, and a ready-to-paste MSW handler snippet.
Which JSON Schema keywords are supported?
type, format (email, uuid, date, date-time, time, uri, ipv4, ipv6, phone, color, password, semver, slug), enum, const, minimum, maximum, exclusiveMinimum, exclusiveMaximum, minLength, maxLength, minItems, maxItems, items, properties, required, and an x-faker override for any field. Arrays generate N items; nested objects recurse; circular $refs are detected.
What envelope presets are built in?
Five: (1) None — raw object/array. (2) REST Pagination — { data, page, limit, total, pages }. (3) JSON:API — { data: [{ type, id, attributes }], meta }. (4) GraphQL — { data, errors }. (5) OData — { value, '@odata.context' }. You can also pick the HTTP status code and we add Content-Type, X-Request-Id, RateLimit-* headers as appropriate.
Are my schemas or example data uploaded anywhere?
No. Schemas are processed entirely in your browser. Nothing is sent to a server. History (last 20 generations) is stored in localStorage on this device only, and the shareable URL encodes options in the fragment (after #) which browsers never transmit.
What extra features does this tool have versus others?
(1) JSON Schema input with 12+ format generators. (2) Example → schema inference. (3) 5 envelope presets (REST, paginated, JSON:API, GraphQL, OData). (4) 12+ status codes with matching headers + error bodies. (5) 6 webhook templates (Stripe, GitHub, Slack, Shopify, Twilio, Typeform). (6) x-faker field override. (7) Seedable reproducibility. (8) Array counts up to 10,000. (9) Circular $ref guard. (10) Auto-generated MSW handler snippet. (11) localStorage history (max 20). (12) Shareable-URL config. (13) Copy / download .json / .http.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.