Challenges
Challenges are the base object used to represent Strava ride and run challenges.
Access to challenges can be enabled on a per application basis, email developers -at- strava.com for more information.
Challenge Types
- Cumulative
- A challenge that accumulates an athlete’s activities for a given activity value: distance, elevation or time. The challenge is completed when the athlete reaches the goal.
- Segment
- A challenge that is attached to a segment during a particular date window.
The challenge is completed when an athlete ride’s the segment during the date window - Single Activity
- A challenge that selects the athlete’s best activity for a given activity value: distance, elevation, time or pace/speed.
The challenge is completed when the athlete reaches the goal.
Detailed representation attributes
id: | integer |
resource_state: |
integer indicates level of detail |
name: | string |
type”: |
string one of CumulativeChallenge, SegmentChallenge, or SingleActivityChallenge |
joined: |
boolean indicates if athlete has joined challenge |
description: | string |
mobile_description: | string |
additional_info: | string |
rules: | string |
prizes: | string |
start_date: | date string |
end_date: | date string |
segment_id: | integer |
activity_type: | string |
dimension: | string |
goal: |
integer measured in meters or seconds |
goal_hidden: | boolean |
measurement_unit: |
string one of metric or english |
milestone_count: | integer |
logo_url: | string |
teaser: | string |
twitter_hashtag: | string |
url: | string |
color: | string |
participant_count: |
integer number of athletes who have joined challenge |
total_dimension: |
float total aggregate value for all participants |
attempt_count: |
integer number of participants valid activities completed |
completed_count: |
integer number of participants who have completed challenge (met goal) |
leaderboard_count: |
integer number of participants on the leader board |
external_url: |
string when present, challenge cannot be joined directly, redirect here to join |
Summary representation attributes
The summary representation of the challenge object is the same as the detailed representation, except it does NOT include these attributes:
description
mobile_description
additional_info
rules
prizes
Example Challenge
{
"id": 438,
"resource_state": 3,
"joined": false,
"name": "Giro Climbing Challenge",
"start_date": "2015-07-08",
"end_date": "2015-08-07",
"segment_id": null,
"type": "CumulativeChallenge",
"activity_type": "ride",
"participant_count": 92003,
"dimension": "elevation_gain",
"goal": 10000,
"goal_hidden": false,
"measurement_unit": "metric",
"milestone_count": 3,
"logo_url": "https://www.cloudfront.net/challenges/logo-name.png",
"teaser": "Climb big for a finishers-only discount ...",
"twitter_hashtag": "stravagiro",
"url": "giro-climbing-challenge",
"color": "#333",
"total_dimension": 660405874.359906,
"attempt_count": 1204578,
"completed_count": 23425,
"leaderboard_count": 89578,
"mobile_description": "",
"description": "",
"additional_info": "",
"rules": "",
"prizes": ""
}
Returns a detailed representation of a challenge
Parameters
id: | integer required |
Definition
GET https://www.strava.com/api/v3/challenges/:id
Example request
$ curl -G https://www.strava.com/api/v3/challenges/123 \
-H "Authorization: Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9"
Retrieves the leaderboard for the specified challenge. Pagination is supported.
Parameters
id: | integer required |
filter: |
string filter to use for leaderboard, ‘friends’, ‘club’, or ‘none’ (default). |
club_id: |
integer required if using club filter club id to filter on |
Attributes
rank: |
integer rank of the entry on requested leaderboard |
overall_rank: |
integer rank of the entry on overall leaderboard |
athlete_id: | integer |
athlete_name: |
integer anonymized for logged out requests |
athlete_profile: |
string URL to a 124x124 pixel profile picture |
total_dimension: | depends on the exact configuration of the challenge moving time in seconds for time based single activity challenge for example |
activity_id: | integer |
activity_count: | integer |
success_count: | integer |
Returns entries in the leaderboard for the challenge, in descending order. The requesting athlete and up to 2 entries before and after the requesting athlete’s entry will be appended on the first page if they are not already in the first page.
Definition
GET https://www.strava.com/api/v3/challenges/:id/leaderboard
Example responses
[
{
"rank": 1,
"overall_rank": 1,
"athlete_id": 6944267,
"athlete_name": "Stephen B.",
"athlete_profile": "https://dgalywyr863hv.cloudfront.net/pictures/athletes/6944267/3280114/1/large.jpg",
"total_dimension": 86166,
"activity_id": 424472014,
"activity_count": 9,
"success_count": 2
}
]
Join a challenge on behalf of the authenticated athlete. An access token with write permissions is required.
Parameters
id: |
integer required ID of the challenge to join |
Definition
POST https://www.strava.com/api/v3/challenges/:id/athletes
Leave a challenge on behalf of the authenticated user. An access token with write permissions is required.
Parameters
id: |
integer required ID of the club to join |
Definition
DELETE https://www.strava.com/api/v3/challenges/:id/athletes
List the challenges the athlete has joined.
Returns an array of challenge summary representations.
Definition
GET https://www.strava.com/api/v3/challenges/joined