Skip to content

API Export JSON Format

Lybron Sobers edited this page Oct 4, 2024 · 5 revisions

JSON Format

JSON data exported will follow the format described below. All data will be encapsulated in a data object with metrics and workouts nodes containing health metrics and workouts respectively.

"data": {
    "metrics": <Array>,
    "workouts": <Array>
}

Health Metrics

The metrics field is an array of objects, each containing data for a particular health metric. Most health metrics data follows a common structure. Exceptions to this format are also documented below:

Common Format

  • name: <String>
  • units: <String>
  • data: <Array>

The data array attached to a health metric will contain a quantity value that corresponds to the associated units value, along with a timestamp:

"data": [
    {
        "qty": <Number>,
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>
    }
]

Blood Pressure

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "systolic": <Number>,
        "diastolic": <Number>
    }
]

Heart Rate

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "Min": <Number>,
        "Avg": <Number>,
        "Max": <Number>
    }
]

Sleep Analysis

"data": [
    {
        "date": <Date (yyyy-MM-dd)>,
        "asleep": <Number>,
        "sleepStart": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "sleepEnd": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "sleepSource": <String>,
        "inBed": <Number>,
        "inBedStart": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "inBedEnd": <Date (yyyy-MM-dd HH:mm:ss Z)> ,
        "inBedSource": <String>
    }
]

Blood Glucose

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "qty": <Number>,
        "mealTime": <String> ("Before Meal" | "After Meal" | "Unspecified")
    }
]

Sexual Activity

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "Unspecified":<Number>,
        "Protection Used":<Number>,
        "Protection Not Used":<Number>,
    }
]

Handwashing

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "qty": <Number>,
        "value":<String> ("Complete" | "Incomplete")
    }
]

Toothbrushing

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "qty": <Number>,
        "value":<String> ("Complete" | "Incomplete")
    }
]

Insulin Delivery

"data": [
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "qty": <Number>,
        "reason":<String> ("Bolus" | "Basal")
    }
]

Heart Rate Notifications

Heart Rate Notification data is structured quite differently from other health metric data. At the top level, there is information regarding the start and end of the event. An event threshold is included for high and low heart rate events.

Additional metadata gathered during the heart rate event is included for hear rate and heart rate variation.

The threshold field is only included for high and low heart rate notifications)

[
    {
        "start": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "end": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "threshold": <Number> (For high and low heart rate notifications)
        "heartRate": [
            {
                "hr": <Number>,
                    "units": "bpm",
                    "timestamp": {
                        "start": <Date (yyyy-MM-dd HH:mm:ss Z)>,
                        "end": <Date (yyyy-MM-dd HH:mm:ss Z)>,
                        "interval": {
                            "duration": <Number>,
                            "units": "s" (seconds)
                        }
                    }
            }
        ],
        "heartRateVariation": [
            {
                "hrv": <Number>,
                "units": "ms",
                "timestamp": [
                    "start": <Date (yyyy-MM-dd HH:mm:ss Z)>,
                    "end": <Date (yyyy-MM-dd HH:mm:ss Z)>,
                    "interval": [
                        "duration": <Number>,
                        "units": "s"
                    ]
                ]
            }
        ]
    }
]

Symptoms

Health Auto Export supports all health symptoms data.

[
    {
        "start": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "end": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "name": <String>,
        "severity": <String>,
        "userEntered": <Boolean>,
        "source": <String>
    }
]

State of Mind

Health Auto Export supports all State of Mind data.

{
    "id": String,
    "start": String,
    "end": String,
    "kind": String,
    "labels": Array<String>,
    "associations": Array<String>,
    "valence": Number,
    "valenceClassification": Number,
    "metadata": Object<String:String>
}

ECG

Health Auto Export supports ECG data export in the following format:

[
    {
        "start": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "end": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "classification": <String> ("Sinus Rhythm" | "Atrial Fibrillation" | "High Heart Rate" | "Inconclusive Low Heart Rate" | "Inconclusive High Heart Rate" | "Inconclusive" | "Inconclusive Poor Recording" | "Inconclusive" | "Unrecognized" ),
        "severity": <String>,
        "averageHeartRate": <Number>,
        "numberOfVoltageMeasurements": <Number>
        "voltageMeasurements": Array<VoltageMeasurement>
        "samplingFrequency": <Number> (Hz)
        "source": <String>
    }
]

Voltage Measurement

[
    {
        "date": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "voltage": <Number>,
        "units": <String>
    }
]

Workouts

The workouts field is an array of objects, each containing data for a particular workout. Workouts follow a common structure. Units for a particular field can be variable, depending on user unit preferences (e.g. "kcal" vs "kJ"), and denoted as <String>, or units can fixed and expressed by a hardcoded value.

[
    {
        "name": <String>,
        "start": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "end": <Date (yyyy-MM-dd HH:mm:ss Z)>,
        "heartRateData": [
            "date": <Date (yyyy-MM-dd HH:mm:ss Z)>
            "qty": <Number>,
            "units": "count"
        ],
        "heartRateRecovery": [
            {
                "date": <Date (yyyy-MM-dd HH:mm:ss Z)>
                "qty": <Number>,
                "units": "count"
            }
        ],
        "route": [
            {
                "lat": <Number>,
                "lon": <Number>,
                "altitude": <Number (in meters)>,
                "timestamp" <Date (yyyy-MM-dd HH:mm:ss Z)>
            }
        ],
        "totalEnergy": {
            "qty": <Number>,
            "units": <String>
        },
        "activeEnergy": {
            "units": <String>,
            "qty": <Number>
        },
        "maxHeartRate": {
            "qty": <Number>,
            "units": "bpm"
        },
        "avgHeartRate": {
            "qty": <Number>,
            "units": "bpm"
        },
        "stepCount": {
            "qty": <Number>,
            "units": "steps"
        },
        "stepCadence": {
            "qty": <Number>,
            "units": "spm"
        },
        "totalSwimmingStrokeCount": {
            "qty": <Number>,
            "units": "count"
        },
        "swimCadence": {
            "qty": <Number>,
            "units": "spm"
        },
        "distance": {
            "qty": <Number>,
            "units": <String>
        },
        "speed": {
            "qty": <Number>,
            "units": <String>
        },
        "flightsClimbed": {
            "qty": <Number>,
            "units": "count"
        },
        "intesity": {
            "qty": <Number>,
            "units": "MET"
        },
        "temperature": {
            "qty": <Number>,
            "units": <String>
        },
        "humidity": {
            "qty": <Number>,
            "units": "%"
        },
        "elevation": {
            "ascent": <Number>,
            "descent": <Number>,
            "units": <String>
        }
    }
]