# Synthetic Dataset Generator (`jungle_synthesizer/synthetic-dataset-generator`) Actor

Generate realistic synthetic datasets with correlated fields, built-in presets (user profiles, companies, e-commerce products, log events), custom schemas, deterministic seeding, and multiple output formats (JSON, CSV, NDJSON).

- **URL**: https://apify.com/jungle\_synthesizer/synthetic-dataset-generator.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 71.4% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Synthetic Dataset Generator

Generate realistic synthetic datasets with correlated fields, built-in presets, custom schemas, deterministic seeding, and multiple output formats.

### What does Synthetic Dataset Generator do?

This actor generates synthetic (fake) data on demand -- no web scraping required. It produces structured datasets using Faker.js for realistic data generation and Copycat for deterministic, reproducible output. Use it to create test data, seed databases, populate staging environments, or benchmark data pipelines.

### Key features

- **Built-in presets** -- One-click generation for user profiles, companies, e-commerce products, and server log events
- **Custom schemas** -- Define your own field names and types to generate exactly the data shape you need
- **Cross-field correlations** -- Age tracks with salary, company size correlates with revenue, out-of-stock items have zero quantity
- **Deterministic mode** -- Set a random seed for identical output across runs (same seed + same config = same data every time)
- **Multiple output formats** -- JSON (Apify dataset), CSV, or NDJSON
- **16 locales** -- Generate names, addresses, and phone numbers in English, German, French, Japanese, Chinese, and more
- **Fast and cheap** -- No proxy, no browser, no external API calls. Generates 10,000+ records per second on 256MB memory

### Built-in presets

| Preset | Fields | Example use case |
|--------|--------|------------------|
| **User Profiles** | id, name, email, phone, DOB, age, gender, address, job title, company, salary | Test user databases, CRM seed data |
| **Companies** | company ID, name, industry, employees, revenue, founded year, website, CEO | Business directory mock data |
| **E-commerce Products** | product ID, name, description, category, price, SKU, stock, rating, reviews | Product catalog testing |
| **Log Events** | timestamp, level, service, host, request ID, method, path, status code, response time | Log pipeline testing, SIEM demos |

### Custom schema

Define any combination of fields with the `customSchema` input (JSON array):

