get_segment | R Documentation |
Retreive details about a specific segment
get_segment(stoken, id = NULL, request = NULL)
stoken |
A |
id |
character for id of the segment |
request |
chr string, must be "starred", "leaderboard", "all_efforts", or NULL for segment 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
.
Data from an API request.
compile_segment
for converting the list
output to data.frame
## 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 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')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.