I have noticed that for an app I found online, https://github.com/bokub/stravanity that when querying the segments api endpoint, the response includes a field 'xoms' containing kom and qom times and also 'local_legend'. When I query the same endpoint with my own app API key I do not get this data, even though I am a subscriber. What could I do to fetch the kom/qom data for segments?
Answer
Accessing kom/qom data for segment
Best answer by ActivityFix
If you use the getSegmentById endpoint it returns all of the data you are talking about.
For example, if I select a famous hill climb near me and make the following query, this is the data I get (slightly trimmmed to reduce reply length):
https://www.strava.com/api/v3/segments/3237?access_token=[YOUR_TOKEN_HERE]
{
"id": 3237,
"name": "Mt. Washington",
"activity_type": "Ride",
"distance": 11787.3,
"average_grade": 12.6,
"maximum_grade": 26.8,
"elevation_high": 1908.3,
"elevation_low": 481.5,
"start_latlng": [ 44.289131, -71.2298944 ],
"end_latlng": [ 44.2700411, -71.302981 ],
"total_elevation_gain": 1426.8,
"effort_count": 3400,
"athlete_count": 1275,
"star_count": 1245,
"athlete_segment_stats": {
<MY EFFORT/PR DATA>
},
"xoms": {
"kom": "50:03",
"qom": "1:03:32",
"overall": "50:03",
"destination": {
"href": "strava://segments/3237/leaderboard",
"type": "overall",
"name": "All-Time"
}
},
"local_legend": {
"athlete_id": 61549746,
"title": "John Vanderminden",
"profile": "<LINK HERE>",
"effort_description": "3 efforts in the last 90 days",
"effort_count": "3",
"effort_counts": {
"overall": "3 efforts",
"female": "2 efforts"
},
"destination": "strava://segments/3237/local_legend?categories%5B%5D=overall"
}
}
Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
