Skip to content
POST AI agent ready /v1/mock/generate

Mock Data API - Generate Fake Data from JSON Schema

Walks a JSON Schema and emits realistic values: string format:email → fake email, format:date → random date between 2000-2030, format:uri → fake URL, format:uuid → crypto.randomUUID, enum → random pick, arrays with minItems/maxItems, nested objects with full property walks. Generates 1-100 items per request.

Parameters

objectrequired

JSON Schema describing the desired shape.

number

Number of objects to generate (1-100).

Code examples

curl -X POST https://api.botoi.com/v1/mock/generate \
  -H "Content-Type: application/json" \
  -d '{"schema":{"type":"object","properties":{"id":{"type":"integer"},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["admin","member","viewer"]}}},"count":2}'

When to use this API

Seed test databases

Describe each table row as a JSON Schema and generate hundreds of fake records. Ship seed scripts that work identically in CI and on dev laptops without bundled fixture files.

Prototype UIs with realistic data

When designing a dashboard, generate mock user records, transactions, or events to populate the UI with plausible data instead of Lorem Ipsum. Screenshots for specs look real.

Load testing payloads

Generate thousands of request bodies matching your OpenAPI schema, then replay them against a staging environment to validate behavior under load.

Frequently asked questions

Which JSON Schema features are supported?
type (string, number, integer, boolean, null, array, object), enum, format (email, date, date-time, uri/url, uuid, hostname), properties, items, minimum, maximum, minLength, maxLength, minItems, maxItems, anyOf, oneOf (picks the first variant), additionalProperties.
Are the generated values deterministic?
No. Math.random() is used for each field. For deterministic seeding (e.g., snapshot tests), generate once and commit the output instead of regenerating on each run.
How many items can I generate per request?
Up to 100. For larger datasets, call the endpoint multiple times. Payloads beyond 100 items per call risk exceeding Workers response-size limits.
What happens with $ref?
References are not resolved. Inline the referenced schema into your definition before calling. Bundled dereferenced schemas work best.
Are format validations enforced?
The generator biases towards plausible values (proper emails, ISO dates) but does not guarantee the output passes strict format validators. For production seed data, run each record through /v1/schema/validate to confirm conformance.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.