WHOOP (Official API)
by @gavinchengcool
Connect to the WHOOP Developer Platform via official OAuth (authorization code flow), store and refresh tokens, and fetch WHOOP v2 data (recovery, sleep, cyc...
clawhub install openclaw-slugπ About This Skill
name: whoop description: Connect to the WHOOP Developer Platform via official OAuth (authorization code flow), store and refresh tokens, and fetch WHOOP v2 data (recovery, sleep, cycle/strain, workout, profile, body measurements). Use when a user asks to connect/authorize WHOOP, pull WHOOP metrics, summarize today/yesterday, generate daily/weekly WHOOP reports, or send WHOOP updates to any OpenClaw chat channel (TUI/webchat/Slack/Discord/WhatsApp/Telegram/etc.).
WHOOP (official API)
Keep this skill WHOOP-only (data source). Do not hardcode any destination channel. Generate a clean text/markdown message and either reply in the current chat or use OpenClawβs message tool to send it to a chosen target.
Configuration (required)
Provide these via environment variables (preferred) or direct CLI args to scripts:
WHOOP_CLIENT_IDWHOOP_CLIENT_SECRETWHOOP_REDIRECT_URI (must exactly match the value in the WHOOP developer dashboard)Optional:
WHOOP_TOKEN_PATH (default: ~/.config/openclaw/whoop/token.json)WHOOP_TZ (default: Asia/Shanghai)Workflow 1 β Connect WHOOP (OAuth login)
1) Run:
python3 scripts/whoop_oauth_login.py
2) The script prints an authorization URL. Open it, log in, and approve.
3) After redirect, either:
code.4) The script stores tokens at WHOOP_TOKEN_PATH.
If you need to revoke later, use delete /v2/user/access (see references/whoop_api.md).
Workflow 2 β Fetch metrics (today / yesterday)
Fetch raw WHOOP API objects:
python3 scripts/whoop_fetch.py --date today --out /tmp/whoop_raw_today.json
python3 scripts/whoop_fetch.py --date yesterday --out /tmp/whoop_raw_yday.jsonTip: whoop_fetch.py uses WHOOPβs start/end query params + nextToken pagination. Use --tz to control which local day is fetched (default from WHOOP_TZ).
Normalize into a stable schema:
python3 scripts/whoop_normalize.py /tmp/whoop_raw_today.json --out /tmp/whoop_today.json
Render a message for humans:
python3 scripts/whoop_render.py /tmp/whoop_today.json --format markdown --channel genericChannel formatting presets:
--channel discord (uses bold)
--channel slack / --channel whatsapp (uses *bold*, avoids fancy markup)
--channel telegram (plain text)
Then either:
message(action=send, ...).Workflow 3 β Daily/weekly push (cron)
If the user wants scheduled push messages, create an OpenClaw cron job that runs an isolated agent turn which:
scripts/whoop_fetch.py + scripts/whoop_normalize.py + scripts/whoop_render.pyKeep the cron job channel-agnostic: the destination should be a parameter in the cron payload text.
Notes on API details
references/whoop_api.md.references/output_schemas.md.references/troubleshooting.md.