Many thanks @Andrii_Magalich for sharing this, really low effort way in to having a play with this excellent API.
In case of interest or helps anyone else, here’s a link to the doc I built based on what you shared:
Main thing the sheet is for is to suggest what your next activity could be to achieve a user specified Form value - in the sheet imaginatively called “Next Activity”. Also recreates the fitness/fatigue chart.
To make it work take a copy, then your details (user number and API key) simply need to be entered in the red cells near the top of the sheet called "Daily Record’, which also has the button to manually trigger pulling data from intervals.
Is there a way to pull the compliance to plan % over the API? and what are the rules for colouring this. Using the API more and more now to integrate with our Pro Cycling Team Hub
Unfortunately that is currently done client side so its not in the API. Would be nice if it was though.
There is a field on activity “paired_event_id” that is the ID of the paired workout if any. Pairing is done automatically if the workout matches the activity closely enough (sport and load/time) and can also be done manually (drag and drop). So you might be able to use that.
The colours are as follows:
if (p >= 80 && p <= 120) return "good"
if (p >= 50 && p <= 150) return "poor"
return "bad"
.good { color: #2ca02c; }
.poor { color: #ff7f0e; }
.bad { color: #d62728; }
I will see what I can do about getting compliance into the API. It’s a bit complicated and a big advantage of doing it “client side” on demand is that it is always up to date. I would need to store compliance for the week on the wellness record for the Sunday or something.
Just after the key ‘current’ values for an athlete’s fitness, fatigue, form and eFTP. Am I right in thinking that these are not available from the wellness endpoint?
I have looked at the summary endpoint but this returns data for multiple athletes and is proving a nightmare to parse in my app.
Those are the tags as attached to athletes on the /athletes page. I just added a special one “self”. If you use that only your own data will be returned.
Yes if you use tags=self then only the calling athletes data is returned. So this will be the athlete for the bearer token for oauth or the athlete for the API key.
I have a question. I am trying to pull the future events on the athlete calendar with an API. I get all the training plan data that I need but I am missing average power, normalised power and variability index. Is it possible to get at least variability index of a calendar event with API and if it is how?
Yeah at the moment I’d loop through multiple athletes to get activities for the last 30 days then loop through each activity to pull the stream data. I only need time, HR and power.
Not sure which is the most efficient way of doing this.