Description Details Active bindings Methods See Also Examples
This strava class is designed to interract with strava API using a set of methods. A mountainbikeR object must be initialized using the new method then all other method will be availabe
TBD
tokenShows generated token.
new()Create a new moutainbiker object.
Requested scopes, as a comma delimited string, e.g. "activity:read_all,activity:write". Applications should request only the scopes required for the application to function normally. The scope activity:read is required for activity webhooks.
read: read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
read_all:read private routes, private segments, and private events for the' user
profile:read_all: read all profile information even if the user has set their profile visibility to Followers or Only You
profile:write: update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
activity:read: read the user's activity data for activities that are visible to Everyone and Followers, excluding privacy zone data
activity:read_all: the same access as activity:read, plus privacy zone data and access to read the user's activities with visibility set to Only You
activity:write: access to create manual activities and uploads, and access to edit any activities that are visible to the app, based on activity read access level
mountainbiker_initializer$new( my_app_name = NULL, my_client_id = NULL, my_client_secret = NULL, my_app_scope = "read,read_all,activity:read_all", cache = FALSE )
my_app_namechr string, the name of the app defined in strava
my_client_idchr string, the ID of the app like 27881
my_client_secretchr string, the secret as defined in strava
my_app_scopechr string for requested scopes, as a comma delimited
cachea logical TRUE to keep cached token, false for not. string, e.g. "activity:read_all,activity:write"
A new 'mountainbikeR object' object.
\dontrun{
my_mb <- mountainbiker_initializer$new(
    my_app_name = "mycool_app"
    , my_client_id = 77777
    , my_client_secret = "a super secret string"
    , my_app_scope = "read,read_all,activity:read_all" #"public"
    , cache = FALSE
    )
}
get_activities()List all activities from strava api. Returns the activities of an athlete for a specific identifier. Requires activity:read. Only Me activities will be filtered out unless requested by a token with activity:read_all.
mountainbiker_initializer$get_activities( activities_per_page = 200, page_number = 1, after_date = NULL, before_date = NULL )
activities_per_pagemax number of item to return (must be 200 max)
page_numberthe specific page number to extract
after_datereturn activities after date as YYYY-MM-DD
before_datereturn activities before date as YYYY-MM-DD
get_activity()Returns the given activity that is owned by the authenticated athlete. https://developers.strava.com/playground/#/Activities/getActivityById
mountainbiker_initializer$get_activity( activity_id = NULL, include_all_efforts = FALSE )
activity_idthe strava id of the activity
include_all_effortsboolean
get_activity_zones()Returns the zones of a given activity. https://developers.strava.com/docs/reference/#api-Activities-getZonesByActivityId
mountainbiker_initializer$get_activity_zones(activity_id = NULL)
activity_idthe strava id of the activity
include_all_effortsboolean
get_athlete()Get informations about the athlete
mountainbiker_initializer$get_athlete()
get_athlete_stats()Get informations about the athlete stats
mountainbiker_initializer$get_athlete_stats(athlete_id = NULL)
athlete_idThe identifier of the athlete. Must match the authenticated athlete.
get_athlete_zones()Get informations about the athlete heart rate zone
mountainbiker_initializer$get_athlete_zones()
get_gear()Get athlete gear description from gear id
mountainbiker_initializer$get_gear(gear_id = NULL)
gear_idthe id of the gear to get
get_segment_efforts()Returns a set of the authenticated athlete's segment efforts for a given segment.
mountainbiker_initializer$get_segment_efforts( segment_id = NULL, page = NULL, per_page = NULL )
segment_idThe identifier of the segment.
pagePage number
per_pageNumber of items per page. Defaults to 30.
get_segment_effort()Returns a segment effort from an activity that is owned by the authenticated athlete.
mountainbiker_initializer$get_segment_effort(effort_id = NULL)
effort_idthe id of the specific effort to collect
explore_segments()Explore segments returns the top 10 segments matching a specified query based on a bounding box.
mountainbiker_initializer$explore_segments( southwest_lat = NULL, southwest_long = NULL, northeast_lat = NULL, northeast_long = NULL, activity_type = NULL, min_climbing_cat = NULL, max_climbing_cat = NULL )
southwest_latsouthwest corner latitutde
southwest_longsouthwest corner longitude
northeast_latnortheast corner latitude
northeast_longnortheast corner longitude
activity_typeDesired activity type. May take one of the following values: running, riding
min_climbing_catint the minimum climbing category
max_climbing_catint the maximum climbing category
get_segment_leaderboard()Returns the specified segment leaderboard.
mountainbiker_initializer$get_segment_leaderboard( segment_id = NULL, gender = NULL, age_group = NULL, weight_class = NULL, following = NULL, club_id = NULL, date_range = NULL, context_entries = NULL, page = NULL, per_page = NULL )
segment_idint The identifier of the segment leaderboard.
genderstring, Filter by gender. May take one of the following values: M, F
age_groupstring summit Feature. Filter by age group. May take one of the following values: 0_19, 20_24, 25_34, 35_44, 45_54, 55_64, 65_69, 70_74, 75_plus
weight_classstring, filter by weight class. May take one of the following values: 0_124, 125_149, 150_164, 165_179, 180_199, 200_224, 225_249, 250_plus, 0_54, 55_64, 65_74, 75_84, 85_94, 95_104, 105_114, 115_plus
followingBoolean Filter by friends of the authenticated athlete.
club_idLong,Filter by club id
date_rangestring, Filter by date range, will be in the athlete's timezone May take one of the following values: this_year, this_month, this_week, today
context_entriesInteger, ??? not documented
pageInteger, Page number
per_pageinteger, Number of items per page. Defaults to 30.
get_starred_segments()List of the authenticated athlete's starred segments. Private segments are filtered out unless requested by a token with read_all scope.
mountainbiker_initializer$get_starred_segments(page = NULL, per_page = NULL)
pageInteger, Page number
per_pageinteger, Number of items per page. Defaults to 30.
get_segment()Returns the specified segment. read_all scope required in order to retrieve athlete-specific segment information, or to retrieve private segments.
mountainbiker_initializer$get_segment(segment_id = NULL)
segment_idthe strava id of the segment
get_activity_streams()Returns the given activity's streams. Requires activity:read scope. Requires activity:read_all scope for Only Me activities.
mountainbiker_initializer$get_activity_streams( activity_id = NULL, streams_types = NULL )
activity_idthe strava id of the segment
streams_typesvector of esired stream types. May take the following values: "time", "latlng", "distance", "altitude", "velocity_smooth", "heartrate", "cadence", "watts", "temp", "moving", "grade_smooth"
get_segment_effort_streams()Returns a set of streams for a segment effort completed by the authenticated athlete. Requires read_all scope.
mountainbiker_initializer$get_segment_effort_streams( effort_id = NULL, streams_types = NULL )
effort_idThe identifier of the segment effort.
streams_typesvector of esired stream types. May take the following values: "time", "latlng", "distance", "altitude", "velocity_smooth", "heartrate", "cadence", "watts", "temp", "moving", "grade_smooth"
get_segment_streams()Returns the given segment's streams. Requires read_all scope for private segments.
mountainbiker_initializer$get_segment_streams( segment_id = NULL, streams_types = NULL )
segment_idthe strava id of the segment
streams_typesvector of esired stream types. May take the following values: "latlng", "distance", "altitude"
clone()The objects of this class are cloneable with this method.
mountainbiker_initializer$clone(deep = FALSE)
deepWhether to make a deep clone.
https://developers.strava.com/playground
https://developers.strava.com/docs/reference/#api-SegmentEfforts-getEffortsBySegmentId
https://developers.strava.com/playground/#/SegmentEfforts/getEffortsBySegmentId
https://developers.strava.com/docs/reference/#api-SegmentEfforts-getSegmentEffortById
https://developers.strava.com/playground/#/SegmentEfforts/getSegmentEffortById
https://developers.strava.com/docs/reference/#api-Segments-getSegmentById
https://developers.strava.com/docs/reference/#api-Streams-getActivityStreams
https://developers.strava.com/docs/reference/#api-Streams-getSegmentEffortStreams
https://developers.strava.com/docs/reference/#api-Streams-getSegmentStreams
1 2 3 4 5 6 7 8 9 10 11 12 13 14  | ## ------------------------------------------------
## Method `mountainbiker_initializer$new`
## ------------------------------------------------
## Not run: 
my_mb <- mountainbiker_initializer$new(
    my_app_name = "mycool_app"
    , my_client_id = 77777
    , my_client_secret = "a super secret string"
    , my_app_scope = "read,read_all,activity:read_all" #"public"
    , cache = FALSE
    )
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.