360 Secure SkillHub
360 安全技能中心

Fitbit (Official API)

通过 Fitbit OAuth 授权并在本地保存、刷新令牌,按天拉取活动与睡眠摘要,规范化成稳定的每日 JSON 结构,再按渠道渲染简短文本摘要;需配置 Fitbit 客户端凭据与回调地址,脚本以 python3 运行。

gavinchengcool
gavinchengcool
热度 60.97
最近更新 2026-05-11 17:31:16
分类:生活依赖:代码执行 / 第三方 API / 读写文件应用场景:健康 / 数据处理 / 自动化脚本 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-fitbit
Metadata
name
openclaw-fitbit
description
Official Fitbit OAuth integration for OpenClaw (Tier 1). Use to connect/authorize Fitbit, store+refresh tokens locally, fetch daily activity + sleep summaries, normalize into a stable daily JSON shape for the Wellness hub, and render a short digest for any chat channel.

Fitbit (Official API)

This is a source skill. It connects to Fitbit, fetches data, normalizes it, and renders a short message.

Configuration

Required env vars:

  • FITBIT_CLIENT_ID
  • FITBIT_CLIENT_SECRET
  • FITBIT_REDIRECT_URI

Optional:

  • FITBIT_TOKEN_PATH (default: ~/.config/openclaw/fitbit/token.json)
  • FITBIT_TZ (default: Asia/Shanghai)
  • FITBIT_SCOPES (default: activity sleep heartrate profile weight)

Connect (OAuth)

  • Phone/remote mode (recommended):
python3 scripts/fitbit_oauth_login.py
  • Desktop loopback mode (optional): if authorizing on the same machine and FITBIT_REDIRECT_URI is loopback:
python3 scripts/fitbit_oauth_login.py --loopback

Fetch + normalize for a day

python3 scripts/fitbit_fetch_daily.py --date today --out /tmp/fitbit_raw_today.json
python3 scripts/fitbit_normalize_daily.py /tmp/fitbit_raw_today.json --out /tmp/fitbit_today.json
python3 scripts/fitbit_render.py /tmp/fitbit_today.json --format markdown --channel generic

References

  • API/OAuth notes: references/fitbit_api.md
  • Output schema: references/output_schema.md