← Back to Skills Marketplace
kesslerio

Fitbit Analytics

by kesslerio · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
2462
Downloads
1
Stars
2
Active Installs
3
Versions
Install in OpenClaw
/install fitbit-analytics
Description
Fitbit health and fitness data integration. Fetch steps, heart rate, sleep, activity, calories, and trends from Fitbit Web API. Generate automated health reports and alerts. Requires FITBIT_CLIENT_ID, FITBIT_CLIENT_SECRET, FITBIT_ACCESS_TOKEN, FITBIT_REFRESH_TOKEN.
README (SKILL.md)

Fitbit Analytics

Quick Start

# Set Fitbit API credentials
export FITBIT_CLIENT_ID="your_client_id"
export FITBIT_CLIENT_SECRET="your_client_secret"
export FITBIT_ACCESS_TOKEN="your_access_token"
export FITBIT_REFRESH_TOKEN="your_refresh_token"

# Generate morning briefing with Active Zone Minutes
python scripts/fitbit_briefing.py

# Fetch daily steps
python scripts/fitbit_api.py steps --days 7

# Get heart rate data
python scripts/fitbit_api.py heartrate --days 7

# Sleep summary
python scripts/fitbit_api.py sleep --days 7

# Generate weekly health report
python scripts/fitbit_api.py report --type weekly

# Get activity summary
python scripts/fitbit_api.py summary --days 7

When to Use

Use this skill when:

  • Fetching Fitbit metrics (steps, calories, heart rate, sleep)
  • Analyzing activity trends over time
  • Setting up alerts for inactivity or abnormal heart rate
  • Generating daily/weekly health reports

Core Workflows

1. Daily Briefing

# Generate morning health briefing (includes Active Zone Minutes)
python scripts/fitbit_briefing.py                    # Today's briefing
python scripts/fitbit_briefing.py --date 2026-01-20  # Specific date
python scripts/fitbit_briefing.py --format brief     # 3-line summary
python scripts/fitbit_briefing.py --format json      # JSON output

# Example output includes:
# - Yesterday's activities (logged exercises)
# - Yesterday's Active Zone Minutes (total, Fat Burn, Cardio, Peak)
# - Today's activity summary (steps, calories, floors, distance)
# - Heart rate (resting, average, zones)
# - Sleep (duration, efficiency, awake episodes)
# - Trends vs 7-day average

Example JSON output:

{
  "date": "2026-01-21",
  "steps_today": 8543,
  "calories_today": 2340,
  "distance_today": 6.8,
  "floors_today": 12,
  "active_minutes": 47,
  "resting_hr": 58,
  "avg_hr": 72,
  "sleep_hours": 7.2,
  "sleep_efficiency": 89,
  "awake_minutes": 12,
  "yesterday_activities": [
    {"name": "Run", "duration": 35, "calories": 320}
  ],
  "yesterday_azm": {
    "activeZoneMinutes": 61,
    "fatBurnActiveZoneMinutes": 39,
    "cardioActiveZoneMinutes": 22
  }
}

Note: Cardio Load is NOT available via Fitbit API - it's a Fitbit Premium feature only visible in the mobile app.

2. Data Fetching (CLI)

# Available commands:
python scripts/fitbit_api.py steps --days 7
python scripts/fitbit_api.py calories --days 7
python scripts/fitbit_api.py heartrate --days 7
python scripts/fitbit_api.py sleep --days 7
python scripts/fitbit_api.py summary --days 7
python scripts/fitbit_api.py report --type weekly

3. Data Fetching (Python API)

export PYTHONPATH="{baseDir}/scripts"
python - \x3C\x3C'PY'
from fitbit_api import FitbitClient

client = FitbitClient()  # Uses env vars for credentials

# Fetch data (requires start_date and end_date)
steps_data = client.get_steps(start_date="2026-01-01", end_date="2026-01-16")
hr_data = client.get_heartrate(start_date="2026-01-01", end_date="2026-01-16")
sleep_data = client.get_sleep(start_date="2026-01-01", end_date="2026-01-16")
activity_summary = client.get_activity_summary(start_date="2026-01-01", end_date="2026-01-16")
PY

4. Analysis

export PYTHONPATH="{baseDir}/scripts"
python - \x3C\x3C'PY'
from fitbit_api import FitbitAnalyzer

analyzer = FitbitAnalyzer(steps_data, hr_data)
summary = analyzer.summary()
print(summary)  # Returns: avg_steps, avg_resting_hr, step_trend
PY

5. Alerts

python {baseDir}/scripts/alerts.py --days 7 --steps 8000 --sleep 7

Scripts

  • scripts/fitbit_api.py - Fitbit Web API wrapper, CLI, and analysis
  • scripts/fitbit_briefing.py - Morning briefing CLI (text/brief/json output)
  • scripts/alerts.py - Threshold-based notifications

Available API Methods

Method Description
get_steps(start, end) Daily step counts
get_calories(start, end) Daily calories burned
get_distance(start, end) Daily distance
get_activity_summary(start, end) Activity summary
get_heartrate(start, end) Heart rate data
get_sleep(start, end) Sleep data
get_sleep_stages(start, end) Detailed sleep stages
get_spo2(start, end) Blood oxygen levels
get_weight(start, end) Weight measurements
get_active_zone_minutes(start, end) Active Zone Minutes (AZM) breakdown

References

  • references/api.md - Fitbit Web API documentation
  • references/metrics.md - Metric definitions and interpretations

Authentication

Fitbit API requires OAuth 2.0 authentication:

  1. Create app at: https://dev.fitbit.com/apps
  2. Get client_id and client_secret
  3. Complete OAuth flow to get access_token and refresh_token
  4. Set environment variables or pass to scripts

