Exporting Apple activity data from healthKit

I recently generated analytics of the past several years of my activity in my year review of workouts and fitness post.

Apple does a fantastic job of allowing you to collect this data, especially with the Apple Watch, but getting it off your phone is harder than you think.

The health and activity apps between them allow to view different slices of workout and health data. But the ways in which you can view and compare this data is very limited. For my year review I wanted a month-by-month breakdown of specific workout types compared over several years. Impossible on device today.

activity-and-health-data-screenshots.gif

My first thought was to make an Apple GDPR request for my data. It’s backed up to iCloud so I assumed it that this should be accessible. Apple has a dedicated site to make these requests. I spoke with support staff after failing to find what I wanted in these downloads, then through speaking with colleagues realised they can’t give me this data.

Personal data like activity and health are encrypted on device. The encrypted data is backed-up and can only be decrypted using keys on your phone. Apple don’t want to be able to access this data, this is part of their privacy policy.

So I turned to 3rd party apps. Another colleague pointed me in the direction of an app called HealthFit which once given access to your data allows you to export it to a variety of platforms. I chose Google sheets, did some tidying of the data I had on the phone first (long story) and started the export. Once in sheets I could arrange and format the data how I wished to create my desired charts. It’s a decent solution.

I now record a good number of daily activities using Shortcuts I’ve made. Specifically commuting by train which involves 4 rides on my Brompton daily totalling about 9km. Such a repetitive and minor activity is so regular and consistent I prefer to simply tap one button rather than record 4 separate workouts. HealthFit does not export workouts without GPS data automatically for some reason, these can only be exported manually. For the time being I need to manually sync these back into my data for each months calculations.

I’m currently playing with getting different reports to see how well I’m performing compared to various points in the past. I love having this kind of data on my performance and find it an incredible motivator to improve. I look forward to sharing these more regularly.

running-2017-vs-2018.png

Long story of duplicate data.
When I cycle a longer distances on my big bike (not Brompton) I record the rides in Strava. Strava’s Analytics also leave a lot to be desired. I wanted to be able to merge multi-day tours into a single GPX record, so had to export, combine and reimport into Strava. Once Strava gained healthKit integration all this data and it’s duplication, along with lots of other duplication for some reason, filled my activity records.

Unfortunately Apple’s UI for handling this is terrible. It was a case of scrolling through all records, swiping for delete and confirming on each entry. Around a thousand entries 😣. I got it cleaned up in about a weeks worth of train journeys. Lesson learned. But now I have a clean set of data against which I can run reports.

 
17
Kudos
 
17
Kudos

Now read this

How well does Minecraft run on an M1 Mac?

I’ve been playing Minecraft on my M1 Mac mini now for a few months, and the good news is it works great. Many people have been asking me in the comments on my Let’s Play YouTube series - how does Minecraft perform on M1 Macs?... Continue →