Skip to content

WHOOP

import { Steps, Aside } from ‘@astrojs/starlight/components’;

WHOOP is a recovery-focused wearable that continuously measures HRV, sleep, strain, and SpO2. It is designed around the concept of daily recovery scores — a measure of how ready your body is to perform.

WHOOP uses OAuth 2.0 with standard authorization code flow.

  • Authorization URL: https://api.prod.whoop.com/oauth/oauth2/auth
  • Token URL: https://api.prod.whoop.com/oauth/oauth2/token
  • API Base URL: https://api.prod.whoop.com/developer/v2
  1. Go to the WHOOP Developer Portal

    Visit developer.whoop.com and sign in with your WHOOP account.

  2. Create a new application

    Click “Create Application” and fill in your app details.

  3. Set the Redirect URI

    Add your callback URL:

    • Development: http://localhost:3001/v1/oauth/whoop/callback
    • Production: https://api.yourdomain.com/v1/oauth/whoop/callback
  4. Copy credentials

    Note the Client ID and Client Secret from the app settings.

  5. Add to environment

    Terminal window
    WHOOP_CLIENT_ID=your_client_id
    WHOOP_CLIENT_SECRET=your_client_secret

VitaSync requests these WHOOP scopes at authorization:

ScopeData Access
offlineRefresh tokens for background sync
read:recoveryDaily recovery scores and HRV
read:cyclesDaily physiological cycles (strain, resting HR, SpO2)
read:sleepSleep sessions with stages
read:workoutWorkout activities
read:body_measurementHeight, weight, max heart rate
read:profileUser profile information
Metric TypeUnitNotes
sleephoursDuration + stages (deep, light, rem, awake) in data
sleep_scorescoreWHOOP sleep performance score (0–100)
respiratory_ratebreaths_per_minOvernight respiratory rate
recovery_scorepercentDaily recovery score (0–100%). WHOOP’s flagship metric
resting_heart_ratebpmOvernight resting heart rate
heart_rate_variabilitymsOvernight RMSSD
blood_oxygenpercentSpO2 during sleep
strain_scorescoreDaily strain (0–21). Exertion over the day
calorieskcalTotal daily calories
workoutWorkout activities (see Events API for full data)
heart_ratebpmContinuous HR during workouts
distancemetersDistance for cardio activities
SettingValue
Minimum sync interval15 minutes (900 seconds)
Initial sync windowLast 30 days
PaginationCursor-based on all endpoints

WHOOP uses cursor-based pagination on all list endpoints. VitaSync handles this automatically during sync, iterating through all pages until it reaches data older than the sync window.

If you call the WHOOP API directly outside of VitaSync, use the nextToken field from each response as the nextToken query parameter in the next request.

WHOOP’s recovery system is based on three concepts:

  • Strain (0–21 Borg-like scale): How much exertion was placed on the body during the day. Includes workouts and all-day activity.
  • Recovery (0–100%): How recovered the body is at time of waking, based on HRV, resting HR, sleep performance, and respiratory rate. WHOOP uses color-coded zones: red (0–33%), yellow (34–66%), green (67–100%).
  • Sleep performance: How well the body slept relative to its own need, not a fixed target.

These feed distinct metric types in VitaSync:

WHOOP ConceptVitaSync Metric Type
Recovery %recovery_score
Strainstrain_score
Sleep performancesleep_score
HRVheart_rate_variability
Resting HRresting_heart_rate

WHOOP supports over 100 sport/activity types. Examples include:

running, cycling, swimming, strength_training, yoga, hiit, rowing, basketball, soccer, tennis, hiking, skiing, crossfit, and many more.

The activityType field in VitaSync Events maps directly from WHOOP’s sport ID using an internal translation table.

SymptomLikely Cause
No recovery dataWHOOP device not worn overnight or insufficient sleep data
Missing cycle dataUser did not wear WHOOP for the full day
Sync fails with 401Access token expired — VitaSync should auto-refresh using offline scope
Low-resolution HR dataWHOOP only provides HR during recorded workouts, not all-day