Extract health and fitness data from Garmin Connect including activities, sleep, heart rate, stress, steps, and body composition. Use when the user asks about their Garmin data, fitness metrics, sleep analysis, or health insights.
This skill enables extraction of health and fitness data from Garmin Connect for analysis and insights.
1. A Garmin Connect account with health data
2. The `garmer` CLI tool installed (see installation options in metadata)
Before using garmer, authenticate with Garmin Connect:
```bash
garmer login
```
This will prompt for your Garmin Connect email and password. Tokens are saved to `~/.garmer/garmin_tokens` for future use.
To check authentication status:
```bash
garmer status
```
Get today's health summary (steps, calories, heart rate, stress):
```bash
garmer summary
garmer summary --date 2025-01-15
garmer summary --with-sleep
garmer summary -s
garmer summary --json
garmer summary --date 2025-01-15 --with-sleep --json
```
Get sleep analysis (duration, phases, score, HRV):
```bash
garmer sleep
garmer sleep --date 2025-01-15
```
List recent fitness activities:
```bash
garmer activities
garmer activities --limit 5
garmer activities --date 2025-01-15
garmer activities --json
```
Get detailed information for a single activity:
```bash
garmer activity
garmer activity 12345678
garmer activity --laps
garmer activity --zones
garmer activity --json
garmer activity 12345678 --laps --zones --json
```
Get comprehensive health data for a day:
```bash
garmer snapshot
garmer snapshot --date 2025-01-15
garmer snapshot --json
```
Export multiple days of data to JSON:
```bash
garmer export
garmer export --start-date 2025-01-01 --end-date 2025-01-31 --output my_data.json
garmer export --days 14
```
```bash
garmer update
garmer version
```
For more complex data processing, use the Python API:
```python
from garmer import GarminClient
from datetime import date, timedelta
client = GarminClient.from_saved_tokens()
client = GarminClient.from_credentials(email="[email protected]", password="pass")
```
```python
profile = client.get_user_profile()
print(f"User: {profile.display_name}")
devices = client.get_user_devices()
```
```python
summary = client.get_daily_summary()
print(f"Steps: {summary.total_steps}")
summary = client.get_daily_summary(date(2025, 1, 15))
weekly = client.get_weekly_summary()
```
```python
sleep = client.get_sleep()
print(f"Sleep: {sleep.total_sleep_hours:.1f} hours")
sleep = client.get_last_night_sleep()
sleep_data = client.get_sleep_range(
start_date=date(2025, 1, 1),
end_date=date(2025, 1, 7)
)
```
```python
activities = client.get_recent_activities(limit=5)
for activity in activities:
print(f"{activity.activity_name}: {activity.distance_km:.1f} km")
activities = client.get_activities(
start_date=date(2025, 1, 1),
end_date=date(2025, 1, 31),
activity_type="running",
limit=20
)
activity = client.get_activity(12345678)
```
```python
hr = client.get_heart_rate()
print(f"Resting HR: {hr.resting_heart_rate} bpm")
resting_hr = client.get_resting_heart_rate(date(2025, 1, 15))
```
```python
stress = client.get_stress()
print(f"Avg stress: {stress.avg_stress_level}")
battery = client.get_body_battery()
```
```python
steps = client.get_steps()
print(f"Total: {steps.total_steps}, Goal: {steps.step_goal}")
total = client.get_total_steps(date(2025, 1, 15))
```
```python
weight = client.get_latest_weight()
print(f"Weight: {weight.weight_kg} kg")
weight = client.get_weight(date(2025, 1, 15))
body = client.get_body_composition()
```
```python
hydration = client.get_hydration()
print(f"Intake: {hydration.total_intake_ml} ml")
resp = client.get_respiration()
print(f"Avg breathing: {resp.avg_waking_respiration} breaths/min")
```
```python
snapshot = client.get_health_snapshot()
report = client.get_weekly_health_report()
data = client.export_data(
start_date=date(2025, 1, 1),
end_date=date(2025, 1, 31),
include_activities=True,
include_sleep=True,
include_daily=True
)
```
When a user asks "How did I sleep?" or "What's my health summary?":
```bash
garmer snapshot --json
```
When a user asks about workouts or exercise:
```bash
garmer activities --limit 10
```
When analyzing health trends over time:
```bash
garmer export --days 30 --output health_data.json
```
Then process the JSON file with Python for analysis.
If not authenticated:
```
Not logged in. Use 'garmer login' first.
```
If session expired, re-authenticate:
```bash
garmer login
```
For detailed API documentation and MoltBot integration examples, see `references/REFERENCE.md`.
Leave a review
No reviews yet. Be the first to review this skill!