Skip to main content
Question

how to accurately count segment completions from activity data

  • January 21, 2026
  • 5 replies
  • 51 views

lukemccrae
Forum|alt.badge.img+2

I am building an app that counts segment completions from a given start time. I have users whose activities are coming into my system. I parse the activities and retrieve the segment completions from each activity. 

However the count I get is not consistent with Strava's count. about 15% of the time an athlete will have either more or less segments completed.

All the activities I am getting are either runs or trail runs. I'm not sure what I'm doing wrong.

5 replies

Jan_Mantau
Superuser
Forum|alt.badge.img+27
  • Superuser
  • January 21, 2026

That can happen if you don’t have all activities (like when the app doesn’t have the right for the private activities or you missed some for other reasons), if activities were deleted or flagged afterwards, if the segment is newer than the datetime you retrieved the activities and maybe some more reasons. You can always do a reconciliation with the /segment_efforts endpoint but it won’t show you efforts that you don’t have permissions for either.


lukemccrae
Forum|alt.badge.img+2
  • Author
  • Hub Rookie
  • January 21, 2026

I should have been more precise, I am counting segment completions per user. This is in a contest to see who can run the most repetitive segments, so the count is very high. The only segment completion data available from segment endpoints is universal segment completions. There are some users where it seems their segment count is off by one for each activity. Do you know if Strava discusses their way of determining segment completions? I’m interested in things like time window, do they retroactively populate new segments with completions from old activities, things like that. 


Jan_Mantau
Superuser
Forum|alt.badge.img+27
  • Superuser
  • January 21, 2026

I mentioned the /segment_efforts endpoint, not the /segments/{id} endpoint you are likely referring to. The former doesn’t count but lists all the efforts including a date, see https://developers.strava.com/docs/reference/#api-SegmentEfforts-getEffortsBySegmentId

In my experience the number of efforts in that list is the same as the total returned in the segments/ endpoint, regardless whether the segment was created before or after the activity. Of course for very new segments Strava needs some time to populate the efforts.


lukemccrae
Forum|alt.badge.img+2
  • Author
  • Hub Rookie
  • January 23, 2026

this looked promising but it does not allow me to filter based on the athlete ID. It returns universal segment data without an athlete id param. thanks for your help though! 


Jan_Mantau
Superuser
Forum|alt.badge.img+27
  • Superuser
  • January 23, 2026

this looked promising but it does not allow me to filter based on the athlete ID. It returns universal segment data without an athlete id param. thanks for your help though! 

It does not need an athlete id, because these are efforts for the authenticated athlete only.