A c# package for reading exported Apple Health Zip files that contain health records, workouts and clinical records into memory. Use LINQ to query the data to generate your own health analytics of your data. This project is not affiliated with Apple in any way.
To download your Apple Health data, go to your Apple Health app on your iPhone and click on the profile icon in the top right corner. Then click on "Export Health Data". This will generate a zip file that you can download to your computer. This zip file contains all of your health data in XML format. See Apple's documentation for more information.
To use this package, you will need to download your Apple Health data zip file. Then you can use the following code to read the data into memory.
var reader = new XmlHealthDataReader();
var data = reader.Load(@"C:\Users\me\Downloads\export.zip");
var myHealthRecords = data.Records;
var myClinicalRecords = data.ClinicalRecords;
var myWorkouts = data.Workouts;
Or if you want to read the data from an XDocument:
XDocument xdoc = XDocument.Load(@"C:\Users\me\Downloads\export.xml");
var reader = new XmlHealthDataReader();
var data = reader.Load(xdoc);
var myHealthRecords = data.Records;
var myClinicalRecords = data.ClinicalRecords;
var myWorkouts = data.Workouts;
- Spivey.Health can be used to convert Apple Health data into a normalized and more efficient data structure.