rStrava (version 1.3.1)

get_segment: Retrieve details about a specific segment

Description

Retreive details about a specific segment

Usage

get_segment(stoken, id = NULL, request = NULL)

Value

Data from an API request.

Arguments

stoken

A config object created using the strava_oauth function

id

numeric for id of the segment

request

chr string, must be "starred", "leaderboard", "all_efforts", or NULL for segment details

Details

Requires authentication stoken using the strava_oauth function and a user-created API on the strava website. The authenticated user must have an entry for a segment to return all efforts if request = "all_efforts". For request = "starred", set id = NULL.

See Also

compile_segment for converting the list output to data.frame

Examples

Run this code
if (FALSE) {
# 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 segment info
get_segment(stoken, id = 229781)

# get top ten leaderboard for the segment
get_segment(stoken, id = 229781, request = "leaderboard")

# get all efforts for the authenticated user on the segment
get_segment(stoken, id = 4483903, request = 'all_efforts')

# get the starred segments for the user
get_segment(stoken, request = 'starred') 
}

Run the code above in your browser using DataLab