← 返回
未分类 Key

WHOOP Health Data Sync

Sync WHOOP health data (recovery, sleep, strain, workouts) to markdown files for AI-powered health insights. Use when user asks about WHOOP data, health metr...
同步WHOOP健康数据(恢复、睡眠、压力、训练)到markdown文件,用于AI驱动的健康洞察。用户询问WHOOP数据或健康指标时使用。
aikong-cmd aikong-cmd 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 571
下载
💾 0
安装
1
版本
#latest

概述

WHOOP Health Data Sync

Sync WHOOP wearable data to health/whoop-YYYY-MM-DD.md files. Pure Python, zero dependencies.

Data Coverage

Recovery (score/HRV/RHR/SpO2/skin temp), Sleep (performance/efficiency/stages/respiratory rate/sleep need/balance), Day Strain (strain/calories/HR), Workouts (sport/duration/strain/HR/zones/distance), Weekly summaries.

Setup

1. Create WHOOP Developer App

  1. Go to https://developer-dashboard.whoop.com/
  2. Create Application → Redirect URI: http://localhost:9527/callback → select all read:* + offline scopes
  3. Note Client ID and Client Secret

2. Store Credentials

Env vars:

export WHOOP_CLIENT_ID="your-id"
export WHOOP_CLIENT_SECRET="your-secret"

Or 1Password: Create Login item named whoop (username=Client ID, password=Client Secret).

3. Authorize (one-time)

Local (browser on same machine):

python3 scripts/auth.py

Remote server (headless):

python3 scripts/auth.py --print-url
# User opens URL in browser, authorizes, copies callback URL back
python3 scripts/auth.py --callback-url "http://localhost:9527/callback?code=xxx&state=yyy"

Tokens auto-refresh via offline scope. Authorize once, runs forever.

Usage

python3 scripts/sync.py              # Sync today
python3 scripts/sync.py --days 7     # Last 7 days
python3 scripts/sync.py --weekly     # Weekly summary
python3 scripts/sync.py --date 2026-03-07  # Specific date

Output: ~/.openclaw/workspace/health/whoop-YYYY-MM-DD.md

Cron (daily auto-sync)

openclaw cron add \
  --name whoop-daily \
  --schedule "0 10 * * *" \
  --timezone Asia/Shanghai \
  --task "Run: python3 ~/.openclaw/workspace/skills/whoop/scripts/sync.py --days 2. Then read the generated markdown files and send me the latest day's report."

Troubleshooting

ProblemFix
--------------
No tokens foundRun auth.py first
Token refresh failed (403)Re-run auth.py to re-authorize
error code: 1010Cloudflare block — uses curl to avoid. Check network
No data for dateWHOOP finalizes sleep after waking; try later

Agent Notes

  • When user asks to re-authorize: run auth.py --print-url, send URL, wait for callback URL
  • After authorization: verify with sync.py --days 1
  • Token exchange uses curl to bypass Cloudflare blocking Python urllib

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-02 13:12 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

life-service

Sonoscli

steipete
控制Sonos音箱(发现/状态/播放/音量/分组)
★ 55 📥 84,940
life-service

healthcheck

stellarhold170nt
使用 JSON 文件存储追踪饮水和睡眠
★ 11 📥 29,978
life-service

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 452 📥 227,426