Skip to content

Menu

API Response Mocker

Generate mock API responses from schema

Runs entirely in your browserAPI & HTTPFree, no sign-up
Loading tool

01What is API Response Mocker?

Frontend work often starts before the API exists. You know the shape of the response, but you have nothing to render. This tool takes a JSON Schema and returns a fake HTTP response with status, headers and body, ready to paste into a test fixture or a mock server. The generator walks your schema from the top. Enums return one of their listed values. Integers stay inside minimum and maximum, with a default range of 1 to 1000. Numbers default to 0 to 100 and are rounded to two decimals. If you set only one bound, the default range moves with it, so minimum: 2000 gives values like 2602 rather than something below your floor. Booleans are a coin flip. Arrays get between minItems and maxItems entries, 2 to 5 by default. Strings depend on format. uuid uses crypto.randomUUID, email picks from a short list of addresses, date-time and date give a random moment in the past year, and uri or url gives an image or file link. Every email and link uses example.com, example.org or example.net, the names RFC 2606 reserves for documentation. Your fixtures can't mail or link a real site. Plain strings become lorem ipsum words, padded or cut to fit minLength and maxLength. Property names help too. A plain string key ending in "name", such as displayName, gets a made-up person's name. fileName, userName, hostName and a few similar keys are skipped. Any string key containing "email" gets an address. A quick example. With the schema {displayName: string, plan: enum ["pro"]} we got {"displayName": "Jonas Weber", "plan": "pro"}. Press Regenerate and the name changes, but the plan never will. Pick a status from 200, 201, 204, 400, 401, 404 or 500. A 204 response has no body and no Content-Type, as RFC 9110 requires. Error codes still use your schema for the body, so paste an error schema to get an error payload. Headers include a random X-Request-Id and an X-Response-Time between 10 and 209 ms. Set Count above 1, up to 50, and the body becomes an array of records. This is a small generator, not a full JSON Schema validator. It ignores $ref, oneOf, anyOf, allOf, pattern and the required list, so every property is always filled. A type array such as ["string", "null"] comes out as null. Nesting stops after a few levels, and deeper objects and arrays come back empty. Everything runs in your browser.

Frontend developers and QA engineers who need believable response payloads from a JSON Schema before the real endpoint exists. The tool runs entirely in your browser, so your data never leaves your device.

02How to use API Response Mocker

  1. Paste a JSON Schema into the input panel, or pick an example such as REST User API or Paginated response.
  2. Choose a code from the Status dropdown and set Count (1 to 50).
  3. Read the generated status, headers and body in the output panel.
  4. Press Regenerate for a fresh random set, then Copy to take the JSON.

03Worked examples

Input: {"type":"object","properties":{"displayName":{"type":"string"},"plan":{"type":"string","enum":["pro"]}}}
Result: {"displayName":"Jonas Weber","plan":"pro"}
Body only. displayName picks up a random made-up name, and a one-value enum always returns that value.
Input: {"type":"object","properties":{"fileName":{"type":"string"},"contactEmail":{"type":"string"},"status":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":1}}}
Result: {"fileName":"lorem ipsum dolor","contactEmail":"[email protected]","status":null,"tags":["lorem ipsum dolor"]}
Body only, from one run. fileName is skipped by the name rule, the email key gets a reserved-domain address, and the type array comes out null.
Input: {"type":"string","maxLength":8}
Result: "lorem ip"
Plain strings are lorem words cut to maxLength. This one is the same on every run.
Input: {"type":"string","minLength":30}
Result: "lorem ipsum dolor elit dolor s"
Words are added until minLength is met, then the string is trimmed to the upper limit. Also the same on every run.
Input: {"type":"integer","minimum":2000}
Result: 2602
One random run. With only a minimum, the range becomes 2000 to 3000.
Input: {"type":"number","maximum":-5}
Result: -13.43
One random run. With only a negative maximum, the range becomes -105 to -5, rounded to two decimals.

04Common use cases

  • Stubbing a /users endpoint in MSW or json-server while the backend team is still building it
  • Producing a paginated response with data, pagination and meta blocks to test a React table
  • Generating 50 product records to see how a grid copes with different prices and tag counts
  • Building a 401 or 500 response to exercise error handling in a fetch wrapper
  • Checking that a UI handles a 204 No Content response with no body at all
  • Seeding Storybook stories with data built from the same schema your OpenAPI spec uses

05Tips

  • Set minimum and maximum on fields like price or rating. Otherwise a rating can land anywhere from 0 to 100.
  • Add format: uuid to ID fields to get real version 4 UUIDs instead of lorem text.
  • The name heuristic only kicks in when the property has no format or enum. Add an enum if you need fixed values for a field ending in name.
  • Resolve $ref pointers before pasting an OpenAPI schema. The generator only reads inline type, format, enum, bounds, properties and items.
  • Fields typed as ["string", "null"] always come out null. Use a plain "string" type if you want a value.

06Related concepts

JSON Schema, API mocking, Fixture data, HTTP status codes, OpenAPI.

Frequently Asked Questions

What is API Response Mocker?

API Response Mocker is a free, browser-based developer tool on AIDToolStack. Generate mock API responses from schema It requires no installation or sign-up and works entirely in your browser.

Is API Response Mocker free to use?

Yes. No sign-up, no fees and no usage cap.

Does API Response Mocker store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe