Python: Garmin Connect
The Garmin Connect API library comes with two examples:
example.py - Simple getting-started example showing authentication, token storage, and basic API calls
demo.py - Comprehensive demo providing access to 270 API methods organized into 15 categories for easy navigation
$ ./demo.py
📁 Exported data will be saved to the directory: 'your_data'
📄 All API responses are written to: 'response.json'
Attempting to login using stored tokens from: ~/.garminconnect
Successfully logged in using stored tokens!
📊 Your Stats Today: 4,045 steps | 1445.0 kcal
🐌 Time to get those legs moving!
==================================================
🚴 Full-blown Garmin Connect API Demo - Main Menu
==================================================
Select a category:
[1] 👤 User & Profile
[2] 📊 Daily Health & Activity
[3] 🔬 Advanced Health Metrics
[4] 📈 Historical Data & Trends
[5] 🏃 Activities & Workouts
[6] ⚖️ Body Composition & Weight
[7] 🏆 Goals & Achievements
[8] ⌚ Device & Technical
[9] 🎽 Gear & Equipment
[0] 💧 Hydration & Wellness
[a] 🔧 System & Export
[b] 📅 Training Plans & Calendar
[c] ⛳ Golf
[d] ✏️ Activity Editing
[e] 🏃 Activity Details & Courses
[q] Exit program
Make your selection:
API Coverage Statistics
- Total API Methods: 348 methods; every method with a one-line description is listed in the Method Reference
- Categories: 15 organized sections
- Web-app endpoint map: the endpoints the Garmin Connect web app uses documented with the exact request it sends and whether it was verified live, in docs/API_ENDPOINTS.md; the dashboard's GraphQL operations are in docs/graphql_operations.md
- User & Profile: 8 methods (basic user info, settings)
- Daily Health & Activity: 21 methods (today's health data plus daily calories, resting HR and sleep ranges)
- Advanced Health Metrics: 35 methods (fitness metrics, HRV, VO2, FTP range, training readiness, training zones, running tolerance, training load balance, daily training status, activity training load)
- Historical Data & Trends: 29 methods (date range queries, weekly aggregates)
- Activities & Workouts: 37 methods (comprehensive activity, workout management, typed workout uploads including strength and swim CSS targets, in-place edit, scheduling, push to device, import, activity type/subtype filtering, earliest-upcoming-workout lookup, activity photos)
- Body Composition & Weight: 11 methods (weight tracking, body composition)
- Goals & Achievements: 24 methods (challenges, badges, goals)
- Device & Technical: 13 methods (device info, settings)
- Gear & Equipment: 13 methods (gear management, tracking, creation)
- Hydration & Wellness: 30 methods (hydration, nutrition, blood pressure, menstrual reads and writes, Jet Lag Adviser trips)
- System & Export: 5 methods (reporting, logout, GraphQL, health snapshot download)
- Training Plans & Calendar: 23 methods (calendar weeks/years/events, upcoming and primary race events, active plans and plan tasks, plans, plan by ID, typed strength workout uploads including timed sets, exercise catalog search, in-place workout editing, push to device, workout scheduling management)
- Golf: 5 methods (scorecard summary, scorecard detail, shot data, club stats, user stats)
- Activity Editing: 3 methods (set activity description, set strength-activity exercise sets)
- Activity Details & Courses: 13 methods (laps, rounds, step/jump/swim details, map and polyline, activity search, courses)
Interactive Features
- Enhanced User Experience: Categorized navigation with emoji indicators
- Smart Data Management: Interactive weigh-in deletion with search capabilities
- Comprehensive Coverage: All major Garmin Connect features are accessible
- Error Handling: Robust error handling with user-friendly prompts
- Data Export: JSON export functionality for all data types
A comprehensive Python3 API wrapper for Garmin Connect, providing access to health, fitness, and device data.
📖 About
This library enables developers to programmatically access Garmin Connect data including:
- Health Metrics: Heart rate, sleep, stress, body composition, SpO2, HRV
- Activity Data: Workouts, typed workout uploads (running, cycling, swimming, strength), workout scheduling, exercises, training status, performance metrics, import-style uploads (no Strava re-export)
- Nutrition: Daily food logs, meals, and nutrition settings
- Golf: Scorecard summaries, scorecard details, shot-by-shot data
- Device Information: Connected devices, settings, alarms, solar data
- Goals & Achievements: Personal records, badges, challenges, race predictions
- Historical Data: Trends, progress tracking, date range queries
Compatible with all Garmin Connect accounts. See https://connect.garmin.com/
📦 Installation
Requires Python 3.12 or later.
Install from PyPI:
pip install --upgrade garminconnect curl_cffi
Upgrading from 0.2.x (garth)
Since 0.3.0 this library no longer uses garth, which is deprecated.
Sessions saved by older versions (oauth1_token.json/oauth2_token.json,
created with garth.save()) cannot be converted, and assigning a resumed
client to Garmin().garth no longer does anything. Log in once with your
username and password; new tokens are saved to garmin_tokens.json in your
tokenstore and are used for later logins:
garmin = Garmin(email, password)
garmin.login("~/.garminconnect") # later runs: Garmin().login("~/.garminconnect")
Run demo software (recommended)
Clone the repo, then:
python3 -m venv .venv --copies
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e ".[example]"
python3 ./example.py # simple getting-started example
python3 ./demo.py # comprehensive demo (270 API methods)
📚 Method Reference
348 public methods on Garmin, generated from the code by scripts/gen_method_reference.py. Click a section to expand it.
Login, profile & account (21)
| Method |
Description |
connectapi(path, **kwargs) |
Send a GET to a Connect API path and return the decoded JSON. |
connectwebproxy(path, **kwargs) |
Send a GET to a Connect API path (legacy alias of connectapi). |
download(path, **kwargs) |
Download raw bytes from a Connect API path. |
get_full_name() |
Return full name of the authenticated user. |
get_personal_information(include_biometric=True, include_vo2max=True) |
Return personal information: userInfo (birth date, gender, locale, timeZone, country), biometricProfile and VO2 max. |
get_privacy_settings() |
Return the account's activity, profile and wellness privacy settings. |
get_unit_system() |
Return the user's unit system (e.g. metric). |
get_usage_indicators() |
Return which features the account's devices and data support. |
get_user_profile() |
Return the user settings (user data, units, formats, sleep times). |
get_user_profile_base() |
Return the base profile record (names, birth date, create date, ...). |
get_user_timezone() |
Return the IANA timezone name from the user's Garmin profile. |
get_userprofile_settings() |
Return the user profile settings (display name, locale, preferences). |
login(tokenstore=None) |
Log in with saved tokens or credentials and load the user profile. |
logout(tokenstore=None) |
Clear in-memory auth state and any cached tokens on disk. |
now() |
Return the current time as an aware datetime in the user's timezone. |
query_garmin_graphql(query) |
Run a query against Garmin's GraphQL gateway. |
request_reload(cdate, device_id=None) |
Request reload of data for a specific date. |
resume_login(client_state, mfa_code) |
Finish a login that is waiting for an MFA code. |
set_primary_training_device(device_id) |
Choose which device Garmin treats as the primary training device. |
today() |
Return today's calendar date in the user's Garmin timezone. |
update_user_settings(settings) |
Write user settings (units, formats, sleep times, training days, ...). |
Daily health & wellness (75)