I use an R script to retrieve my personal activity data from Strava using the API. I use the following code, that, in the past, always gave me data on average and max heart rates, but now these have disappeared for some reason:
while (TRUE) {
req <- httr::GET(
url = "https://www.strava.com/api/v3/athlete/activities",
config = token,
query = list(per_page = 200, page = page)
)
# Convert JSON to dataframe
activity_data <- fromJSON(content(req, as = "text"), flatten = TRUE)
# Stop if no data found
if (length(activity_data) == 0) {break}
# Append data to dataframe
if (nrow(df) == 0) {df <- activity_data} else {
common_cols <- intersect(names(df), names(activity_data))
df <- rbind(df[, common_cols, drop = FALSE], activity_data[, common_cols, drop = FALSE])}
# Turn to next page
page <- page + 1
}
Anyone has an idea why the heart rate data is missing?