Accessing stress level

Hi, is it possible to access stress level data? Didn't find anything in the API docs. If not I am wondering why some data (like active calories or resting heart rate) are not accessible.
  • This is now available via ToyBox SensorHistory. On my watch this value doesn't correspond to the value I see in the glance. Not sure if it's just an old value. Is there an api to get a live / more up to date value?

    private function getStress() {
    // developer.garmin.com/.../SensorHistory.html
    if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getStressHistory)) {
    var history = Toybox.SensorHistory.getStressHistory({:period=>1,:order=>Toybox.SensorHistory.ORDER_NEWEST_FIRST});
    var sample = history.next();
    if (sample != null && sample.data != null && sample.data >=0 && sample.data <= 100) {
    return sample.data.format("%02d") + "%";
    }
    }
    return "--";
    }

  • To answer my question, use Complications to get a live stress value, if your device supports it.