```json
[
  { "name": "user_id", "type": "uuid" },
  { "name": "username", "type": "name" },
  { "name": "signup_date", "type": "datetime" },
  { "name": "plan", "type": "enum", "options": { "values": ["free", "pro", "enterprise"], "weights": [0.7, 0.2, 0.1] } },
  { "name": "monthly_spend", "type": "number", "options": { "min": 0, "max": 500 } }
]
````

#### Supported field types

`string`, `integer`, `number`, `boolean`, `date`, `datetime`, `email`, `phone`, `address`, `name`, `first_name`, `last_name`, `company`, `url`, `uuid`, `city`, `state`, `zip`, `country`, `job_title`, `salary`, `sentence`, `paragraph`, `enum`

For `enum` type, pass `options.values` (array of choices) and optionally `options.weights` (probability weights).

### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `preset` | string | `user_profiles` | Built-in preset or `custom` for custom schema |
| `recordCount` | integer | `100` | Number of records to generate (1 to 500,000) |
| `customSchema` | string | | JSON array of field definitions (only used when preset is `custom`) |
| `locale` | string | `en` | Language/region for generated data |
| `seed` | integer | `0` | Random seed for deterministic output (0 = random) |
| `outputFormat` | string | `json` | Output format: `json`, `csv`, or `ndjson` |
| `enableCorrelations` | boolean | `true` | Apply cross-field correlations for realistic data |

### Output

#### JSON format (default)

Records are pushed to the Apify dataset. Each record is a flat JSON object matching the selected preset or custom schema.

#### CSV / NDJSON format

The file is saved to the key-value store under the key `OUTPUT`. A summary record is also pushed to the dataset with download instructions.

### Example output (user\_profiles preset)

```json
{
  "id": "a1abcd86-4c43-4300-864f-066b9f5e43eb",
  "first_name": "Lydia",
  "last_name": "MacGyver",
  "email": "Taryn8@gmail.com",
  "phone": "(444) 909-7300",
  "date_of_birth": "2005-01-20",
  "age": 21,
  "gender": "Female",
  "address": "8239 Johnston Shore",
  "city": "West Chanelleburgh",
  "state": "Utah",
  "zip": "00084",
  "country": "Holy See (Vatican City State)",
  "job_title": "Principal Applications Developer",
  "company": "Nienow-Gibson, Bruen and Mayer",
  "salary": 109866,
  "created_at": "2025-09-23T21:04:26.698Z"
}
```

### Cost

This actor uses Pay Per Event pricing:

- **$0.10** per actor start
- **$0.0001** per data record generated

Example: Generating 10,000 user profiles costs $0.10 (start) + $1.00 (records) = **$1.10 total**.

### Performance

| Records | Approximate time | Memory |
|---------|-----------------|--------|
| 100 | < 1 second | 256 MB |
| 1,000 | ~1 second | 256 MB |
| 10,000 | ~5 seconds | 256 MB |
| 100,000 | ~30 seconds | 256 MB |

### Use cases

- **Database seeding** -- Populate development and staging databases with realistic test data
- **API testing** -- Generate request/response payloads for load testing and integration tests
- **Data pipeline validation** -- Feed synthetic data through ETL pipelines to verify transformations
- **UI prototyping** -- Fill dashboards and reports with realistic-looking data
- **Machine learning** -- Generate training data for models that need structured tabular input
- **Demo environments** -- Create convincing demo data without using real customer information

### Need more features?

If you need additional field types, presets, or output formats, file an issue or get in touch. We actively maintain this actor and welcome feature requests.

# Actor input Schema

## `sp_intended_usage` (type: `string`):

Please describe how you plan to use the data extracted by this crawler.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

Provide your email address so we can get in touch with you.

## `preset` (type: `string`):

Choose a built-in preset for quick generation, or select 'custom' to define your own schema.

## `recordCount` (type: `integer`):

How many records to generate. Maximum 500,000.

## `customSchema` (type: `string`):

JSON array of field definitions for custom mode. Each field: { "name": "field\_name", "type": "email", "options": {} }. Supported types: string, integer, number, boolean, date, datetime, email, phone, address, name, first\_name, last\_name, company, url, uuid, city, state, zip, country, job\_title, salary, sentence, paragraph, enum. For enum type, pass options: { "values": \["a", "b", "c"], "weights": \[0.5, 0.3, 0.2] }.

## `locale` (type: `string`):

Language/region for generated data (names, addresses, phone formats).

## `seed` (type: `integer`):

Optional seed for deterministic output. Same seed + same config = identical results every run. Leave at 0 for random data.

## `outputFormat` (type: `string`):

Output format. JSON writes to the dataset (viewable in Apify console). CSV and NDJSON are stored in the key-value store as downloadable files.

## `enableCorrelations` (type: `boolean`):

When enabled, correlated fields produce statistically coherent records (e.g., age tracks with salary, company size with revenue). Adds ~10% generation time.

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "preset": "user_profiles",
  "recordCount": 100,
  "customSchema": "",
  "locale": "en",
  "seed": 0,
  "outputFormat": "json",
  "enableCorrelations": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "preset": "user_profiles",
    "recordCount": 100,
    "customSchema": "",
    "locale": "en",
    "seed": 0,
    "outputFormat": "json",
    "enableCorrelations": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/synthetic-dataset-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "preset": "user_profiles",
    "recordCount": 100,
    "customSchema": "",
    "locale": "en",
    "seed": 0,
    "outputFormat": "json",
    "enableCorrelations": True,
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/synthetic-dataset-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "preset": "user_profiles",
  "recordCount": 100,
  "customSchema": "",
  "locale": "en",
  "seed": 0,
  "outputFormat": "json",
  "enableCorrelations": true
}' |
apify call jungle_synthesizer/synthetic-dataset-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jungle_synthesizer/synthetic-dataset-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Synthetic Dataset Generator",
        "description": "Generate realistic synthetic datasets with correlated fields, built-in presets (user profiles, companies, e-commerce products, log events), custom schemas, deterministic seeding, and multiple output formats (JSON, CSV, NDJSON).",
        "version": "0.1",
        "x-build-id": "yvPg0ShCWk2h2t9wQ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jungle_synthesizer~synthetic-dataset-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jungle_synthesizer-synthetic-dataset-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~synthetic-dataset-generator/runs": {
            "post": {
                "operationId": "runs-sync-jungle_synthesizer-synthetic-dataset-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/jungle_synthesizer~synthetic-dataset-generator/run-sync": {
            "post": {
                "operationId": "run-sync-jungle_synthesizer-synthetic-dataset-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "recordCount"
                ],
                "properties": {
                    "sp_intended_usage": {
                        "title": "What is the intended usage of this data?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Please describe how you plan to use the data extracted by this crawler."
                    },
                    "sp_improvement_suggestions": {
                        "title": "How can we improve this crawler for you?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide any feedback or suggestions for improvements."
                    },
                    "sp_contact": {
                        "title": "Contact Email",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide your email address so we can get in touch with you."
                    },
                    "preset": {
                        "title": "Preset",
                        "enum": [
                            "user_profiles",
                            "companies",
                            "ecommerce_products",
                            "log_events",
                            "custom"
                        ],
                        "type": "string",
                        "description": "Choose a built-in preset for quick generation, or select 'custom' to define your own schema.",
                        "default": "user_profiles"
                    },
                    "recordCount": {
                        "title": "Number of Records",
                        "minimum": 1,
                        "maximum": 500000,
                        "type": "integer",
                        "description": "How many records to generate. Maximum 500,000.",
                        "default": 100
                    },
                    "customSchema": {
                        "title": "Custom Schema (JSON)",
                        "type": "string",
                        "description": "JSON array of field definitions for custom mode. Each field: { \"name\": \"field_name\", \"type\": \"email\", \"options\": {} }. Supported types: string, integer, number, boolean, date, datetime, email, phone, address, name, first_name, last_name, company, url, uuid, city, state, zip, country, job_title, salary, sentence, paragraph, enum. For enum type, pass options: { \"values\": [\"a\", \"b\", \"c\"], \"weights\": [0.5, 0.3, 0.2] }.",
                        "default": ""
                    },
                    "locale": {
                        "title": "Locale",
                        "enum": [
                            "en",
                            "en_US",
                            "en_GB",
                            "de",
                            "fr",
                            "es",
                            "it",
                            "ja",
                            "zh_CN",
                            "pt_BR",
                            "ko",
                            "nl",
                            "pl",
                            "ru",
                            "sv",
                            "tr"
                        ],
                        "type": "string",
                        "description": "Language/region for generated data (names, addresses, phone formats).",
                        "default": "en"
                    },
                    "seed": {
                        "title": "Random Seed",
                        "type": "integer",
                        "description": "Optional seed for deterministic output. Same seed + same config = identical results every run. Leave at 0 for random data.",
                        "default": 0
                    },
                    "outputFormat": {
                        "title": "Output Format",
                        "enum": [
                            "json",
                            "csv",
                            "ndjson"
                        ],
                        "type": "string",
                        "description": "Output format. JSON writes to the dataset (viewable in Apify console). CSV and NDJSON are stored in the key-value store as downloadable files.",
                        "default": "json"
                    },
                    "enableCorrelations": {
                        "title": "Enable Field Correlations",
                        "type": "boolean",
                        "description": "When enabled, correlated fields produce statistically coherent records (e.g., age tracks with salary, company size with revenue). Adds ~10% generation time.",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
