Generate synthetic patient data for machine learning
John
Generate synthetic patient records as FHIR R4 bundles for machine learning, with no real PHI. Set population size, age range, state, and random seed.
Input
Output fields
Sign up on Apify or log in
The Synthea - Create Synthetic FHIR Compliant Health Records Actor is ready to run with the inputs already set for "Generate synthetic patient data for machine learning". Sign up or log in and you'll land in Apify Console with a copy of this exact task.
Start the "Generate synthetic patient data for machine learning" task
The Synthea - Create Synthetic FHIR Compliant Health Records Actor will start running based on the input automatically. You can also change all the input fields, like population size, random seed, and more, to match your specific use case.
Receive the "Generate synthetic patient data for machine learning" output
Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as patient count, generation timestamp, generation summary, and more.
Integrate into your workflow
The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also run the "Generate synthetic patient data for machine learning" task via API.

Integrate "Generate synthetic patient data for machine learning" into your workflow
Connect "Generate synthetic patient data for machine learning" with 100+ integrations, or run it via API or MCP.
Webhook
n8n
Make
Zapier
Airbyte
Keboola
IFTTT
Hubspot
GDrive
Gmail
Apify MCP
GitHub
Slack
LangChain
LlamaIndex
Flowise
Pinecone
OpenAI
Mastra
Clay
Generate synthetic patient data for machine learning returns a summary item with patient_count, generation_timestamp, summary and generated_files, plus ten synthetic FHIR R4 bundles of fabricated Massachusetts adults in the key-value store.
population_size 10, seed 1, age_range 18-65 and state Massachusetts. population_size is capped at 100 patients in a single run, so build larger sets from several runs with different seeds. Keeping seed 1 brings back the same cohort.
Run the task with apify-client in Python and your Apify API token, read the key_value_store_key list from the dataset item, then download each FHIR Bundle and flatten Observation and Condition resources into features.
With seed 1 a scheduled run returns the same patients, so remove the seed first. Then in the Apify Console choose Actions, then Schedule, with a cron like 0 6 1 * * to add a new synthetic cohort each month.
Connect https://mcp.apify.com/?tools=actors,docs,johnvc/synthea-medical-record-generator-api to Claude or another MCP client and ask for ten synthetic adults aged 18 to 65 in Massachusetts. The agent runs the Synthea API and reports the bundle keys.
Mostly per patient: the Synthea Actor charges for each patient record generated, plus an Actor Start charge when the run begins. population_size is the main cost driver, so size the cohort to what the model needs. Rates are on the Actor page.
Generate synthetic patient data for machine learning fabricates every patient, so there is no real PHI to de-identify and models can train on it without privacy restrictions. Generate a synthetic EHR dataset for research adds a gender filter.