Public API to retrieve calorie data for future rides

Hi,

I’m currently looking at building an application that uses future planned workout calorie information to build a meal plan.

I know there are a lot of applications out there for retrospective calorie and meal tracking but I don’t find those useful over a future plan.

I have developed a google sheet doc that I manually input in the weeks ahead calorie training needs with other variables such as weight loss %, current weight, lifestyle (to achieve BMR) etc.

Does anybody know if I can get future planned workout info out of the callender on a psuedo live basis so my app adjusts my calorie and macro requirements as AI makes its adjustments after each workout?

From reading other threads it seems TR isnt keen to provide much access to its data so this might be a long shot.

Cheers for any help ahead of time.

J

You could parse the ICS file and extract the kcals from that. Some crude parsing:

curl -s https://api.trainerroad.com/v1/calendar/ics/REDACTED | perl -lnE 'print if s/^DESCRIPTION.*kJ\(Cal\) (\d+)\..*/$1/'
2 Likes

Sorry I haven’t had a proper look so might answer my question when I do but is this possible for FUTURE planned rides?

Can you try to use intervals.icu? It’s syncing with future TR workouts in the plan and showing estimated kcal for those. Not to mention all the other data you can use.

2 Likes

Have you tried the foodcoach app from Team-Jumbo-Visma?

For those who come across this in the future this is what i eneded up building after a few versions:

DietMetrics.db.app

I use google app script to pull in my training calender from TR and put it into a table and then through a bunch of other related tables I ended up building a “front” end tab that allows me to adjust requirments and plan my weekly meals.

Feel free to make a copy and adjust for yourself if someone finds it helpful.