get_streams: Retrieve a Strava data stream for a single activity

View source: R/get_streams.R

get_streamsR Documentation

Retrieve a Strava data stream for a single activity

Description

Retrieve a Strava data stream for a single activity. Internally called by get_activity_streams.

Usage

get_streams(
  stoken,
  id,
  request = "activities",
  types = NULL,
  resolution = NULL,
  series_type = NULL
)

Arguments

stoken

A config object created using the strava_oauth function

id

numeric for id of the request

request

chr string defining the stream type, must be "activities", "segment_efforts", "segments"

types

list of chr strings with any combination of "time" (seconds), "latlng", "distance" (meters), "altitude" (meters), "velocity_smooth" (meters per second), "heartrate" (bpm), "cadence" (rpm), "watts", "temp" (degrees Celsius), "moving" (boolean), or "grade_smooth" (percent)

resolution

chr string for the data resolution to retrieve, can be "low", "medium", "high", defaults to all

series_type

chr string for merging the data if resolution is not equal to "all". Accepted values are "distance" or "time". If omitted, no merging is performed.

Details

Requires authentication stoken using the strava_oauth function and a user-created API on the strava website. From the API documentation, 'streams' is the Strava term for the raw data associated with an activity.

Value

Data from an API request.

Examples

## Not run: 
# create authentication token
# requires user created app name, id, and secret from Strava website
stoken <- httr::config(token = strava_oauth(app_name, app_client_id, 
	app_secret, cache = TRUE))

get_streams(stoken, id = 351217692, types = list('distance', 'latlng'))

## End(Not run)

fawda123/rStrava documentation built on March 27, 2024, 3:16 p.m.