Closed jflournoy closed 4 days ago
Use the get_stats(cdate)
or get_stats_and_body(cdate)
endpoint, which returns (among many other things) a lot of calorie information. In the Demo, this is option 7:
cdate is a string
api = init_api(email=os.environ['GARMIN_USERNAME'], password=os.environ['GARMIN_PASSWORD'])
stats_data = api.get_stats('2024-03-10')
# Returns object including the following fields:
{
'userProfileId': 123456789, # Your User ID
...
'totalKilocalories': 4067.0,
'activeKilocalories': 1874.0,
'bmrKilocalories': 2193.0,
'wellnessKilocalories': 4067.0,
'burnedKilocalories': None, # Always None for me
'consumedKilocalories': 3937.0, # For me, this comes from MyFitnessPal. Not sure if Garmin has built in calorie consumption tracking
'remainingKilocalories': 130.0,
'netCalorieGoal': 1770,
...
}
Under the hood, get_stats_and_body
calls get_stats
which calls get_user_summary
@jflournoy did you manage to get the data you wanted, is there mode needed?
I haven't had a chance to test this out yet but will report back when I do. thank you! I think i just missed this in the example.
I can confirm that this works.
Closing since tested and solved, thanks all!
Hi there,
I may have missed it but is there any way to pull daily calories? Thank you!