简体   繁体   中英

Strava API is_kom

I would like to find out if I am the KOM on a specific segment. According to the API this should be possible using: "https://www.strava.com/api/v3/segments/{id}"

This should return a DetailedSegment. However, the athlete_pr_effort data is not contained in the response.

When iterating over starred segments, you also get a DetailedSegment instance and the athlete_pr_effort is set like expected. In my case, the segment is not starred though.

Any idea how this can be done?

The Strava Segment Leaderboard endpoint was deprecated. It used to exist here:

https://www.strava.com/api/v3/segments/:id/leaderboard

Strava's update mid 2020: https://developers.strava.com/docs/segment-changes/

It also states that you need to be a subscriber to get the kom_rank field (which I think is what you're looking for).

/api/v3/segments/:id/leaderboard Segment Effort & Leaderboard data, included fields such as kom_rank, are only available for subscribers in the following endpoints.

/api/v3/segments/:id /api/v3/segment_efforts [Updated] /api/v3/segment_efforts/:id/streams /api/v3/activities/:id

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM