Xpersona
G

garmin-connect-health

CLAWHUB · Unverified

Fetch health and fitness data from Garmin Connect -- 40+ metrics including sleep, HRV, stress, body battery, SpO2, VO2 Max, training status, and activities. Stores data locally as JSON and SQLite.

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17fs1k3mbz2dmtnhv13m1npb183g3sh:garmin-connect-health
  1. Install using `clawhub skill install s17fs1k3mbz2dmtnhv13m1npb183g3sh:garmin-connect-health` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/dw1161/garmin-connect-health before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-dw1161-garmin-connect-health/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

145,718 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: garmin-connect-health
version: 1.1.0
description: Fetch health and fitness data from Garmin Connect -- 40+ metrics including sleep, HRV, stress, body battery, SpO2, VO2 Max, training status, and activities. Stores data locally as JSON and SQLite.
---

# Garmin Connect Health Data Skill

Fetch comprehensive health & fitness data from Garmin Connect for your AI agent.

## Data Coverage

| Category | Fields |
|----------|--------|
| **Activity** | Steps, distance, calories (active + BMR), floors, intensity minutes |
| **Heart Rate** | Min/max/resting heart rate |
| **Sleep** | Duration, score, deep/light/REM/awake breakdown, stress during sleep |
| **HRV** | Last night avg, 5min peak, weekly avg, status (balanced/unbalanced), baseline |
| **Body Battery** | Current level, daily min/max |
| **SpO2** | Average and minimum blood oxygen |
| **Respiration** | Waking and sleep breathing rate |
| **Stress** | Average/max, rest/low/medium/high duration breakdown |
| **Training Status** | Overreaching/Highly Active/Productive/Maintaining/Recovery/Detraining + acute/chronic load ratio |
| **Training Readiness** | Score (0-100) |
| **Fitness Metrics** | VO2 Max, fitness age, endurance score, hill score |
| **Race Predictions** | 5K/10K/Half/Marathon predicted times |
| **Weight/Body Comp** | Weight (kg), body fat %, BMI (requires Garmin Index scale) |
| **Hydration** | Intake (ml) vs goal |
| **Activities** | Individual workouts with HR, duration, calories, elevation, training effect, and detail JSON |
| **Weekly Summary** | Total/avg steps for the week |
| **SQLite Tables** | `daily_summary`, `activities`, and `activity_sets` for queryable local analysis |

## Setup

### 1. Install dependency
```bash
pip install "garminconnect>=0.3.11"
```

### 2. Set credentials (choose one method)

**Option A -- Environment variables:**
```bash
export GARMIN_EMAIL="you@example.com"
export GARMIN_PASSWORD="yourpassword"
```

**Option B -- CLI args:**
```bash
python3 garmin_health.py --email you@example.com --password yourpassword
```

**Option C -- macOS Keychain:**
```bash
security add-generic-password -a "you@example.com" -s "garmin_connect" -w "yourpassword"
```

**Option D -- Credentials file:**
```bash
echo -e "email=you@example.com\npassword=yourpassword" > ~/.garmin_credentials
chmod 600 ~/.garmin_credentials
```

### 3. Set region (China accounts only)

If your Garmin account was registered in China, add this to your shell profile (`~/.zshrc` / `~/.bashrc`) **once**:

```bash
export GARMIN_IS_CN=true
```

This tells the skill to use `connect.garmin.com.cn` instead of the global endpoint -- more reliable for mainland China IPs and prevents 429 rate-limit errors. Skip this step if you have a global Garmin account.

### 4. First run
First login may require MFA verification. You'll be prompted to enter a code sent to your email.

`garminconnect 0.3.x` uses native authentication and cannot reuse legacy Garth token files. Upgrading from `0.2.x` requires one new i

README.md

# garmin-connect-health -- OpenClaw Skill

<div align="right">
  <a href="README.zh.md"><img src="https://img.shields.io/badge/语言-中文-red?style=for-the-badge&logo=googletranslate&logoColor=white" alt="中文"></a>
  &nbsp;
  <img src="https://img.shields.io/badge/Language-English-blue?style=for-the-badge&logo=googletranslate&logoColor=white" alt="English">
</div>

