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 workoutname(String): Workout type name (e.g., "Running", "Cycling", "Swimming")start(Date): Workout start time in formatyyyy-MM-dd HH:mm:ss Zend(Date): Workout end time in formatyyyy-MM-dd HH:mm:ss Zduration(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 workouttotalEnergy(Object): Total calories (active + resting) burnedintensity(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 coveredspeed(Object): Current or average speedavgSpeed(Object): Average speed throughout the workoutmaxSpeed(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 gainedelevationDown(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 workouthumidity(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 lapstrokeStyle(String): One of:"Backstroke""Breaststroke""Butterfly""Freestyle""Mixed""Kickboard""Unknown"
swolfScore(Number): Swimming efficiency scoresalinity(String):"Fresh Water"or"Salt Water"totalSwimmingStrokeCount(Object): Total number of strokesswimCadence(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 timestepCadence(Object): Steps per minuteflightsClimbed(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 ratemaxHeartRate(Object): Maximum heart rate during workoutavgHeartRate(Object): Average heart rate during workoutheartRateData(Array): Detailed heart rate measurements throughout the workoutheartRateRecovery(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 measurementqty(Number): Quantity valueunits(String): Unit of measurementsource(String, optional): Data source device or app
HeartRateData Structure:
date(Date): Timestamp of the measurementMin(Number): Minimum heart rateAvg(Number): Average heart rateMax(Number): Maximum heart rateunits(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 coordinatelongitude(Number): GPS longitude coordinatealtitude(Number): Elevation in meterscourse(Number): Direction of travel in degrees (0-360)courseAccuracy(Number): Accuracy of course measurement in degreeshorizontalAccuracy(Number): Horizontal position accuracy in metersverticalAccuracy(Number): Vertical position accuracy in meterstimestamp(Date): Time when location was recordedspeed(Number): Speed in meters per secondspeedAccuracy(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