Glad to hear, I assume the better the input is prepared for you to fix, change, the fast the change is there. Thanks David, you really live my dream of being a “fast-delivering-quality-codeworker”!
We are going to be adding per OAuth client (app) and per athlete (API key) rate limits soon. The goal is to protect the infrastructure from bugs in apps and scripts, not to reduce access. An app with a lot of users that suddenly starts spamming requests can cause problems. Details will appear on the first post in this thread soon.
The current rate limits (10 calls/second per IP address) will remain in place. This is applied before the request reaches the servers.
Rate Limits
(draft, this is not live yet, please shout if this isn’t going to work for you or you see other problems)
There are limits per day (reset at midnight UTC) and per rolling 15 minute window. The following http headers are returned on each request:
X-RateLimit-Limit: <15m limit>,<daily limit>
X-RateLimit-Remaining: <15m limit remaining>,<daily limit remaining>
Over rate limit requests receive a 429 status code and a Retry-After http header indicating how many seconds need to elapse until the call might succeed.
Retry-After: 370
There is an additional limit of 10 calls per second per IP address. This limit does not return any rate limit related http headers.
Rate limits are enforced differently for API key callers and OAuth client apps.
OAuth Client Apps
The default daily rate limit is 100/user per day up to 500 users (max 50000 requests), with a minimum of 5000. The daily limit resets at midnight UTC.
The requests per 15 minute limit is 1/8 of the daily limit with a minimum of 2500. This is a rolling limit and does not reset at specific intervals.
If you have more than 500 users and need a higher daily limit, or a lower limit for safety, contact [email protected]. The limits are to protect the Intervals.icu infrastructure from apps with many users suddenly generating many more calls than usual.
Current limits and API usage information can be found on the oauth client management page (look for “Manage App” on your app on /settings/apps).
API Key Callers
API key calls are limited to 5000 requests per day and 2500 requests per rolling 15 minute window. If you need more than that you need to create an app using OAuth.
Hello! I tried to use APIs in the Intervals.icu API docs . But I always get an error:
"API Server
Authentication
Required (None Applied)
Response Status: Failed to fetch (CORS or Network Issue)"
Sorry, I’m doing something wrong and I’m stuck.
First of all, I entered in the top right “API_KEY” (without quotes) as username and my API KEY from intervals as password. Then I chose, for example, a section
"
Get athlete profile info
get /api/v1/athlete/{id}/profile
"
And in the ID field I entered my ID-number (from intervals) without i.
You must include the i in the athlete id.
If you are trying this on these pages, this is currently not working, because they are configured as http. You need https.
Nothing you can do about it at the moment.
Hopefully some admin will fix this soon @david @eva @ryandev
But you can use the curl in a terminal and replace the http with https.
Don‘t foget the i as athlete id, if your id has an i, like @MedTechCD said.
This is fixed for deployment Friday AM (GMT+2). Sorry that took so long to sort out.
Just an FYI, the “i” in athleteID won’t work for some of the very first users. All my scripts have a fallback built in as mine works without the i.
Long ago, when Intervals.icu was Strava only, it used Strava athlete IDs (no i prefix). The prefix was added to avoid collisions when Intervals.icu switched to using its own IDs for athletes.
Hi, just wanted to start by saying thanks for allowing API access, it’s been really useful for me!
I have a custom local dashboard that I use to display/explore my own data. Currently I’m retrieving my new activities from the intervals API using either a manual trigger or a check for newly uploaded activities once every 30 mins. I’d really like to replace these methods with the ACTIVITY_UPLOADED webhook, but I believe this is only possible for OAuth apps at the moment.
So two questions I guess:
- Am I correct in thinking it’s not possible to use webhooks with the REST API?
- Assuming that’s the case, is it OK to for me to register an OAuth app even if it’s purely for my own use, just so I can take advantage of the webhook functionality?
A couple of questions..
- Do OAuth access tokens expire? If so, what’s the lifetime?
- Is there a refresh-token flow, or are access tokens long-lived until the user revokes access?
- If a token stops working, is the correct recovery simply to send the user back through /oauth/authorize again?
- For revocation detection on a long-lived server integration - does the APP_SCOPE_CHANGED webhook fire when a user removes or changes the app’s permissions? And/or does the API return a specific error code on calls made with a revoked token?
Thanks.
No
No
Yes
Yes.
I’m not sure in this, I think it was access denied error.
We just added a new endpoint:
GET /api/v1/athlete/{id}/connections
This returns all the devices and platforms the athlete has connected, for better onboarding of new users.
{
"id": "2049151",
"garmin_health_connected": true,
"garmin_training_connected": true,
"polar_connected": true,
"suunto_connected": true,
"coros_connected": true,
"concept2_connected": false,
"zepp_connected": false,
"huawei_connected": true,
"wahoo_connected": true,
"zwift_connected": true,
"oura_connected": false,
"whoop_connected": true,
"strava_connected": true,
"dropbox_connected": true,
"hammerhead_connected": false,
"tp_virtual_connected": false,
"rouvy_connected": false,
"mywhoosh_connected": true,
"biketerra_connected": true,
"tymewear_connected": true
}
On a related note, you can now deep link to the /settings/connections page and display only the blocks for selected services:
https://intervals.icu/settings/connections?services=polar,garmin
This is useful when prompting users to connect.
For the TypeScript folks: I published an open-source typed SDK covering all 148 endpoints, generated from the official OpenAPI spec. Zero dependencies, MIT, unofficial.
Details and discussion here: Intervals-icu-sdk: TypeScript SDK generated from the official OpenAPI spec (open source, unofficial)
Feedback is very welcome!
Hello guys,
I searched this topic but maybe I missed it. I am looking at the joules field for a planned workout, but detected, that this value often returns “null” for my planned workouts due to the fact that I am using % of power in my workouts rather than real power values.
Is this something which could be changed? I mean, intervals is calculating the kJ values correctly and displays joules and joules_above_ftp in the workouts with %. I want to avoid building my own calculation again.
Any hints to fix this?
Can you be a bit more clear in what you’re asking?
It all works from the GUI, no matter if you use absolute values, zones or percentage of FTP in the planned workouts.
Do you have FTP configured? Are you doing this on the GUI or through the API?
Please use ‘workout’ only for planned stuff and use ‘activity’ for finished activities. Else things become very confusing.
If you write workout descriptions via API, the kJ aren‘t set automatically for those workouts - see the right one (via API) vs. left one (via API, and Edit and Ok via GUI):
Though I am not sure, if this is intentional or not, and why this could be intentional.
Hello,
thanks for your feedback and sorry for the late reply.
I am refering to the API.
In the GUI, everything is clear and fine. kJ are shown for structured workouts with Power Steps added. I am also talking about workouts only, not finished activities.
In the API, there is the ‘joules’ field but it is “null” for all of my workouts.
Taking a closer look, I recognized that it seems like this value is calculated in the GUI but not stored in the field and available in the API for Workouts.
The ultimate consequence for me, as written, is, that I have to calculate the value again on my own which I would like to avoid.
Could you double check if these values “joules” and “joules_above_ftp” contain a value for your planned workouts (not finished activities!).
@R2Tom Maybe this could be the reason that I see “null” values? I am creating most of the workouts via an API.
@MedTechCD I can now confirm that something goes wrong with the workout field “joules”, especially when creating or updating the workout via API. I have updated a workout today, the workout in the frontend shows 906 kJ. My own calculation in my tool also counts 906 kJ. The value in the field joules delivers “1568kJ” which matches with the joules before the updates on the workout have been done.
Could you look into this issue?
Hello all.
I would like to retrieve the Total Km run , the Total Time running and the average pace running, for a specific period, like the entire year or the last month.
What would be the best way to do the call in order to retrieve this data?


