Workouts - JSON Export Format

Documentation for workouts structure in JSON exports

Last updated: February 6, 2026

On this page

Workouts

Workout data includes all your exercise sessions recorded in Apple Health, such as running, cycling, swimming, strength training, and more. In JSON exports, workouts are stored in the workouts array.

Export Versions

Health Auto Export supports two workout export versions:

  • Version 2 (Recommended): Enhanced format with more detailed metadata and structured data
  • Version 1 (Legacy): Older format maintained for compatibility with existing workflows

Workouts Version 2

Version 2 provides a comprehensive structure with optional fields that are only included when data is available.

Basic Structure

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Running",
  "start": "2024-02-06 07:00:00 -0800",
  "end": "2024-02-06 07:30:00 -0800",
  "duration": 1800
}

Required Fields

  • id (String): Unique identifier for the workout
  • name (String): Workout type name (e.g., "Running", "Cycling", "Swimming")
  • start (Date): Workout start time in format yyyy-MM-dd HH:mm:ss Z
  • end (Date): Workout end time in format yyyy-MM-dd HH:mm:ss Z
  • duration (Number): Workout duration in seconds

Optional Fields

The following fields are only included when data is available:

Location Information

{
  "location": "Outdoor",
  "isIndoor": false
}
  • location (String): One of "Indoor", "Outdoor", "Pool", "Open Water"
  • isIndoor (Boolean): Whether the workout was performed indoors

Energy and Intensity

{
  "activeEnergyBurned": {
    "qty": 350,
    "units": "kcal"
  },
  "totalEnergy": {
    "qty": 450,
    "units": "kcal"
  },
  "intensity": {
    "qty": 8.5,
    "units": "MET"
  }
}
  • activeEnergyBurned (Object): Active calories burned during the workout
  • totalEnergy (Object): Total calories (active + resting) burned
  • intensity (Object): Metabolic equivalent of task (MET) value

Distance and Speed

{
  "distance": {
    "qty": 3.5,
    "units": "mi"
  },
  "speed": {
    "qty": 7.0,
    "units": "mph"
  },
  "avgSpeed": {
    "qty": 7.0,
    "units": "mph"
  },
  "maxSpeed": {
    "qty": 8.5,
    "units": "mph"
  }
}
  • distance (Object): Total distance covered
  • speed (Object): Current or average speed
  • avgSpeed (Object): Average speed throughout the workout
  • maxSpeed (Object): Maximum speed reached

Units:

  • Distance: "mi" (miles) or "km" (kilometers)
  • Speed: "mph" (miles per hour) or "kmph" (kilometers per hour)

Elevation

{
  "elevationUp": {
    "qty": 500,
    "units": "ft"
  },
  "elevationDown": {
    "qty": 450,
    "units": "ft"
  }
}
  • elevationUp (Object): Total elevation gained
  • elevationDown (Object): Total elevation lost

Units: "ft" (feet) or "m" (meters)

Environmental Data

{
  "temperature": {
    "qty": 72,
    "units": "degF"
  },
  "humidity": {
    "qty": 65,
    "units": "%"
  }
}
  • temperature (Object): Ambient temperature during workout
  • humidity (Object): Relative humidity percentage

Temperature Units: "degF" (Fahrenheit) or "degC" (Celsius)

Swimming-Specific Fields

{
  "lapLength": {
    "qty": 0.025,
    "units": "mi"
  },
  "strokeStyle": "Freestyle",
  "swolfScore": 45,
  "salinity": "Fresh Water",
  "totalSwimmingStrokeCount": {
    "qty": 1200,
    "units": "count"
  },
  "swimCadence": {
    "qty": 30,
    "units": "spm"
  }
}
  • lapLength (Object): Length of each lap
  • strokeStyle (String): One of:
    • "Backstroke"
    • "Breaststroke"
    • "Butterfly"
    • "Freestyle"
    • "Mixed"
    • "Kickboard"
    • "Unknown"
  • swolfScore (Number): Swimming efficiency score
  • salinity (String): "Fresh Water" or "Salt Water"
  • totalSwimmingStrokeCount (Object): Total number of strokes
  • swimCadence (Object): Strokes per minute

Step and Cadence Data

{
  "stepCount": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 5000,
      "units": "count",
      "source": "Apple Watch"
    }
  ],
  "stepCadence": {
    "qty": 180,
    "units": "spm"
  },
  "flightsClimbed": {
    "qty": 10,
    "units": "count"
  }
}
  • stepCount (Array): Array of step count measurements over time
  • stepCadence (Object): Steps per minute
  • flightsClimbed (Object): Number of flights of stairs climbed

Heart Rate Data

