# Public API to retrieve calorie data for future rides

**URL:** <https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416>\
**Category:** TrainerRoad Software\
**Tags:** calendar, feature-request\
**Created:** [August 26, 2023, 6:46am UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416 "2023-08-26T06:46:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnoMontgomery](https://sea2.discourse-cdn.com/trainerroad/forum/user_avatar/www.trainerroad.com/johnomontgomery/32/1127_2.png) [@JohnoMontgomery](https://www.trainerroad.com/forum/u/JohnoMontgomery)\
**Post date:** [August 26, 2023, 6:46am UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416/1 "2023-08-26T06:46:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paulgrav](https://sea2.discourse-cdn.com/trainerroad/forum/user_avatar/www.trainerroad.com/paulgrav/32/962_2.png) [@paulgrav](https://www.trainerroad.com/forum/u/paulgrav)\
**Post date:** [August 26, 2023, 8:12am UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416/2 "2023-08-26T08:12:00Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![JohnoMontgomery](https://sea2.discourse-cdn.com/trainerroad/forum/user_avatar/www.trainerroad.com/johnomontgomery/32/1127_2.png) [@JohnoMontgomery](https://www.trainerroad.com/forum/u/JohnoMontgomery)\
**Post date:** [August 26, 2023, 8:22am UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416/3 "2023-08-26T08:22:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jarsson](https://sea2.discourse-cdn.com/trainerroad/forum/user_avatar/www.trainerroad.com/jarsson/32/69117_2.png) [@jarsson](https://www.trainerroad.com/forum/u/jarsson)\
**Post date:** [August 26, 2023, 8:24am UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416/4 "2023-08-26T08:24:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lucien1](https://sea2.discourse-cdn.com/trainerroad/forum/user_avatar/www.trainerroad.com/lucien1/32/81400_2.png) [@Lucien1](https://www.trainerroad.com/forum/u/Lucien1)\
**Post date:** [August 26, 2023, 12:12pm UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416/5 "2023-08-26T12:12:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JohnoMontgomery](https://sea2.discourse-cdn.com/trainerroad/forum/user_avatar/www.trainerroad.com/johnomontgomery/32/1127_2.png) [@JohnoMontgomery](https://www.trainerroad.com/forum/u/JohnoMontgomery)\
**Post date:** [July 20, 2024, 11:36am UTC](https://www.trainerroad.com/forum/t/public-api-to-retrieve-calorie-data-for-future-rides/86416/6 "2024-07-20T11:36:10Z")

</div>

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

[DietMetrics.db.app](https://docs.google.com/spreadsheets/d/1k19loCqcH7dMhdoUn3BxNgeYg9asp0PYXutXXObhuDE/edit?usp=sharing)

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.
