Skip to main content
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.
Zur Installation springen Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/kesslerio/fitbit-analytics-openclaw-skill --skill fitbit-analyticsDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen...
Basierend auf der SOC-Berufsklassifikation
name 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. metadata {"openclaw":{"requires":{"bins":["python3"],"env":["FITBIT_CLIENT_ID","FITBIT_CLIENT_SECRET","FITBIT_ACCESS_TOKEN","FITBIT_REFRESH_TOKEN"]},"homepage":"https://github.com/kesslerio/fitbit-analytics-openclaw-skill"}}
Fitbit Analytics
Quick Start
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"
python scripts/fitbit_briefing.py
python scripts/fitbit_api.py steps --days 7
python scripts/fitbit_api.py heartrate --days 7
python scripts/fitbit_api.py sleep --days 7
python scripts/fitbit_api.py report --type weekly
python scripts/refresh_tokens.py
python scripts/fitbit_api.py summary --days 7
When to Use
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
python scripts/fitbit_briefing.py
python scripts/fitbit_briefing.py --date 2026-01-20
python scripts/fitbit_briefing.py --format brief
python scripts/fitbit_briefing.py --format json
{
"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)
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 - <<'PY'
from fitbit_api import FitbitClient
client = FitbitClient()
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 - <<'PY'
from fitbit_api import FitbitAnalyzer
analyzer = FitbitAnalyzer(steps_data, hr_data)
summary = analyzer.summary()
print (summary)
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/refresh_tokens.py - Standalone proactive token refresh CLI
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:
Create app at: https://dev.fitbit.com/apps
Get client_id and client_secret
Complete OAuth flow to get access_token and refresh_token
Set environment variables or pass to scripts
Run python scripts/refresh_tokens.py every 6 hours to keep refresh token rotation active
Environment
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 "<YOUR_TELEGRAM_CHAT_ID>" \
--message "python3 /path/to/your/scripts/fitbit_briefing.py --format text"
Note: Replace /path/to/your/ with your actual path and <YOUR_TELEGRAM_CHAT_ID> with your Telegram channel/group ID.
Proactive Token Refresh (Every 6 Hours) openclaw cron add \
--name "Refresh Fitbit Tokens" \
--cron "0 */6 * * *" \
--tz "America/Los_Angeles" \
--session isolated \
--wake next-heartbeat \
--deliver \
--channel telegram \
--target "<YOUR_TELEGRAM_CHAT_ID>" \
--message "cd /path/to/your && python3 scripts/refresh_tokens.py"
The token cache at ~/.fitbit-analytics/tokens.json stores expires_at and refreshed_at so the refresh command can rotate tokens before Fitbit inactivity expiry.