athletes.workouts

Fetch athlete session data

Workout

The Workout object represents a recorded workout session for the given athlete. It is the access point for training activities that were performed during the workout. It is nested under the Athlete object.

A workout in FYTT is a single bout of training composed of one or more workout blocks. You might generally think of it as a one or two hour training session where the athlete begins a workout with a warm-up, practices some aspect of training, then ends with a cool-down.

ℹ️

Workout Completion

Note that a recorded workout does not necessarily represent a "completed" workout, meaning that the athlete may or may not have completed all the prescribed activities. The presence of a recorded workout only indicates that the athlete started the workout.

In order to ascertain whether or not the athlete actually completed a given activity, you'll want to check the complete field for each individual set in the workout (which are nested under the workout blocks):

institutions.athletes.workouts.blocks.sets.complete

Use this information to make your own determination of "completeness" for a workout as a whole and/or individual activities according to your needs.

(See our knowledge base section on workouts for more general information about workouts.)

date => ISO 8601 Date String

The date field returns a string formatted as an ISO 8601 date ("YYYY-MM-DD"), which represents the date that the athlete recorded the workout.

description => String

The description field returns a text string of the workout's description as provided by the coach.

name => String

The name field returns a text string of the workout's name. (This field is not required in the UI. If the coach did not assign a workout name, FYTT returns a derived name based on the context through which the workout was scheduled.)

startedAt => ISO 8601 DateTime String|null

The startedAt field returns a ISO 8601 DateTime formatted string ("YYYY-MM-DDThh:mm:ssZ") of the time that the athlete started the workout. This field will return a null value if the athlete has not started the workout from within the UI.

stoppedAt => ISO 8601 DateTime String|null

The stoppedAt field returns a ISO 8601 DateTime formatted string ("YYYY-MM-DDThh:mm:ssZ") of the time that the athlete stopped the workout. This field will return a null value if the athlete has not completed the workout in the UI.

uuid => String

The uuid field returns the UUID generated by FYTT for the object.

blocks => [Block]

The blocks field returns an array of Block objects that were assigned as part of the given workout. (See our knowledge base section on blocks for more general information about workout blocks.)

Block

The Block object represents a recorded block for the given workout. It is the access point for individual sets that were performed as part of the block. It is nested under the Workout object.

A block within FYTT is a single, modular piece of a workout session. For example, within a given workout, you might have a block called "Warmup," then a couple blocks named "Upper Body" and "Lower Body," then a block called "Cooldown."

date => ISO 8601 String

The date field returns a string formatted as an ISO 8601 date ("YYYY-MM-DD"), which represents the date that the athlete recorded the block.

description => String

The description field returns a text string of the block's description as provided by the coach.

name => String

The name field returns a text string of the block's name as provided by the coach.

sets => [Set]

The sets field returns an array of Set objects that were assigned as part of the given block.

uuid => String

The uuid field returns the UUID generated by FYTT for the object.

Set

The Set object is the most granular object of recorded athlete activity. It can be thought of as an assigned exercise and its recorded repetitions and attributes. It is nested under the Block object.

complete => Boolean

The complete field returns a boolean value that indicates whether or not the set was marked as completed by the athlete.

exerciseName => String

The exerciseName field returns a text string of the name of the exercise that was recorded.

measurements => JSON

The measurements field returns a JSON object containing all the measurement attributes of the given set. This includes all the possible measurement types, whether or not each type was measured, and the unit of measurement where applicable.

setIndex => Integer

The setIndex field is an integer that allows coaches to group sets together. Sets with the same index number indicate that the sets are grouped into a superset/giantset/circuit. Only values greater than 0 are considered to be part of a group. This field defaults to a value of 0.

uuid => String

The uuid field returns the UUID generated by FYTT for the object.

Example:

{
  "caloriesMeasured": false,
  "caloriesMeasurement": 0,
  "customMeasured": false,
  "customMeasurement": 0,
  "distanceMeasured": false,
  "distanceMeasurement": 0,
  "distanceMeasurementUnit": "meters",
  "heartRateMeasured": false,
  "heartRateMeasurement": 0,
  "heightMeasured": false,
  "heightMeasurement": 0,
  "heightMeasurementUnit": "inches",
  "repsMeasured": false,
  "repsMeasurement": 0,
  "restMeasured": false,
  "restMeasurement": 0,
  "speedMeasured": false,
  "speedMeasurement": 0,
  "speedMeasurementUnit": "miles_per_hour",
  "timeMeasured": false,
  "timeMeasurement": 0,
  "wattsMeasured": false,
  "wattsMeasurement": 0,
  "weightMeasured": false,
  "weightMeasurement": 0,
  "weightMeasurementUnit": "pounds"
}

Sample Query

Putting it all together, a sample query might look like this:

query {
  athletes(athleteEmails:["[email protected]"]) {
    name,
    workouts(startDate:"2024-11-01", endDate:"2024-11-30") {
      name,
      blocks {
        name,
        sets {
          measurements
        }
      }
    }
  }
}

The response would be a JSON hash like the following:

{
  "data": {
    "athletes": [
      {
        "name": "Devin Anderson",
        "workouts": [
          {
            "name": "Team",
            "blocks": [
              {
                "name": "Bench Press",
                "sets": [
                  {
                    "measurements": {
                      "caloriesMeasured": false,
                      "caloriesMeasurement": 0,
                      "customMeasured": false,
                      "customMeasurement": 0,
                      "distanceMeasured": false,
                      "distanceMeasurement": 0,
                      "distanceMeasurementUnit": "meters",
                      "heartRateMeasured": false,
                      "heartRateMeasurement": 0,
                      "heightMeasured": false,
                      "heightMeasurement": 0,
                      "heightMeasurementUnit": "inches",
                      "repsMeasured": true,
                      "repsMeasurement": 10,
                      "restMeasured": false,
                      "restMeasurement": 0,
                      "speedMeasured": false,
                      "speedMeasurement": 0,
                      "speedMeasurementUnit": "miles_per_hour",
                      "timeMeasured": false,
                      "timeMeasurement": 0,
                      "wattsMeasured": false,
                      "wattsMeasurement": 0,
                      "weightMeasured": true,
                      "weightMeasurement": 250,
                      "weightMeasurementUnit": "pounds"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

⚠️

Avoid Request Timeouts

The amount of data requested can easily spiral out of control if you're not careful. To avoid request timeouts for very large amounts of data, we strongly advise that you limit the scope of each request to a subset of athletes and/or a relatively narrow date range (~30 days is probably the upper end of the recommended range depending on the number of athletes and the frequency/size of recorded workouts).