Environment

Required:

  • FITBIT_CLIENT_ID
  • FITBIT_CLIENT_SECRET
  • FITBIT_ACCESS_TOKEN
  • FITBIT_REFRESH_TOKEN

Automation (Cron Jobs)

Cron jobs are configured in OpenClaw's gateway, not in this repo. Add these to your OpenClaw setup:

Daily Morning Briefing (8:00 AM)

openclaw cron add \
  --name "Morning Fitbit Health Report" \
  --cron "0 8 * * *" \
  --tz "America/Los_Angeles" \
  --session isolated \
  --wake next-heartbeat \
  --deliver \
  --channel telegram \
  --target "\x3CYOUR_TELEGRAM_CHAT_ID>" \
  --message "python3 /path/to/your/scripts/fitbit_briefing.py --format text"

Note: Replace /path/to/your/ with your actual path and \x3CYOUR_TELEGRAM_CHAT_ID> with your Telegram channel/group ID.

Usage Guidance
This skill appears to implement Fitbit API access and reporting as described, but review the following before installing: - The code will read from and write to ~/.config/systemd/user/secrets.conf (and will create ~/.fitbit-analytics/tokens.json). If you run it, it will attempt to persist refreshed access/refresh tokens into that secrets.conf file and set file permissions. Ensure that file is not used for unrelated secrets you don't want overwritten. - If you prefer not to have tokens persisted to that shared secrets file, run scripts with explicit env vars (export FITBIT_ACCESS_TOKEN and FITBIT_REFRESH_TOKEN) or modify the code to use a dedicated secrets file. Inspect scripts/fitbit_api.py to confirm exactly what will be written. - The skill contacts only Fitbit endpoints (api.fitbit.com) for data and dev.fitbit.com for setup — there are no other remote endpoints in the code. Still, review the files yourself before granting client_secret/refresh token access. - Limit the permissions of the Fitbit app to only the scopes you need. Treat client_secret and refresh token as sensitive: store them in a dedicated, secure secrets store if possible. - If you are unsure, run the scripts in an isolated account or container and observe file writes (secrets.conf, ~/.fitbit-analytics) to confirm behavior before enabling automation/cron or granting persistent access.
Capability Analysis
Type: OpenClaw Skill Name: fitbit-analytics Version: 1.0.0 The skill is designed to integrate with the Fitbit API, fetching and analyzing health data. It is classified as suspicious due to the `scripts/fitbit_api.py` script's capability to read from and write updated Fitbit API tokens to sensitive user configuration files: `~/.config/systemd/user/secrets.conf` and `~/.fitbit-analytics/tokens.json`. While this behavior is intended for legitimate token persistence and auto-refresh, modifying system-level or user-specific secrets files represents a high-risk capability that could be exploited if not handled with extreme care, even though the current implementation appears to set appropriate file permissions (owner-only read/write).
Capability Assessment
Purpose & Capability
Name, description, required env vars (FITBIT_CLIENT_ID, FITBIT_CLIENT_SECRET, FITBIT_ACCESS_TOKEN, FITBIT_REFRESH_TOKEN) and required binary (python3) all align with a Fitbit Web API integration. The included scripts implement Fitbit endpoints and reporting features described in the SKILL.md.
Instruction Scope
SKILL.md instructs running the included Python scripts and setting env vars — consistent with purpose. It also suggests OpenClaw cron automation delivering outputs to channels (e.g., Telegram). The runtime instructions and CLI usages stay within Fitbit data collection and reporting; they do not instruct collection of unrelated system files or network endpoints beyond Fitbit/dev.fitbit.com.
Install Mechanism
No install spec or external downloads are used; this is an instruction-only skill with Python scripts included. Risk from install mechanism is low because nothing is fetched from arbitrary URLs and no package managers are invoked.
Credentials
Although the declared env vars match Fitbit, the code also reads and writes a secrets file at ~/.config/systemd/user/secrets.conf and persists tokens to ~/.fitbit-analytics/tokens.json. The registry metadata did not declare these config paths. Writing to a user secrets file in the home directory (and updating tokens there) is a broader filesystem/credential footprint than the SKILL.md explicitly declares and could overwrite or mix with other stored secrets.
Persistence & Privilege
The client auto-refreshes tokens and persists them to disk (secrets.conf and a token cache), and sets file permissions. Persisting refresh tokens and access tokens on the user's filesystem is expected for long-running integrations, but it is a permanent change to user files and therefore higher privilege than a read-only skill. This behavior should be disclosed up-front in the registry metadata (required config paths) and verified by the user.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fitbit-analytics
  3. After installation, invoke the skill by name or use /fitbit-analytics
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial ClawHub release
v0.1.1
Update ClawdHub badge to listed and add GitHub repo link
v0.1.0
Initial release: docs alignment + metadata
Metadata
Slug fitbit-analytics
Version 1.0.0
License
All-time Installs 2
Active Installs 2
Total Versions 3
Frequently Asked Questions

What is Fitbit Analytics?

Fitbit health and fitness data integration. Fetch steps, heart rate, sleep, activity, calories, and trends from Fitbit Web API. Generate automated health reports and alerts. Requires FITBIT_CLIENT_ID, FITBIT_CLIENT_SECRET, FITBIT_ACCESS_TOKEN, FITBIT_REFRESH_TOKEN. It is an AI Agent Skill for Claude Code / OpenClaw, with 2462 downloads so far.

How do I install Fitbit Analytics?

Run "/install fitbit-analytics" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Fitbit Analytics free?

Yes, Fitbit Analytics is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Fitbit Analytics support?

Fitbit Analytics is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Fitbit Analytics?

It is built and maintained by kesslerio (@kesslerio); the current version is v1.0.0.

💬 Comments