| Title: | Access COROS Training Hub Fitness Data |
|---|---|
| Description: | Provides a tidy interface to the 'COROS' Training Hub API (<https://coros.com/traininghub>), the web platform that accompanies 'COROS' GPS sports watches. Retrieves activities, daily wellness metrics (heart rate variability, resting heart rate, VO2 max and training load), workout programmes and training calendars. All results are returned as tibbles, ready for analysis with 'dplyr' and 'ggplot2'. Both the US and EU regional endpoints are supported. |
| Authors: | Matt O'Reilly [aut, cre] |
| Maintainer: | Matt O'Reilly <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-24 10:38:11 UTC |
| Source: | https://github.com/cran/rCoros |
Returns a tidy tibble of activities recorded within a date range, one row per activity.
coros_activities( auth, start_day = format(Sys.Date() - 30, "%Y%m%d"), end_day = format(Sys.Date(), "%Y%m%d"), page = 1L, size = 30L, n_max = Inf )coros_activities( auth, start_day = format(Sys.Date() - 30, "%Y%m%d"), end_day = format(Sys.Date(), "%Y%m%d"), page = 1L, size = 30L, n_max = Inf )
auth |
A |
start_day |
Start of date range in |
end_day |
End of date range in |
page |
Page number for paginated results (default |
size |
Number of results per page (default |
n_max |
Maximum total activities to return. Set to |
A tibble::tibble() with columns:
Unique activity identifier (character).
Activity name or remark.
Numeric sport type code.
Human-readable sport name.
Date of activity (Date).
Start timestamp (POSIXct, UTC).
Duration in seconds.
Duration in minutes.
Distance in metres.
Distance in kilometres.
Elevation gain in metres.
Average heart rate (bpm).
Calories (kcal).
Training load score.
Average power (watts).
Device name.
auth <- coros_login() # All activities in the last 30 days acts <- coros_activities(auth) # Running and trail-running only library(dplyr) runs <- coros_activities(auth) |> filter(sport_type %in% c(100L, 102L))auth <- coros_login() # All activities in the last 30 days acts <- coros_activities(auth) # Running and trail-running only library(dplyr) runs <- coros_activities(auth) |> filter(sport_type %in% c(100L, 102L))
Returns a list of three tibbles — a one-row summary, per-lap splits, and time-in-zone heart rate data — for the given activity.
coros_activity_detail(auth, activity_id, sport_type)coros_activity_detail(auth, activity_id, sport_type)
auth |
A |
activity_id |
Activity identifier (from |
sport_type |
Numeric sport type code (from |
A named list with three tibbles:
summaryOne-row tibble with overall activity metrics.
lapsOne row per lap with splits.
hr_zonesHeart-rate zone breakdown (seconds and percent).
auth <- coros_login() acts <- coros_activities(auth) # Detail for the most recent activity detail <- coros_activity_detail( auth, activity_id = acts$activity_id[[1]], sport_type = acts$sport_type[[1]] ) detail$summary detail$laps detail$hr_zonesauth <- coros_login() acts <- coros_activities(auth) # Detail for the most recent activity detail <- coros_activity_detail( auth, activity_id = acts$activity_id[[1]], sport_type = acts$sport_type[[1]] ) detail$summary detail$laps detail$hr_zones
Returns a tidy tibble of per-day wellness metrics from the COROS
/analyse/dayDetail/query endpoint, including HRV, resting heart rate,
training load, VO2max, and stamina.
coros_daily_metrics( auth, start_day = format(Sys.Date() - 28, "%Y%m%d"), end_day = format(Sys.Date(), "%Y%m%d") )coros_daily_metrics( auth, start_day = format(Sys.Date() - 28, "%Y%m%d"), end_day = format(Sys.Date(), "%Y%m%d") )
auth |
A |
start_day |
Start of date range in |
end_day |
End of date range in |
A tibble::tibble() sorted by date with columns:
Calendar date (Date).
Average overnight HRV (ms).
Personal HRV baseline (ms).
Resting heart rate (bpm).
Daily training load.
Training load ratio (acute:chronic).
Fatigue rate.
Acute training impulse.
Chronic training impulse.
7-day training load.
28-day training load.
Estimated VO2max (mL/kg/min).
Lactate threshold heart rate (bpm).
Lactate threshold speed.
Current stamina level.
7-day stamina level.
Performance score.
Time in bed (minutes).
auth <- coros_login() # Last 28 days (default) metrics <- coros_daily_metrics(auth) # Custom range metrics <- coros_daily_metrics(auth, start_day = "20240101", end_day = "20240131")auth <- coros_login() # Last 28 days (default) metrics <- coros_daily_metrics(auth) # Custom range metrics <- coros_daily_metrics(auth, start_day = "20240101", end_day = "20240131")
Retrieves the last ~7 days of overnight HRV data from the COROS dashboard endpoint.
coros_hrv(auth)coros_hrv(auth)
auth |
A |
A tibble::tibble() sorted by date with columns:
Calendar date (Date).
Average overnight HRV (ms).
Personal HRV baseline (ms).
Standard deviation of overnight HRV (ms).
coros_daily_metrics() for a longer historical HRV series.
auth <- coros_login() coros_hrv(auth)auth <- coros_login() coros_hrv(auth)
Logs in with an email/password pair and returns an auth object that must be
passed to every other coros_* function. Credentials are read from
environment variables by default so they are never hard-coded in scripts.
coros_login( email = Sys.getenv("COROS_EMAIL"), password = Sys.getenv("COROS_PASSWORD"), region = c("us", "eu") )coros_login( email = Sys.getenv("COROS_EMAIL"), password = Sys.getenv("COROS_PASSWORD"), region = c("us", "eu") )
email |
COROS account e-mail. Defaults to the |
password |
COROS account password. Defaults to |
region |
API region: |
Set credentials once per session with:
Sys.setenv(COROS_EMAIL = "[email protected]", COROS_PASSWORD = "secret")
or add them to your ~/.Renviron file for persistence.
A named list with fields access_token, user_id, base_url,
region, and timestamp. Treat this object as opaque and pass it
directly to other coros_* functions.
auth <- coros_login() # reads COROS_EMAIL / COROS_PASSWORD from env # EU region auth_eu <- coros_login(region = "eu")auth <- coros_login() # reads COROS_EMAIL / COROS_PASSWORD from env # EU region auth_eu <- coros_login(region = "eu")
Returns a tibble of planned activities from the COROS training schedule within the given date window.
coros_schedule( auth, start_day = format(Sys.Date(), "%Y%m%d"), end_day = format(Sys.Date() + 14, "%Y%m%d") )coros_schedule( auth, start_day = format(Sys.Date(), "%Y%m%d"), end_day = format(Sys.Date() + 14, "%Y%m%d") )
auth |
A |
start_day |
Start of the window in |
end_day |
End of the window in |
A tibble::tibble() with one row per scheduled item and columns:
Training plan identifier.
Item position within the plan.
Associated workout program identifier.
Scheduled date (Date).
Workout name.
Numeric sport type code.
Human-readable sport name.
Estimated duration in minutes.
Logical; TRUE if the workout has been completed.
auth <- coros_login() # Upcoming two weeks schedule <- coros_schedule(auth) # Narrower window schedule <- coros_schedule( auth, start_day = format(Sys.Date(), "%Y%m%d"), end_day = format(Sys.Date() + 7, "%Y%m%d") )auth <- coros_login() # Upcoming two weeks schedule <- coros_schedule(auth) # Narrower window schedule <- coros_schedule( auth, start_day = format(Sys.Date(), "%Y%m%d"), end_day = format(Sys.Date() + 7, "%Y%m%d") )
Retrieves all workout programs stored in the COROS Training Hub, returning a list of two tidy tibbles: a summary of each workout and its constituent steps.
coros_workouts(auth)coros_workouts(auth)
auth |
A |
A named list with two tibbles:
workoutsOne row per workout with columns id, name,
sport_type, sport_name, duration_min, and n_steps.
stepsOne row per step, linked to workouts via workout_id,
with columns step_name, duration_s, duration_min,
power_low_w, power_high_w, and sets.
auth <- coros_login() result <- coros_workouts(auth) result$workouts result$stepsauth <- coros_login() result <- coros_workouts(auth) result$workouts result$steps