Some Bits: Nelson's log

Getting data from Google Fit and Health Connect

Health Connect is Google’s data platform for fitness info: weight, steps, etc. Summary: Health Sync is a humane way to get at the data stored in it, so are Health Connect backups.

Health Connect replaces Google Health, a very old product. It also sort of envelops Google Fit. Health Connect isn’t really a consumer product. The consumer product is the Fit app where you can see some records and history. But it’s pretty minimal. Health Connect is more of a database for developers that Google maintains. Various things can store data into Google Fit, various things can take it out. In my case my scale (an InBody) stores my weight in Google Fit and my diet tracker (Cronometer) pulls that data out. Sometimes, it doesn’t seem very reliable.

Worth noting that Health Connect happens on your phone. I don’t think much if anything happens in the cloud.

There’s no simple CSV data export from Health Connect. Shocking oversight, I know. Google Takeout also has no entry for Health Connect. Here’s four alternatives to getting your data:

The Health Connect app in Android has a way to set up a nightly backup to Google Drive. The resulting Health Connect.zip is about 20MB in my case. It contains a sqlite database that is unencrypted. It’s pretty straightforward to get weight, steps, etc out of it. It works for me.

Google Takeout for Google Fit does work. This gives you data in a messy pile of small JSON files with names like raw_com.google.weight_com.inbody2014.inbody_he.json. My actual weight data is stored in there, it would not be hard to write a tool to convert the data into a clean CSV. Maybe someone has.

Health Sync is a third party app that syncs health and fitness data between apps. Sort of Zapier for health data. I connected Google Fit to Google Drive with it and it seems to be creating nicely formatted CSV files for me. It also has a Health Connect sync to Google Drive which should sync everything all at once, but may not be able to get at data history. I’ve got it turned on as well and am not clear what it is doing.

There’s a fourth alternative I haven’t explored.. Google Fit does have a cloud platform and API and it should be possible to write software to fetch data from it to a server. Maybe someone’s done this. But Google Fit appears to be on its way out, I wouldn’t invest in this. Health Connect does not have any sort of cloud API, it’s all running on Android only.

Needless to say this is all a big mess. Part of the problem is Google is trying to meet privacy requirements, health data is particularly sensitive. It’s the same with location tracking, like Google Timeline. They’re moving all this stuff to only live on the user’s Android devices so they are less responsible for it. It’s awkward.

Comments

kuro68k 

Once you have the data, what do you do with it though? I have yet to find a good app to visualizing that information.

fair question! In my case I just want to graph my weight. I have a little Javascript program I wrote to do that which pulls in data from various sources over the years. Loading a CSV into a spreadsheet is an even easier thing you can do with a decent data export.

kuro68k 

That's interesting. I might try that, because like you I am mostly interesting in graphing just a couple of metrics. There's probably some Javascript framework that can give you a nice interactive graph from a CSV file.