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 = []
best_efforts = json.dumps(best_efforts_list)
best_efforts_data.append([activity_id, best_efforts])
best_efforts = [
{
"id": effort["activity"]["id"],
"date": effort["start_date_local"][:10], # Extract YYYY-MM-DD
"name": effort["name"],
"distance": effort["distance"],
"time": effort["moving_time"],
"pr_rank": (
effort["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)
Apearly, the best efforts are only showed in run activities.
But i dont know when it will be available for all sports. Or at leats, main sports like cycling, swiming...
This sounds like trying to re-create one of the subscription features, that's generally frowned upon...
This sounds like trying to re-create one of the subscription features, that's generally frowned upon...
But we can pay for this information? I would like to have an api subscription and get that info but i think is not posible. ¿Itsn’t it?