Fetch athlete KPI data

AthleteKpi

The AthleteKpi object is primarily the access point for athlete athlete measurements for the given KPI.

It also contains the generic KPI-level info as well (e.g. name, unit, etc.). See institution.kpis for information about KPI-level fields.

measurements(startDate: ISO 8601 String, endDate: ISO 8601 String) => [KpiMeasurement]

The measurements field returns an array of KpiMeasurement objects that were recorded for the athlete within the specified date range. It accepts two required arguments: a startDate string in ISO 8601 format ("YYYY-MM-DD") to specify the beginning of the desired date range, and an endDate string in ISO 8601 format to specify the end of the desired date range.

value => Float

The value field returns a float that represents the athlete's most recent (or "current") measurement for the give KPI. It will return 0 if no measurements exists.

KpiMeasurement

The KpiMeasurement object contains information about an athlete measurement for the given KPI on a specific date.

athleteEmail => String

The athleteEmail field returns the email of the athlete for whom the measurement was recorded.

date => ISO 8601 String

The date field returns the date that the measurement was recorded in ISO 8601 format ("YYYY-MM-DD").

value => Float

The value field returns the measurement's recorded numerical value as a float.

Sample Query

Example:

query {
  institution {
    athletes(athleteEmails: ["[email protected]"]) {
      email,
      kpis(uuids: ["bc7ec5fe-8508-4c11-bbd1-29be86a1f77e"]) {
        name,
        measurements(startDate: "2023-01-01", endDate: "2023-12-31") {
          date,
          value
        }
      }
    }
  }
}

Response:

{
  "data": {
    "institution": {
      "athletes": [
        {
          "email": "[email protected]",
          "kpis": [
            {
              "name": "Back Squat 1RM",
              "measurements": [
                {
                  "date": "2023-08-15",
                  "value": 225
                },
                {
                  "date": "2023-10-01",
                  "value": 195
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

⚠️

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 of recorded measurements).