{
  "heartRate": {
    "min": {
      "qty": 120,
      "units": "bpm"
    },
    "avg": {
      "qty": 150,
      "units": "bpm"
    },
    "max": {
      "qty": 175,
      "units": "bpm"
    }
  },
  "maxHeartRate": {
    "qty": 175,
    "units": "bpm"
  },
  "avgHeartRate": {
    "qty": 150,
    "units": "bpm"
  },
  "heartRateData": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "Min": 120,
      "Avg": 150,
      "Max": 175,
      "units": "bpm",
      "source": "Apple Watch"
    }
  ],
  "heartRateRecovery": [
    {
      "date": "2024-02-06 07:30:00 -0800",
      "Min": 140,
      "Avg": 145,
      "Max": 150,
      "units": "bpm",
      "source": "Apple Watch"
    }
  ]
}
  • heartRate (Object): Summary with min, avg, and max heart rate
  • maxHeartRate (Object): Maximum heart rate during workout
  • avgHeartRate (Object): Average heart rate during workout
  • heartRateData (Array): Detailed heart rate measurements throughout the workout
  • heartRateRecovery (Array): Heart rate measurements during recovery period

Time-Series Data Arrays

Many metrics can be included as time-series arrays when "Include Workout Metrics" is enabled:

{
  "activeEnergy": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 50,
      "units": "kcal",
      "source": "Apple Watch"
    }
  ],
  "basalEnergy": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 20,
      "units": "kcal",
      "source": "Apple Watch"
    }
  ],
  "cyclingCadence": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 90,
      "units": "rpm",
      "source": "Apple Watch"
    }
  ],
  "cyclingDistance": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 0.5,
      "units": "mi",
      "source": "Apple Watch"
    }
  ],
  "cyclingPower": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 200,
      "units": "W",
      "source": "Power Meter"
    }
  ],
  "cyclingSpeed": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 18,
      "units": "mph",
      "source": "Apple Watch"
    }
  ],
  "swimDistance": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 25,
      "units": "yd",
      "source": "Apple Watch"
    }
  ],
  "swimStroke": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 20,
      "units": "count",
      "source": "Apple Watch"
    }
  ],
  "walkingAndRunningDistance": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 0.25,
      "units": "mi",
      "source": "Apple Watch"
    }
  ]
}

QuantityData Structure:

  • date (Date): Timestamp of the measurement
  • qty (Number): Quantity value
  • units (String): Unit of measurement
  • source (String, optional): Data source device or app

HeartRateData Structure:

  • date (Date): Timestamp of the measurement
  • Min (Number): Minimum heart rate
  • Avg (Number): Average heart rate
  • Max (Number): Maximum heart rate
  • units (String): Unit (typically "bpm")
  • source (String, optional): Data source device or app

Route Data

When "Include Route Data" is enabled and the workout has GPS data:

{
  "route": [
    {
      "latitude": 37.7749,
      "longitude": -122.4194,
      "altitude": 50.5,
      "course": 45.0,
      "courseAccuracy": 5.0,
      "horizontalAccuracy": 10.0,
      "verticalAccuracy": 15.0,
      "timestamp": "2024-02-06 07:00:00 -0800",
      "speed": 7.0,
      "speedAccuracy": 0.5
    }
  ]
}

Location Fields:

  • latitude (Number): GPS latitude coordinate
  • longitude (Number): GPS longitude coordinate
  • altitude (Number): Elevation in meters
  • course (Number): Direction of travel in degrees (0-360)
  • courseAccuracy (Number): Accuracy of course measurement in degrees
  • horizontalAccuracy (Number): Horizontal position accuracy in meters
  • verticalAccuracy (Number): Vertical position accuracy in meters
  • timestamp (Date): Time when location was recorded
  • speed (Number): Speed in meters per second
  • speedAccuracy (Number): Accuracy of speed measurement in m/s

Metadata

{
  "metadata": {
    "customField": "value",
    "anotherField": 123
  }
}
  • metadata (Object): Additional custom metadata associated with the workout

Workouts Version 1 (Legacy)

Version 1 uses a simpler structure. For new exports, Version 2 is recommended.

Version 1 Structure

{
  "name": "Running",
  "start": "2024-02-06 07:00:00 -0800",
  "end": "2024-02-06 07:30:00 -0800",
  "totalEnergy": {
    "qty": 450,
    "units": "kcal"
  },
  "activeEnergy": {
    "qty": 350,
    "units": "kcal"
  },
  "distance": {
    "qty": 3.5,
    "units": "mi"
  },
  "heartRateData": [
    {
      "date": "2024-02-06 07:00:00 -0800",
      "qty": 150,
      "units": "count"
    }
  ],
  "route": [
    {
      "lat": 37.7749,
      "lon": -122.4194,
      "altitude": 50.5,
      "timestamp": "2024-02-06 07:00:00 -0800"
    }
  ]
}

Workout Metrics Time Grouping

When using Export Version 2 and "Include Workout Metrics" is enabled, you can control the granularity of time-series data:

  • Minutes: Groups workout metrics by minute intervals
  • Seconds: Groups workout metrics by second intervals (more detailed, larger file size)

Tips

  • Include Route Data: Enable this option to get GPS route information for outdoor workouts
  • Include Workout Metrics: Enable this to get detailed time-series data for metrics like heart rate, power, and cadence
  • Export Version: Use Version 2 for the most comprehensive data structure
  • GPX Export: Route data can also be exported as separate GPX files for use in mapping applications