healthsync is a CLI + HTTP server that parses your Apple Health export into a local, queryable SQLite database.
Apple Health stores years of data - heart rate, steps, sleep, workouts, SpO2, VO2 Max — in a single XML file that can exceed 1GB.
There's no official way to query it or pipe it into other tools. healthsync fixes that.
Parses .zip or .xml Apple Health exports via a streaming XML decoder (~10MB constant memory, even for 950MB+ files)
Stores records in ~/.healthsync/healthsync.db — pure Go SQLite, no CGO, no setup
Deduplicates on re-import (safe to run weekly via cron)
Queries 6 metrics: heart-rate, steps, spo2, vo2max, sleep, workouts
Output as table, JSON, or CSV with --from / --to date filters
HTTP server mode with async upload (POST /api/upload → 202 Accepted, poll GET /api/upload/status) — useful for syncing from iPhone Shortcuts over Tailscale
Install instructions on https://healthsync.sidv.dev/
I wanted to track my own health trends without exporting to a third-party service. Apple gives you the data but no tooling to actually use it. Parsing the raw XML is non-trivial — the DTD has to be stripped before the Go XML decoder can handle it, sleep records lack a unit attribute (they're HKCategoryType, not HKQuantityType), and the file is large enough that loading it into memory is not an option.
The result is a single binary that runs on macOS, Linux, and Windows. No database server, no cloud, no account. Your data stays on your machine.
Website: https://healthsync.sidv.dev/
About me: https://sidv.dev
Go 1.24, streaming xml.Decoder token loop
modernc.org/sqlite (pure Go, no CGO — cross-compiles trivially)
Chi HTTP router for server mode
go-pretty for terminal table output
Please rate, upvote, comment and bookmark if you liked it!
I personally found it especially useful to use with Claude Code and Codex CLIs to analyze my health trends 💪
Built with