canonical: https://jentic.com/apis/mockaroo.com/mockaroo

# Mockaroo API

Mockaroo generates realistic synthetic test data on demand in JSON, CSV, TXT, SQL, and XML formats so engineers can populate development environments, run load tests, or seed analytics pipelines without using real customer data. The API exposes 11 endpoints covering field type metadata, multi-format generation, saved schemas under `/api/datasets`, and downloadable result files. Authentication is by API key in either the X-API-Key header or a key query parameter.

## For AI agents

Generate realistic synthetic test data in JSON, CSV, SQL, XML, or TXT formats and pull saved Mockaroo datasets and downloads.

## Scope

Does not handle production data anonymisation, database hosting, or schema migrations - use for generating synthetic test data only.

## Capabilities

- Generate fake data in JSON via `/api/generate.json` with a custom field schema
- Generate the same dataset as CSV, SQL, TXT, or XML through `/api/generate.csv`, `/api/generate.sql`, `/api/generate.txt`, or `/api/generate.xml`
- Run a fully custom format using a Mockaroo template at `/api/generate.custom`
- Inspect the catalogue of supported field types via `/api/types`
- Reference a saved schema by name through `/api/datasets/{name}`
- Retrieve a previously generated download by ID at `/api/downloads/{id}`
- Authorise requests with an API key in either header or query parameter form

## Use cases

### Seed test data for a development database

Engineers seed a development database by POSTing a field schema to `/api/generate.sql` and capturing the returned INSERT statements, or by calling `/api/generate.json` and importing the result into the application directly. The same schema can be replayed across CI runs to give every environment a consistent baseline of synthetic data.

Example prompt: POST a 5-field schema to `/api/generate.sql` with count=500 and a target table name, capture the INSERT statements, and run them against the dev database.

### Load testing fixtures

Performance engineers generate large CSV or JSON fixtures via `/api/generate.csv` and `/api/generate.json` to drive load tests against APIs and analytics pipelines. The format flexibility means the same logical dataset can be rendered for whichever ingestion path the load test exercises, without rebuilding the schema each time.

Example prompt: Call `/api/generate.csv` with count=10000 and a custom schema, save the response to fixtures.csv, and feed it to the load test runner.

### Saved dataset replay for QA

QA teams reference a saved Mockaroo schema through `/api/datasets/{name}` so the same well-known fixture can be regenerated on demand for regression tests. Combined with `/api/downloads/{id}` for previously generated files, this gives QA a stable, reproducible test data surface across environments.

Example prompt: GET `/api/datasets`/'customer_baseline' to regenerate the saved customer dataset, and store the response under tests/fixtures/customer_baseline.json.

### Agent integration via Jentic

An AI assistant building test harnesses can search Jentic for 'generate fake JSON test data', load the `/api/generate.json` schema, and execute the call without ever holding the Mockaroo API key. The agent can then write the response straight into a fixtures directory and trigger downstream tests.

Example prompt: Search Jentic for 'generate fake JSON test data', load the `/api/generate.json` schema, execute it for 50 records using the 'user' field set, and write the result to fixtures/users.json.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/api/types` | List supported field types |
| POST | `/api/generate.json` | Generate JSON synthetic data |
| POST | `/api/generate.csv` | Generate CSV synthetic data |
| POST | `/api/generate.sql` | Generate SQL INSERT statements |
| POST | `/api/generate.xml` | Generate XML synthetic data |
| POST | `/api/generate.custom` | Generate output using a custom Mockaroo template |
| GET | `/api/datasets/{name}` | Reference a saved dataset by name |
| GET | `/api/downloads/{id}` | Retrieve a previously generated download |

## Key resources

- **Types** — List the field types available for use in a Mockaroo schema
- **Generate** — Generate synthetic data in JSON, CSV, TXT, SQL, XML, or a custom format
- **Datasets** — Reference saved schemas by name to regenerate consistent fixtures
- **Downloads** — Retrieve previously generated files by ID

## Why Jentic

- **Setup:** Wiring the Mockaroo API by hand means handling its API key auth, picking the right generate format among JSON, CSV, SQL, and XML, and posting each schema yourself. Through Jentic you install once, import the Mockaroo API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Mockaroo's schemas travel in the request body and its dataset and download ids sit in the URL path, so scope your agent by limiting it to the operations it needs, such as listing types and generating JSON data. You leave out dataset downloads so the agent produces synthetic test data without pulling saved datasets.
- **Credential handling:** Your Mockaroo API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'generate fake JSON test data' or 'list available Mockaroo field types', and Jentic returns the matching Mockaroo operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **FakeJSON API** — Lightweight fake JSON data generator with a smaller field type catalogue
- **GitHub REST API** — Source control API used to commit Mockaroo-generated fixtures into a test repo
- **OpenAPI Generator API** — Generate client SDKs that consume the data Mockaroo produces

## FAQ

### What authentication does the Mockaroo API use?

Mockaroo accepts an API key in the X-API-Key header or as the 'key' query parameter on each request. Through Jentic the API key is held in your Jentic One instance and injected automatically; the agent never sees the raw key.

### Can I generate SQL INSERT statements directly?

Yes. POST your schema to `/api/generate.sql` with the desired row count and table name and Mockaroo returns the INSERT statements ready to run against a target database. The same schema can be reused at `/api/generate.json` or `/api/generate.csv` to switch formats.

### What are the rate limits for the Mockaroo API?

Limits are tied to the Mockaroo plan rather than the OpenAPI specification: the free tier permits 200 requests per day with up to 1,000 rows per call, and paid plans raise both ceilings. Confirm current limits at mockaroo.com/docs.

### How do I generate JSON test data through Jentic?

Run pip install jentic, search Jentic for 'generate fake JSON test data', load the `/api/generate.json` schema, and execute it with your field schema and row count. Jentic injects the API key and returns the JSON payload to the agent.

### Can I save a schema and reuse it across runs?

Yes. Save the schema under a name in the Mockaroo UI, then call GET `/api/datasets/{name}` to regenerate the same fixture on demand from the API. This is the recommended path for repeatable QA fixtures.

### Is the Mockaroo API free to use?

Mockaroo offers a free tier capped at 200 daily API calls and 1,000 rows per call; higher volumes require a paid plan. Get started with Jentic One, the self-hosted execution layer.

### Can I limit what my agent is allowed to do with the Mockaroo API?

Yes. Because you run Jentic One yourself, your own rules decide which Mockaroo operations and credentials the agent may use. You can allow only the calls it needs, such as listing field types at `/api/types` and generating data at `/api/generate.json`, while leaving out saved-dataset access at `/api/datasets/{name}` and file retrieval at `/api/downloads/{id}.` This lets the agent produce synthetic test data without pulling saved datasets or downloads.
