HealthSave Get on App Store

Apple Health to DuckDB: query years of health data locally.

A practical local-first guide to loading exported Apple Health CSV into DuckDB for fast personal analytics without a hosted cloud.

Why DuckDB fits Apple Health exports

Apple Health exports become useful when you can query them without waiting on spreadsheets. DuckDB is a local analytical database: one file, fast scans, SQL, and no server to run. That makes it a good fit for people who export HealthSave CSV files and want to ask repeatable questions over years of steps, sleep, heart rate, workouts, and HRV.

The workflow

Export CSV from HealthSave for the categories you care about.

Keep one folder per export date so backfills are reproducible.

Load the CSV files into DuckDB tables with explicit column names.

Save SQL views for weekly, monthly, and rolling-window questions.

Keep raw exports read-only and write derived analysis separately.

Queries worth starting with

Seven-day rolling step averages.

Sleep duration by weekday.

Resting heart rate month over month.

Workout minutes by type.

Missing-data checks before you trust a chart.

Boundary

This is personal analytics, not medical interpretation. HealthSave exports the data your devices recorded; DuckDB helps you query it. Do not use this workflow for diagnosis, treatment, or safety-critical decisions.

HealthSave on iPhoneGet on the App Store