@openpets/whoop
v1.0.0
Published
Complete WHOOP API integration for accessing workout, sleep, recovery, and physiological data
Maintainers
Readme
WHOOP Plugin
Complete WHOOP API integration for accessing workout, sleep, recovery, and physiological data from your WHOOP wearable.
Quick Start
1. Get Your WHOOP Access Token
- Go to the WHOOP Developer Dashboard
- Create a new OAuth application
- Use the authorization code flow to obtain an access token
- Required scopes:
read:recovery- Recovery data (HRV, resting heart rate)read:cycles- Physiological cycles and strainread:workout- Workout dataread:sleep- Sleep dataread:profile- User profileread:body_measurement- Height, weight, max heart rate
2. Configure Environment
Create a .env file:
WHOOP_ACCESS_TOKEN=your_access_token_here3. Test Connection
opencode run "test whoop connection"Available Tools
User & Profile
| Tool | Description |
|------|-------------|
| whoop-test-connection | Test API connection and configuration |
| whoop-get-profile-basic | Get user profile (name, email) |
| whoop-get-body-measurement | Get body measurements (height, weight, max HR) |
Recovery
| Tool | Description |
|------|-------------|
| whoop-get-recovery-collection | Get all recoveries (paginated) |
| whoop-get-recovery-for-cycle | Get recovery for a specific cycle |
Sleep
| Tool | Description |
|------|-------------|
| whoop-get-sleep-collection | Get all sleep records (paginated) |
| whoop-get-sleep-by-id | Get specific sleep by ID |
| whoop-get-sleep-for-cycle | Get sleep for a specific cycle |
Workouts
| Tool | Description |
|------|-------------|
| whoop-get-workout-collection | Get all workouts (paginated) |
| whoop-get-workout-by-id | Get specific workout by ID |
Physiological Cycles
| Tool | Description |
|------|-------------|
| whoop-get-cycle-collection | Get all cycles (paginated) |
| whoop-get-cycle-by-id | Get specific cycle by ID |
Utilities
| Tool | Description |
|------|-------------|
| whoop-get-activity-mapping | Convert v1 activity ID to v2 UUID |
| whoop-revoke-user-oauth-access | Revoke OAuth access token |
Example Queries
# Get your recovery score
opencode run "get my whoop recovery score"
# Get recent sleep data
opencode run "show my whoop sleep data for the last week"
# Get workout history
opencode run "list my whoop workouts"
# Get physiological cycles
opencode run "get my whoop cycles for the past month"
# Check body measurements
opencode run "what are my whoop body measurements"Data Filtering
Most collection endpoints support filtering:
limit- Number of results (max 25)start- Start time (ISO 8601 format)end- End time (ISO 8601 format)nextToken- Pagination token for next page
Example:
opencode run "get my whoop sleep data from 2024-01-01 to 2024-01-31"Response Data
Recovery Score
recovery_score- Recovery percentage (0-100)resting_heart_rate- Resting HR in BPMhrv_rmssd_milli- Heart rate variability in msspo2_percentage- Blood oxygen percentageskin_temp_celsius- Skin temperature
Sleep Data
sleep_performance_percentage- Sleep performance (0-100)sleep_efficiency_percentage- Time asleep vs in bedstage_summary- Breakdown by sleep stage (light, deep, REM)respiratory_rate- Breaths per minute
Workout Data
strain- Workout strain scoreaverage_heart_rate- Average HR during workoutmax_heart_rate- Max HR during workoutkilojoule- Energy burneddistance_meter- Distance (if applicable)zone_durations- Time in each HR zone
FAQ
Q: How do I get a WHOOP access token? A: Visit the WHOOP Developer Dashboard, create an OAuth app, and use the authorization code flow.
Q: What's the difference between v1 and v2 API? A: v2 uses UUIDs instead of integer IDs, has improved data models, and will receive all new features. v1 is deprecated.
Q: Can I convert v1 IDs to v2 UUIDs?
A: Yes, use the whoop-get-activity-mapping tool for one-time migration.
Q: What are the rate limits? A: WHOOP API has rate limiting. If you receive a 429 error, wait before making more requests.
