API Reference

Fetch athlete measurement data for given metrics

Measurement

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

The Measurement object represents an athlete's measurement for a given metric on a specific date.

The measurements field for an athlete returns an array of Measurement objects that were recorded for the athlete within the specified date range. It accepts three 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, and an array of [UUID] strings to scope the measurements by metric.

athleteEmail => String

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

athleteName => String

The athleteName field returns the name 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").

metricName => String

The metricName field returns the name of the metric for which the measurement was recorded.

metricUuid => String

The metricUuid field returns the UUID of the metric for which the measurement was recorded.

uuid => String

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

value => Float

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

Sample Query

Example:

query {
  athletes(emails:["[email protected]"]) {
    name,
    measurements(
      startDate:"2024-06-01",
      endDate:"2024-12-31",
      metricUuids: ["f43feed5-106b-4ffc-8889-84e35a576159"]
    ) {
      date,
      value
    }
  }
}

Response:

{
  "data": {
    "athletes": [
      {
        "name": "Devin Anderson",
        "measurements": [
          {
            "value": 195.8,
            "date": "2024-01-26",
          },
          {
            "value": 187.2,
            "date": "2024-03-17",
          },
        ]
      }
    ]
  }
}

⚠️

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).