Need help with your Sensor Bio integration? Pop into our Discord if you have questions or want to discover how Open Wearables can solve your problems.
Overview
Sensor Bio provides access to workout, sleep, recovery, and continuous biometric data through their REST API. The integration uses OAuth 2.0 for authentication and pull-based syncing. All API requests use HTTP/2 as required by the Sensor Bio API specification.Supported data types
Data delivery
Provider quirks
Continuous 24/7 timeseries behavior
Continuous 24/7 timeseries behavior
Sensor Bio delivers biometric data (heart rate, HRV, SpO2, respiratory rate) as a continuous stream via the
/v1/biometrics endpoint using cursor-based pagination (last-timestamp). Unlike day-aggregated providers, each poll window can return hundreds of timestamped samples covering arbitrary time ranges.- Timestamps in the biometrics timeseries are milliseconds since epoch.
- Sleep endpoint timestamps (
start_timestamp,end_timestamp) are seconds since epoch (not milliseconds — the API docs are inconsistent; the implementation follows observed behavior). - The cursor stops when the
links.nextfield is absent or the last record timestamp is unchanged.
Prerequisites
- A Sensor Bio developer account with API access
SENSORBIO_CLIENT_IDandSENSORBIO_CLIENT_SECRETenvironment variables set (see.env.example)SENSORBIO_REDIRECT_URImust match the redirect URI registered in the Sensor Bio developer portal
Environment variables
OAuth flow
The integration follows the standard OAuth 2.0 authorization code flow:- User initiates connection — Open Wearables redirects to
https://api.sensorbio.com/oauth/authorize - User grants consent in the Sensor Bio app
- Sensor Bio redirects back with an authorization code
- Open Wearables exchanges the code for
access_token+refresh_token - Tokens are stored encrypted per-user and refreshed automatically on expiry
Data sync
Workouts
Fetched from/v1/activities using cursor pagination on WorkoutStats.timestamp. Each activity includes:
- Start/end time, duration
- Workout type (mapped from
likely_nameor_workout_name) - Average, max, and min heart rate; calories; distance
Sleep
Fetched from/v1/sleep one day at a time (the API requires a single date parameter; there is no multi-day range for session-level sleep). Each day may return multiple sessions (overnight + nap). Each record includes:
- Start/end time, total duration
- Stage breakdown: deep, light, REM, awake minutes
- Sleep score (mapped to
efficiency_percent) - Biometrics during sleep: average HR, HRV, SpO2, resting HR
- Sensor Bio does not label naps; sessions are stored with
is_nap=false - Stage timeline:
/v1/sleep/details/dayis called once per day and returns the stage intervals for every sleep of that day; each session keeps the intervals that start inside its own window. A session is stored without the timeline when that call returns nothing.
Recovery
Fetched from/v1/scores one day at a time (single required date parameter). Provides daily recovery/activity/sleep scores and resting biometrics (resting HR, resting HRV, SpO2) stored as timeseries samples plus HealthScore rows.
24/7 Biometric timeseries
Fetched from/v1/biometrics using cursor pagination. Supports:
Daily step details
Fetched from/v1/step/details one day at a time. Provides steps and distance (km). Note: the endpoint returns the response body directly (no data wrapper).
Daily calories
Fetched from/v1/calorie/details one day at a time, in the same shape as step details. Resting Calories is stored as basal_energy, and Total Calories minus Resting Calories as active_energy.
