---
title: HKMetadataKeyAverageSpeed
framework: healthkit
role: symbol
role_heading: Global Variable
path: healthkit/hkmetadatakeyaveragespeed
---

# HKMetadataKeyAverageSpeed

A key that indicates the average speed during a workout.

## Declaration

```swift
let HKMetadataKeyAverageSpeed: String
```

## Mentioned in

Receiving Downhill Skiing and Snowboarding Data

## Discussion

Discussion Set this key on a workout, workout segment, or a quantity sample that represents distance. Set its value to an HKQuantity object with a length/time unit (for example, m/s). For more information on creating complex units, see Performing unit math. HealthKit assigns this metadata key to the segments it automatically creates for HKWorkoutActivityType.downhillSkiing and HKWorkoutActivityType.snowboarding workout sessions (Apple Watch Series 3 only). note: This value represents the average speed while moving. It may not be the same as the value you get when dividing a distance sample’s distance by its duration.

## See Also

### Speed

- [HKMetadataKeyMaximumSpeed](healthkit/hkmetadatakeymaximumspeed.md)
