Fitbit HealthKit

An iOS app which bulk imports Fitbit Aira scale CSV Weight (Pounds), Body Mass Index (BMI) and Body Fat Percentage (BFP) measurement data into Apple's HealthKit. This pattern can be more broadly expanded to include other HKQuantityTypeIdentifiers which include Steps, Running, Walking, Cycling, Etc.

Fitbit-HealthKit

An iOS app which bulk imports Fitbit Aira scale CSV Weight (Pounds), Body Mass Index (BMI) and Body Fat Percentage (BFP) measurement data into Apple’s HealthKit. This pattern can be more broadly expanded to include other HKQuantityTypeIdentifiers which include Steps, Running, Walking, Cycling, Etc.

While this example uses local data, it could be further enhanced by leveraging the Fitbit REST APIs and OAuth 2.0.

Example

alt text

Getting started

1. Request data archive from Fitbit

alt text

alt text

alt text

2. Install jq (lightweight and flexible command-line JSON processor) https://stedolan.github.io/jq

alt text

3. Copy the weight.json files from the archive ▸ user-site-export into Health-Import⁩ ▸ ⁨App⁩ ▸ ⁨Data⁩ ▸ ⁨Fitbit⁩ ▸ BodyMeasurements

alt text

alt text

4. Run json2csv.sh

alt text

alt text

5. Run Health-Importer on device