The Hub is now in read-only mode as we make improvements to the Hub experience. More information is available here.
09-06-2024 01:06 PM
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?
09-11-2024 09:41 AM - edited 09-11-2024 09:47 AM
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"
}
}
09-09-2024 02:13 PM
Hello,
Please provide an example of what you tried, it's almost impossible to help you if you don't give details about which endpoint you called or which parameters you used.
Welcome to the Community - here is your guide to help you get started!