Hey all, looking for some guidance from developers who have solved this problem or from the Strava team directly.
I'm building a segment discovery app (Segment Sniper) that helps athletes find segments with beatable leaderboards for both cycling and running. One of the features I'm working on is alerting users when their KOM, QOM, or CR position is under threat or has been taken.
The challenge is getting leaderboard data frequently enough to detect changes without blowing through the rate limits (200 requests per 15 minutes, 2,000 per day).
Here's what I'm currently thinking:
1. Using webhooks (POST /push_subscriptions) to detect when any of our users uploads a new activity. When a webhook fires, I check which segments overlap with that activity and refresh only those specific leaderboards. This avoids polling entirely for activity detection.
2. For leaderboard monitoring on segments where our users hold positions, I'm batching GET /segments/{id}/leaderboard calls during off-peak hours and caching results in Supabase with a 6 hour TTL. But 6 hours feels too slow for a "your crown is under attack" alert to be useful.
3. For segment discovery (GET /segments/explore), I'm caching results for 24 hours per geographic tile since new segments don't appear that frequently.
My questions for the community:
How are other developers handling the balance between fresh leaderboard data and rate limits? Is there a recommended cache TTL for leaderboard data that Strava considers acceptable under the API Agreement's 7 day cache limit?
Has anyone implemented a priority queue approach where segments with active competition (recent new efforts) get polled more frequently while dormant segments get checked less often? Curious how you're weighting that.
For those building multi-sport apps, are you seeing meaningful differences in leaderboard activity patterns between cycling segments (KOM/QOM) and running segments (CR)? I'm wondering if running segments can be polled less frequently since they tend to have lower attempt volumes.
Would love to hear how others have approached this. Also happy to share what I've learned so far about segment data patterns if it's useful to the community.
Cheers
Brooks
