# API access to Intervals.icu

**URL:** <https://forum.intervals.icu/t/api-access-to-intervals-icu/609>\
**Category:** Guide\
**Created:** [1 April 2020 16:18 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609 "2020-04-01T16:18:59Z")\
**Posts on this page:** 20\
**Page:** 9

<div class="post-metadata">

**Author:** ![William\_Barnes](https://forum.intervals.icu/user_avatar/forum.intervals.icu/william_barnes/32/37518_2.png) [@William\_Barnes](https://forum.intervals.icu/u/William_Barnes)\
**Post date:** [4 June 2022 11:36 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/161 "2022-06-04T11:36:30Z")

</div>

> [@Andrii\_Magalich](#):
>
> In summary, try to make a copy of this document: [Intervals.ICU analysis - Google Ð¢Ð°Ð±Ð»Ð¸ÑÑ](https://docs.google.com/spreadsheets/d/1zs9BD1kxDsyOGPG5KnrMLNc7rbbHvRfA0QWF6sOAxCc/edit?usp=sharing)  
> However, I’m not sure if it will “just work”

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:

> **[Next Activity\_icu v1 (shared)](https://docs.google.com/spreadsheets/d/18ZSQyvN9L_7pmroIErizyL3A08utKb8mpE0NwHLFQeI/edit?usp=drivesdk)**
>
> This Sheet is private

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.

---

<div class="post-metadata">

**Author:** ![Andrii\_Magalich](https://forum.intervals.icu/user_avatar/forum.intervals.icu/andrii_magalich/32/27821_2.png) [@Andrii\_Magalich](https://forum.intervals.icu/u/Andrii_Magalich)\
**Post date:** [5 June 2022 12:48 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/162 "2022-06-05T12:48:00Z")

</div>

You’re welcome!

---

<div class="post-metadata">

**Author:** ![John\_Peters\_endura.f](https://forum.intervals.icu/user_avatar/forum.intervals.icu/john_peters_endura.f/32/60975_2.png) [@John\_Peters\_endura.f](https://forum.intervals.icu/u/John_Peters_endura.f)\
**Post date:** [17 June 2022 13:19 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/163 "2022-06-17T13:19:26Z")

</div>

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

 ![image](https://forum.intervals.icu/uploads/default/original/2X/7/7d5ca691b3c394ad61cc4999e9424c351c7923b3.png)

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [17 June 2022 13:49 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/164 "2022-06-17T13:49:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![John\_Peters\_endura.f](https://forum.intervals.icu/user_avatar/forum.intervals.icu/john_peters_endura.f/32/60975_2.png) [@John\_Peters\_endura.f](https://forum.intervals.icu/u/John_Peters_endura.f)\
**Post date:** [17 June 2022 14:04 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/165 "2022-06-17T14:04:12Z")

</div>

Thanks David. Not a problem I can pull both the event and activity and do the comparison.

Makes sense to keep it client side as you say.

Cheers

John

---

<div class="post-metadata">

**Author:** ![James\_Eastwood\_Socks](https://forum.intervals.icu/user_avatar/forum.intervals.icu/james_eastwood_socks/32/26221_2.png) [@James\_Eastwood\_Socks](https://forum.intervals.icu/u/James_Eastwood_Socks)\
**Post date:** [19 June 2022 23:16 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/166 "2022-06-19T23:16:00Z")

</div>

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.

Thanks

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [20 June 2022 06:22 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/167 "2022-06-20T06:22:21Z")

</div>

You can get CTL, ATL, eFTP etc from the wellness endpoint GET /api/v1/athlete/{id}/wellness?cols=ctl,atl,rampRate,ctlLoad,atlLoad,eftp

[https://intervals.icu/api/v1/docs/swagger-ui/index.html#/wellness-controller/listWellnessRecords](https://intervals.icu/api/v1/docs/swagger-ui/index.html#/wellness-controller/listWellnessRecords)

---

<div class="post-metadata">

**Author:** ![James\_Eastwood\_Socks](https://forum.intervals.icu/user_avatar/forum.intervals.icu/james_eastwood_socks/32/26221_2.png) [@James\_Eastwood\_Socks](https://forum.intervals.icu/u/James_Eastwood_Socks)\
**Post date:** [20 June 2022 07:20 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/168 "2022-06-20T07:20:54Z")

</div>

Great. I was thinking these were something else 🤦‍♂️

---

<div class="post-metadata">

**Author:** ![James\_Eastwood\_Socks](https://forum.intervals.icu/user_avatar/forum.intervals.icu/james_eastwood_socks/32/26221_2.png) [@James\_Eastwood\_Socks](https://forum.intervals.icu/u/James_Eastwood_Socks)\
**Post date:** [21 June 2022 22:55 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/170 "2022-06-21T22:55:53Z")

</div>

what does athlete tags mean here? Is there any way to only bring back info for yourself from the summary endpoint?

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [24 June 2022 07:27 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/171 "2022-06-24T07:27:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![James\_Eastwood\_Socks](https://forum.intervals.icu/user_avatar/forum.intervals.icu/james_eastwood_socks/32/26221_2.png) [@James\_Eastwood\_Socks](https://forum.intervals.icu/u/James_Eastwood_Socks)\
**Post date:** [24 June 2022 08:08 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/172 "2022-06-24T08:08:17Z")

</div>

Thank you - is the ‘self’ tag auto applied to all users, so my code will work for everyone?

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [24 June 2022 08:10 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/173 "2022-06-24T08:10:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![James\_Eastwood\_Socks](https://forum.intervals.icu/user_avatar/forum.intervals.icu/james_eastwood_socks/32/26221_2.png) [@James\_Eastwood\_Socks](https://forum.intervals.icu/u/James_Eastwood_Socks)\
**Post date:** [24 June 2022 08:12 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/174 "2022-06-24T08:12:59Z")

</div>

Perfect, exactly what I was after. Thanks

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [24 June 2022 13:22 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/175 "2022-06-24T13:22:39Z")

</div>

I changed it a little bit. Now if you do tags=self then the data for the athlete id in the path is returned.

---

<div class="post-metadata">

**Author:** ![Zalachenko](https://forum.intervals.icu/letter_avatar_proxy/v4/letter/z/d07c76/32.png) [@Zalachenko](https://forum.intervals.icu/u/Zalachenko)\
**Post date:** [17 July 2022 18:07 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/176 "2022-07-17T18:07:25Z")

</div>

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?

Thank you

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [18 July 2022 05:46 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/177 "2022-07-18T05:46:32Z")

</div>

I have added those fields to the workout\_doc object. Note that they will only show up on newly created or edited calendar events.

---

<div class="post-metadata">

**Author:** ![Zalachenko](https://forum.intervals.icu/letter_avatar_proxy/v4/letter/z/d07c76/32.png) [@Zalachenko](https://forum.intervals.icu/u/Zalachenko)\
**Post date:** [18 July 2022 06:46 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/178 "2022-07-18T06:46:09Z")

</div>

Thank you very much. I am aware of that.

---

<div class="post-metadata">

**Author:** ![John\_Peters\_endura.f](https://forum.intervals.icu/user_avatar/forum.intervals.icu/john_peters_endura.f/32/60975_2.png) [@John\_Peters\_endura.f](https://forum.intervals.icu/u/John_Peters_endura.f)\
**Post date:** [26 July 2022 21:45 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/179 "2022-07-26T21:45:58Z")

</div>

Hi David - I suspect I know the answer to this but I’ll ask anyway 🙂

Is it possible to pull the stream data, e.g. time, power, id, date, for multiple activities at once if a start and end date is passed?

Thanks

John

---

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [27 July 2022 03:53 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/180 "2022-07-27T03:53:45Z")

</div>

Not currently but I could add that. Would be a very big payload!

---

<div class="post-metadata">

**Author:** ![John\_Peters\_endura.f](https://forum.intervals.icu/user_avatar/forum.intervals.icu/john_peters_endura.f/32/60975_2.png) [@John\_Peters\_endura.f](https://forum.intervals.icu/u/John_Peters_endura.f)\
**Post date:** [27 July 2022 06:48 UTC](https://forum.intervals.icu/t/api-access-to-intervals-icu/609/181 "2022-07-27T06:48:37Z")

</div>

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.

[Previous page](https://forum.intervals.icu/t/api-access-to-intervals-icu/609.md?page=8)

[Next page](https://forum.intervals.icu/t/api-access-to-intervals-icu/609.md?page=10)
