Registry / http-networking / ha-garmin

ha-garmin

JSON →
library0.1.19pypypi✓ verified 80d ago

Python client for the Garmin Connect API. Version 0.1.19 supports Garmin SSO/Loading (OAuth1/OAuth2) authentication and provides methods to fetch activities, body composition, daily summaries, heart rate, sleep, stress, fitness age, training readiness, and more. Features include automatic token refresh and activity upload. Released under MIT license, with regular updates.

pip install ha-garmin
INSTALL
IMPORT
SIG · HA-GARMIN
H
ha-garmin
http-networkingpythonv0.1.19
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GarminClient
from ha_garmin import GarminClient
from garminconnect import Garmin
GarminAuth
from ha_garmin import GarminAuth
GarminConnectError
from ha_garmin import GarminConnectError

Basic login and data retrieval. Set environment variables GARMIN_EMAIL and GARMIN_PASSWORD.

import os from garminconnect import Garmin api = Garmin( email=os.environ.get('GARMIN_EMAIL', ''), password=os.environ.get('GARMIN_PASSWORD', '') ) api.login() # Fetch today's activities activities = api.get_activities(0, 10) print(activities) # Fetch daily summary summary = api.get_daily_summary('2025-01-15') print(summary)
Debug
Known issues
breakingIn v0.1.18 and earlier, the 'get_lactate_threshold' method could discard heart rate data. Upgrade to v0.1.17+ for fixed behavior.
fix
Update to v0.1.19: pip install --upgrade ha-garmin
affects: <=0.1.17
breakingIn v0.1.16, Chinese accounts must use the correct domain. The fix routes diauth to diauth.garmin.cn. If you got '400 invalid_grant', upgrade to v0.1.16+.
fix
Upgrade to v0.1.16+.
affects: <0.1.16
gotchaThe Garmin API sometimes returns 'mostRecentVO2Max' as a bare float instead of a dict. In older versions this caused AttributeError.
fix
Upgrade to v0.1.17+.
affects: <0.1.17
gotchaToken refresh is automatic, but if you clear tokens or have network issues, login may fail. Ensure 'is_logged_in' check before sensitive operations.
fix
Always call api.login() after creating a new instance, or catch exceptions.
affects: all
Upgrade
Version history
0.1.19latest on PyPI · released May 2, 2026
Audit
Dependencies
cloudscraperrequiredRequired for bypassing Cloudflare protection on Garmin endpoints.
requestsrequiredHTTP library for API calls.
requests_oauthlibrequiredUsed for OAuth1 flow.
python-dateutilrequiredDate parsing utilities.
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
ha-garmin — pip install ha-garmin · libregistry