health-macos-swiftui-example icon indicating copy to clipboard operation
health-macos-swiftui-example copied to clipboard

Possibility to use apple health data that is synchronized in iCloud?

Open fivestones opened this issue 1 year ago • 2 comments

At some point recently apple started making it so that apple health could sync its data through iCloud. This didn't exist 2 or 3 years ago but when I looked the other day, it did, and it works fine. Of course, none of this data is visible in iCloud drive. I'm posting this here because I figured it might be a place other people who are interested in the same thing might look.

I figure if someone reverse engeneers the method iPhones use to sync with iCloud, and then that is used to log in and sync the health data from a MacOS app, there can be a constantly in-sync health app on Mac. Or Linux or whatever. And able to integrate with e.g., third party health dashboards, personal web sites (automatically post your latest workout), or things like home assistant.

I know there are ways to get this data, by way of other third-party iPhone apps, but all of these require the app to be running and regularly run in the background, and the syncs aren't up to date (e.g., I can't get my latest up-to-date step count from my apple watch in a bash script, although I could use one of those apps to get my several-hours-old step count in a bash script.

So I guess I'm wondering if anyone know of any project where someone has made any headway in this. I'll try posting in relevant places on reddit too probably. I might try to tackle it too but I'm pretty far away from the knowledge required. If you have some helpful hints for me let me know. Thanks!

fivestones avatar Aug 01 '22 14:08 fivestones

Since iOS 16 automatically calculates Active Energy based on the movement data without the option to disable these calculations (and Apple doesn't allow deleting health records from a shortcut), this possibility would allow a ton of other possibilities to script with the Health app (optimizations, cleanups, statistics, ...). @fivestones Did you found any useful information in the meantime?

ghost avatar Sep 16 '22 13:09 ghost

No, sorry, I haven't figured out anything more so far.

fivestones avatar Sep 19 '22 04:09 fivestones