Analyze the Crap Out of Your Apple Health/HealthKit Data
As a recent iPhone + Apple Watch convert (see ya, Android and FitBit) my fitness tracking data lives in Apple Health.
I want to make charts and graphs and see trends over time (you get the idea, I’m an engineer, I
want need to engineer and analyze my fitness data). Problem is, there’s not a great way to do any custom reporting or get all of your data out into a usable (by humans) format.
So I made a thing. It’s called Apple Health Report. It’s simple really – an email address that you can email your Apple Health data export to, and it’ll email you back after turning it into something useful for you.
Here’s what the architecture looks like:
It’s a mashup of Apple, Google (for mail), and Microsoft stuff all jammed together.
While my primary impetus was to be able to analyze my fitness data, this was also a great way to explore functional programming (C#, yeah, I know, that’s weak sauce FP), serverless architecture (primarily Microsoft Azure Functions), and a new user interface paradigm (for me) – Email.
Try it out
You can get started really easily:
- Open the Health app on your iPhone
- Press the little silhouette head at the top
- Press “Export Health Data”
- When it’s done exporting, choose your favorite email app, and send it to firstname.lastname@example.org.
You’ll get an email back (usually within 5 or 10 minutes) when it’s done. The attached Excel document will have more data than you’ll possibly know what to do with. Now, go analyze your fitness data while you’re on that tread-desk.
My favorite part of the whole thing is the custom sheets. The system will store “template” worksheets for you that contain formulas or charts or other reports that reference the worksheets with data in them (using named ranges or cell references). Then your custom reports will be populated with fresh data every time! You can find info about that here.
If you’re the type, the code is on my Github here: https://github.com/jonfuller/health-parse/
P.S. There’s some fancy stuff you can do like custom sheets/reports (mentioned above), customize units of measure and summary customizations. Check out those details here.
P.P.S If your data is sufficiently large, it might not work right because of attachment limit sizes. If you’re a Gmail user, it will properly process an email with an embedded Drive link that Gmail will automatically create for you.