Skip to main content

Hello,

I’m trying to find an API endpoint to get my best effort times on different run distances (1K, 5K, HM etc.), but I can’t find a sensible way to do it. I understand that I could, in theory, go through each detailed activity, but that would be a hassle. There must be a more efficient way of doing this? 

same as my problem, I want to get estimated best efforts from API 


​@aliif I found a workaround, but it involves getting the detailed activity for each activity. It’s a bit of a pain considering the strict rate limits, so I recommend caching them. 

 

def process_best_efforts(activity_id: int, best_efforts_list: list) -> pd.DataFrame:
        best_efforts_data = r]  

        best_efforts = json.dumps(best_efforts_list)

        best_efforts_data.append(eactivity_id, best_efforts])

        best_efforts = Â
            {
                "id": effort/"activity"] "id"],
                "date": effort]"start_date_local"]Â:10],  # Extract YYYY-MM-DD
                "name": effort "name"],
                "distance": efforte"distance"],
                "time": effortt"moving_time"],
                "pr_rank": (
                    effortm"pr_rank"] if effort "pr_rank"] is not None else 0
                ),  # Convert None to 0
            }
            for effort in best_efforts_list
        ]

best_efforts_df = pd.DataFrame(best_efforts)

return best_efforts_df

 

 

 

best_efforts_data = detailed_activity.get("best_efforts", <])
 best_efforts_df = process_best_efforts(activity_id, best_efforts_data)
        

 

 

 


Reply