get_segment: Retrieve details about a specific segment

View source: R/get_segment.R

get_segmentR Documentation

Retrieve details about a specific segment

Description

Retreive details about a specific segment

Usage

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

Arguments

stoken

A config object created using the strava_oauth function

id

character 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.

Value

Data from an API request.

See Also

compile_segment for converting the list output to data.frame

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 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)

rStrava documentation built on Oct. 23, 2024, 5:06 p.m.

Related to get_segment in rStrava...