cyberjunky / python-garminconnect

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

How to get user profile data #165

Closed eitanbehar closed 9 months ago

eitanbehar commented 9 months ago

Hi, How to get user profile data, like height? Thanks, Eitan

matin commented 9 months ago

The endpoint is "/userprofile-service/userprofile/user-settings".

Here's how you can fetch height:

import os
from getpass import getpass

import garminconnect

if os.getenv("GARMINTOKENS"):
    garmin = garminconnect.Garmin()
else:
    email = input("Enter email address: ")
    password = getpass("Enter password: ")
    garmin = garminconnect.Garmin(email, password)

garmin.login()

garmin.garth.connectapi("/userprofile-service/userprofile/user-settings")["userData"]["height"]
eitanbehar commented 9 months ago

@matin This worked as a charm. Thanks a lot!

eitanbehar commented 9 months ago

solved

cyberjunky commented 8 months ago

Added to latest version, thanks all!