A comprehensive Garmin Connect skill for [OpenClaw](https://github.com/openclaw/openclaw) that fetches your complete health & fitness data and makes it queryable by your AI agent.

## Features

- **40+ health metrics** -- sleep, HRV, stress, body battery, SpO2, VO2 Max, training status, race predictions, and more
- **Structured JSON + SQLite output** -- daily snapshots plus queryable tables for trends and workouts
- **Multiple auth methods** -- env vars, CLI args, macOS Keychain, or credentials file
- **Auto-caches daily data** -- fast queries without repeated API calls
- **Workout detail tables** -- activities and strength-training sets are saved for deeper analysis
- **Cross-platform** -- macOS, Linux, Windows

## Screenshots

> AI-powered health analysis powered by this skill -- real data, real insights 💪

<div align="center">
  <img src="docs/screenshot-1.jpg" width="380" alt="Garmin health data overview -- steps, sleep, HRV, body battery, SpO2">
  &nbsp;&nbsp;
  <img src="docs/screenshot-2.jpg" width="380" alt="Detailed training analysis and recovery recommendations">
</div>

*Left: Full health snapshot including sleep, heart rate, body battery, blood oxygen, and HRV.*
*Right: Training review with aerobic/anaerobic effect breakdown and personalized recovery advice.*

## Quick Start

```bash
# Install dependency
pip install "garminconnect>=0.3.11"

# Set credentials
export GARMIN_EMAIL="you@example.com"
export GARMIN_PASSWORD="yourpassword"

# Fetch today's data
python3 garmin_health.py

# Show cached data
python3 garmin_health.py --show
```

## Installation

### Manual
1. Copy `garmin_health.py` and `SKILL.md` to your OpenClaw skills directory
2. Install the Python dependency: `pip install "garminconnect>=0.3.11"`
3. Configure credentials (see Setup section)

### First Run & MFA
Your first login may trigger MFA. You'll be prompted to enter the verification code sent to your Garmin account email. After successful login, an OAuth token is cached for future use.

Versions `0.3.x` use native authentication and do not reuse legacy Garth token files. If you are upgrading from `garminconnect 0.2.x`, expect one new interactive login and MFA challenge.

## Data Storage

The skill writes both local JSON snapshots and a local SQLite database:

- `~/.garmin_health/YYYY-MM-DD.json` -- daily JSON snapshot
- `~/.garmin_health/latest.json` -- latest JSON snapshot
- `~/.garmin_health/garmin.db` -- SQLite database with `daily_summary`, `activities`, and `activity_sets` tables

No data is uploaded by this skill; storage stays on your machine unless you explicitly share it.

## Data Schema Example

The va

_meta.json

{
  "ownerId": "kn724tzm7v9j6phqav80dczav582tm7p",
  "slug": "garmin-connect-health",
  "version": "1.1.0",
  "publishedAt": 1787238906064
}

CHANGELOG.md

# Changelog

## v1.1.0 — 2026-08-20

### Changed
- Require `garminconnect >= 0.3.11` and use its native `login(tokenstore)` authentication flow.
- Remove direct access to the deprecated Garth client internals.
- Reuse and refresh native tokens with bounded retries before requesting credentials.
- Support interactive MFA through the native client and document the one-time re-login required when upgrading from `0.2.x`.

### Security
- Rely on the native client's protected token persistence instead of manually dumping legacy tokens.

## v1.0.11 — 2026-05-31

### Fixed
- Added compatibility for newer `garminconnect` activity detail APIs by supporting both `get_activity()` and `get_activity_details()`.
- Handle activity summary payloads returned as `summaryDTO`, `activitySummary`, or `summary`.
- Derive strength-training active set and rep totals from exercise-set details when summary fields are missing.
- Accept race prediction responses returned as either a list or a dict.
- Handle alternate training readiness feedback fields more safely.

## v1.0.10 — 2026-05-07

### Docs
- Restored the original real-product screenshots after owner review and approval.

## v1.0.9 — 2026-05-07

### Added
- Added SQLite storage at `~/.garmin_health/garmin.db` alongside JSON snapshots.
- Added structured tables for daily summaries, activities, and strength-training sets.
- Added richer workout detail capture for running, cycling, walking/hiking, badminton/racquet sports, cardio, and strength training.

### Fixed
- Handle Garmin training status null/missing fields more safely.

### Privacy
- Replaced public README screenshots with synthetic demo data.

## v1.0.3 — 2026-03-26

### Docs
- README (EN/ZH) and SKILL.md: added CN endpoint setup section with one-time `GARMIN_IS_CN` env var instructions
- SKILL.md: added `--cn` usage example and `GARMIN_IS_CN` to env var table

## v1.0.2 — 2026-03-26

### Added
- `--cn` CLI flag and `GARMIN_IS_CN=true` env var to switch to Garmin Connect CN (`connect.garmin.com.cn`). Recommended for Chinese Garmin accounts or when running from a mainland China IP. Default remains global.

## v1.0.1 — 2026-03-26

### Fixed
- `get_client()`: now tries `garth.load()` + profile validation first before falling back to email/password login. This prevents hammering the Garmin SSO endpoint on every run, which was causing 429 Too Many Requests errors for users running the script frequently (e.g. via cron).

## v1.0.0 — 2026-03-17

### Added
- Full Garmin Connect health data fetching (40+ metrics)
- Support for 14 data categories: daily summary, HR, sleep, stress, body battery, SpO2, respiration, HRV, training status/readiness, VO2 max, endurance, race predictions, weight/body composition, activities, weekly steps
- Multiple credential methods: CLI args, env vars, macOS Keychain, credentials file
- JSON caching per day + latest snapshot
- English UI with structured JSON output
- Cross-platform compatibility

README.zh.md

# garmin-connect-health -- OpenClaw Skill

<div align="right">
  <img src="https://img.shields.io/badge/语言-中文-red?style=for-the-badge&logo=googletranslate&logoColor=white" alt="中文">
  &nbsp;
  <a href="README.md"><img src="https://img.shields.io/badge/Language-English-blue?style=for-the-badge&logo=googletranslate&logoColor=white" alt="English"></a>
</div>

一个面向 [OpenClaw](https://github.com/openclaw/openclaw) 的 Garmin Connect 全量健康数据 Skill,可获取 40+ 项健康指标并让 AI 助手直接查询。

## 功能亮点

- **40+ 健康指标** -- 睡眠、HRV、压力、Body Battery、血氧、VO2 Max、训练状态、比赛预测等
- **结构化 JSON + SQLite 输出** -- 每日快照 + 可查询数据表,便于趋势和运动分析
- **多种认证方式** -- 环境变量、命令行参数、macOS 钥匙串、配置文件四选一
- **自动缓存每日数据** -- 无需重复调用 API,秒级响应
- **运动详情表** -- 活动记录和力量训练组写入 SQLite,方便深度分析
- **跨平台** -- macOS、Linux、Windows 均支持

## 效果截图

> 接入 OpenClaw 后,AI 助手可直接分析你的 Garmin 健康数据 💪

<div align="center">
  <img src="docs/screenshot-1.jpg" width="380" alt="Garmin 健康数据总览 -- 步数、睡眠、HRV、Body Battery、血氧">
  &nbsp;&nbsp;
  <img src="docs/screenshot-2.jpg" width="380" alt="训练分析与恢复建议">
</div>

*左图:完整健康数据快照,包含睡眠、心率、Body Battery、血氧、HRV 等核心指标。*
*右图:今日训练回顾(有氧/无氧效果量化)+ 个性化恢复建议。*

## 快速开始

```bash
# 安装依赖
pip install "garminconnect>=0.3.11"

# 设置账号(推荐用环境变量,避免暴露在 shell 历史中)
export GARMIN_EMAIL="你的邮箱@example.com"
export GARMIN_PASSWORD="你的密码"

# 拉取今天的数据
python3 garmin_health.py

# 查看缓存的最新数据
python3 garmin_health.py --show
```

## 安装方式

### 手动安装
1. 复制 `garmin_health.py` 和 `SKILL.md` 到 OpenClaw skills 目录
2. 安装 Python 依赖:`pip install "garminconnect>=0.3.11"`
3. 配置认证(见下方)

## 认证配置

认证优先级从高到低:

**1. 命令行参数(不推荐,会留在 shell 历史中)**
```bash
python3 garmin_health.py --email 你的邮箱 --password 你的密码
```

**2. 环境变量(推荐)**
```bash
export GARMIN_EMAIL="你的邮箱@example.com"
export GARMIN_PASSWORD="你的密码"
```

**3. macOS 钥匙串(最安全)**
```bash
security add-generic-password -a "你的邮箱@example.com" -s "garmin_connect" -w "你的密码"
```

**4. 本地配置文件**
```bash
# 创建配置文件
cat > ~/.garmin_credentials << EOF
email=你的邮箱@example.com
password=你的密码
EOF

# 必须设置为仅自己可读(重要!)
chmod 600 ~/.garmin_credentials
```

## 国内账号 / 大陆 IP 用户

默认连接 **国际版** Garmin Connect(`connect.garmin.com`)。  
如果你的佳明账号是在国内注册的,或在大陆 IP 运行,建议切换到 **国内端点**(`connect.garmin.com.cn`),稳定性更好、不容易触发 429。

### 一次性配置(推荐)

在 shell 配置文件(`~/.zshrc` 或 `~/.bashrc`)里加一行,以后每次都自动生效:

```bash
export GARMIN_IS_CN=true
```

然后重新加载:

```bash
source ~/.zshrc   # 或 source ~/.bashrc
```

**设置一次,永久生效** -- 包括 AI 助手通过 Skill 调用时,也会自动使用国内端点,无需额外传参。

### 临时指定(单次运行)

```bash
python3 garmin_health.py --cn
```

> **怎么判断用哪个端点?**  
> 如果你是在国内佳明官网/App 注册的账号,选国内(`--cn`)。如果是在 garmin.com 国际官网注册的,用默认即可。

### 首次登录与双重验证(MFA)
首次运行时 Garmin 会触发 MFA 验证,你的账号注册邮箱会收到验证码,按提示输入即可。授权成功后 token 会缓存在 `~/.garminconnect/`,后续无需再次验证。

`0.3.x` 使用原生认证,不能复用 `garminconnect 0.2.x` 的旧 Garth Token。从旧版升级时,预计需要重新进行一次交互式登录和 MFA 验证。

## 使用方法

```bash
# 拉取今天的数据(默认)
python3 garmin_health.py

# 拉取指定日期
python3 garmin_health.py --date 2026-03-16

# 显示最新缓存数据
python3 garmin_health.py --show
```

## 数据覆盖

| 类别 | 指标 |
|------|------|
| **日常活动** | 步数、距离、卡路里(活动+基础代谢)、楼层、运动强度分钟 |
| **心率** | 最低/最高/静息心率 |
| **睡眠** | 时长

Sponsored

Ads related to garmin-connect-health and adjacent AI workflows.