Data Types
Workout List
A workout list is returned from the query to get workouts.
Key | Data type | Description |
---|---|---|
size | integer | Total number of items which match query criteria |
items | array | Array of Workout Summary |
previous | string | URI to the previous page of data, if applicable |
next | string | URI to the next page of data, if applicable |
Workout Summary
A workout summary is contained in the workout list response from a get workouts query.
Key | Data type | Description |
---|---|---|
start_time | string (ISO 8601 DateTime) | Start time of the workout |
type | string ( Workout Type) | Type of the workout |
name | string | Display name of the workout |
total_distance | real number (meters) | Total distance (cumulative) of the workout |
duration | real number (seconds) | Total duration (recorded) of the workout |
user_id | integer | User id that did the workout |
uri | string | URI of the detail information for this workout |
Workout
A workout is the base object of a get workout or create workout request.
Key | Data type | Description |
---|---|---|
start_time | string (ISO 8601 DateTime) | Start time of the workout |
type | string ( Workout Type) | Type of the workout |
sharing | string ( Workout Sharing Type) | Sharing option of the workout |
name | string | Display name of the workout |
total_distance | real number (meters) | Total distance (cumulative) of the workout |
duration | real number (seconds) | Total duration (recorded) of the workout |
clock_duration | real number (seconds) | Actual duration (including pauses) of the workout |
calories | real number (kilojoules) | Energy burnt during the workout |
elevation_gain | real number (meters) | Sum gain in elevation |
elevation_loss | real number (meters) | Sum loss in elevation |
notes | string | Workout notes |
location_name | string | Named (text) workout location |
max_speed | real number (meters per second) | Maximum speed of the workout |
avg_heartrate | real number (beats per minute) | Average heart rate during this workout |
max_heartrate | real number (beats per minute) | Maximum heart rate during this workout |
avg_cadence | real number (revolutions per minute) | Average cadence during this workout |
max_cadence | real number (revolutions per minute) | Maximum cadence during this workout |
avg_power | real number (watts) | Average power during this workout |
max_power | real number (watts) | Maximum power during this workout |
laps | array | An array of Laps |
location | array ( Track Data) | List of lat/lng pairs associated with this workout |
elevation | array ( Track Data) | List of altitude data (meters) associated with this workout |
distance | array ( Track Data) | List of meters moved associated with this workout |
heartrate | array ( Track Data) | List of heartrate data (bpm) associated with this workout |
cadence | array ( Track Data) | List of cadence data (rpm) associated with this workout |
power | array ( Track Data) | List of power data (watts) associated with this workout |
temperature | array ( Track Data) | List of temperature data (Celsius) associated with this workout |
vertical_oscillation | array ( Track Data) | List of vertical oscillation data (millimeters) associated with this workout |
ground_contact_time | array ( Track Data) | List of ground contact time data (milliseconds) associated with this workout |
left_power_percent | array ( Track Data) | List of power balance data (0=left, 100=right) associated with this workout |
total_hemoglobin_conc | array ( Track Data) | List of total blood hemoglobin saturation (g/dL) associated with this workout |
saturated_hemoglobin_percent | array ( Track Data) | List of percent hemoglobin oxygen saturation (0 - 100) associated with this workout |
timer_stops | array | An array of Timer Stops |
uri | string [read only] | URI of the detail information for this workout |
activity | string [read only] | A URL which points to the web page details for this workout |
Laps
A lap is a segment of a workout. All laps 'belong' to a workout. Lap # should be unique per workout.
Key | Data type | Description |
---|---|---|
start_time | string (ISO 8601 DateTime) | Start time of this lap |
type | string ( Lap Type) | Type of this lap |
number | integer | Lap # in workout, range [1, ∞) |
distance | real number (meters) | Total distance (cumulative) of this lap |
duration | real number (seconds) | Total duration (recorded) of this lap |
clock_duration | real number (seconds) | Actual duration (including pauses) of this lap |
calories | real number (kilojoules) | Energy burnt during this lap |
elevation_gain | real number (meters) | Sum gain in elevation |
elevation_loss | real number (meters) | Sum loss in elevation |
avg_speed | real number (meters per second) | Average speed of this lap |
max_speed | real number (meters per second) | Maximum speed of this lap |
avg_heartrate | real number (beats per minute) | Average heart rate during this lap |
max_heartrate | real number (beats per minute) | Maximum heart rate during this lap |
Units
Most units in the API are SI (International System of Units) units.
Location and Sensor Points
Due to the possible large amount of data related to location and sensor data, uses offset/value pairs. For example:
[offset_1, value_1, offset_2, value_2, ... offset_n, value_n]
The offset will always be an integer with the range [0, ∞). It is the number of seconds after the workout start_time. The datatype of the 'value' changes based on which type of track it is. Right now, there are four possible tracks:
- location - array of decimal degrees latitude (index 0) and decimal degrees longitude (index 1))
- elevation - real number (meters)
- distance - real number (meters)
- heartrate - integer (bpm)
ISO 8601 DateTime
A full date time string conforming with ISO 8601 with any of the forms:
- 2012-04-23T13:12Z (UTC timezone)
- 2012-04-23T13:12-05:00
- 2012-04-23T13:12-0500
- 2012-04-23T13:12-05
Workout Type
An enum of possible workout types. If the workout type does not have a analogue in SportTracks, use the type 'Other' and set the name property. The current types (case insensitive) are:
- Cycling
- Hiking
- Rowing
- Running
- Skating
- Skiing
- Swimming
- Walking
- Gym
- Other
To set the sub-type, use a colon (':') and then the subtype. For examples:
- Cycling:Hills
- Cycling:Trainer
- Cycling:Spinning
- Gym:Plyometrics
- Gym:Stretching
- Other:Golf
- Other:Climbing
Sharing Type
An enum of possible workout sharing types:
- public
- friends
- private
Lap Type
An enum of possible lap types. Used to indicate if the lap was recorded or not.
- ACTIVE
- REST
Timer Stops
A timer stop is an array of ISO 8601 DateTimes. Index 0 is the start of the pause, and index 1 is the end of the pause.
Examples
'type':'Walking',
'total_distance':402.336,
'duration':150,
'location':[0,[51.5037612,-0.0766360],150,[51.5070724,-0.0743517]],
'heartrate':[0,80,30,83,60,85,90,84,120,81,150,78]