cyberjunky / python-garminconnect

Python 3 API wrapper for Garmin Connect to get activity statistics
MIT License
964 stars 149 forks source link

vo2max and body metrics. #82

Closed veggicide closed 2 years ago

veggicide commented 2 years ago

The current url for body metrics is: /modern/proxy/metrics-service/metrics/maxmet/daily/2022-05-06/2022-05-06

Which isn't working, I was able to get it to work by changing it to: /modern/proxy/metrics-service/metrics/maxmet/latest/2022-05-06

cyberjunky commented 2 years ago

I checked, I think it works like it should for vo2max and age It returns nothing when there is no measurement for that day, and returns the specific daily data when there is.

DEBUG:urllib3.connectionpool:https://connect.garmin.com:443 "GET /modern/proxy/metrics-service/metrics/maxmet/daily/2022-05-13/2022-05-13 HTTP/1.1" 200 2
INFO:__main__:[]
DEBUG:garminconnect:URL: https://connect.garmin.com/modern/proxy/metrics-service/metrics/maxmet/daily/2022-05-11/2022-05-11
INFO:__main__:[{'userId': 82413212, 'generic': {'calendarDate': '2022-05-11', 'vo2MaxValue': 50.0, 'fitnessAge': 55, 'fitnessAgeDescription': 0, 'maxMetCategory': 0}, 'cycling': None, 'heatAltitudeAcclimation': None}]

With your url u will get the latest but not necessarily for that day:

DEBUG:urllib3.connectionpool:https://connect.garmin.com:443 "GET /modern/proxy/metrics-service/metrics/maxmet/latest/2022-05-13 HTTP/1.1" 200 None
INFO:__main__:{'userId': 82413212, 'generic': {'calendarDate': '2022-05-11', 'vo2MaxValue': 50.0, 'fitnessAge': 55, 'fitnessAgeDescription': 0, 'maxMetCategory': 0}, 'cycling': None, 'heatAltitudeAcclimation': {'calendarDate': None, 'altitudeAcclimationDate': None, 'previousAltitudeAcclimationDate': None, 'heatAcclimationDate': None, 'previousHeatAcclimationDate': None, 'altitudeAcclimation': None, 'previousAltitudeAcclimation': None, 'heatAcclimationPercentage': None, 'previousHeatAcclimationPercentage': None, 'heatTrend': None, 'altitudeTrend': None}}

However I get more data then... Hmm...

veggicide commented 2 years ago

That makes sense, thanks for the info and the work you have done on this!