# Send Fitbit Analytics to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "fitbit-analytics",
    "name": "Fitbit Analytics",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/kesslerio/fitbit-analytics",
    "canonicalUrl": "https://clawhub.ai/kesslerio/fitbit-analytics",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/fitbit-analytics",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fitbit-analytics",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SETUP.md",
      "SKILL.md",
      "docs/PRIVACY.md",
      "docs/TERMS.md",
      "references/api.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "fitbit-analytics",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-03T07:48:52.235Z",
      "expiresAt": "2026-05-10T07:48:52.235Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fitbit-analytics",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fitbit-analytics",
        "contentDisposition": "attachment; filename=\"fitbit-analytics-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "fitbit-analytics"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/fitbit-analytics"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/fitbit-analytics",
    "downloadUrl": "https://openagent3.xyz/downloads/fitbit-analytics",
    "agentUrl": "https://openagent3.xyz/skills/fitbit-analytics/agent",
    "manifestUrl": "https://openagent3.xyz/skills/fitbit-analytics/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/fitbit-analytics/agent.md"
  }
}
```
## Documentation

### 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

### 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 - <<'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 - <<'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

MethodDescriptionget_steps(start, end)Daily step countsget_calories(start, end)Daily calories burnedget_distance(start, end)Daily distanceget_activity_summary(start, end)Activity summaryget_heartrate(start, end)Heart rate dataget_sleep(start, end)Sleep dataget_sleep_stages(start, end)Detailed sleep stagesget_spo2(start, end)Blood oxygen levelsget_weight(start, end)Weight measurementsget_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

### 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 "<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.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: kesslerio
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-03T07:48:52.235Z
- Expires at: 2026-05-10T07:48:52.235Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/fitbit-analytics)
- [Send to Agent page](https://openagent3.xyz/skills/fitbit-analytics/agent)
- [JSON manifest](https://openagent3.xyz/skills/fitbit-analytics/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/fitbit-analytics/agent.md)
- [Download page](https://openagent3.xyz/downloads/fitbit-analytics)