Is OAuth required for an APPLICATION or really simply to access other athletes beside yourself. Context, I’m not writing an APPLICATION, but I’m interesting in using POSTMAN to automate some activities, which I’m currently doing for myself, but have an interest in doing for athletes I coach. Is OAurh required for that or is basic authentication acceptable?
Basic auth with your API key will work fine for that.
The docs say that " An empty stub object is returned for Strava activities", does this apply to your own activities? Assuming I am just using basic authentication and 0 for the athlete ID. Can I access my own activities?
Thanks,
Andrew
short answer = no
long answer = see above
I’ve been experimenting with the API using the RapiDoc UI, looking at power curves, it seems like the activity type is not being filtered correctly.
For the request:
curl -X GET "https://intervals.icu/api/v1/athlete/0/power-curves{ext}?curves=84d&type=Ride"
Run activities are being returned in the activity list at the bottom of the response. To confirm this I tried the following:
curl -X GET "https://intervals.icu/api/v1/athlete/0/power-curves{ext}?curves=7d&type=Ride"
In the past 7 days I have only run, this should return an empty list, but instead it returns my power curve based on the runs I’ve done the past 7 days.
Have I found a bug, or am I doing something wrong?
Thanks,
Andrew
Ooops I broke that when I added the “zero athlete id” stuff. Fixed now. Tx for the report.
@david Is it possible to get fitness and fatigue broken down by activity type via the API? I do triathlon and would like data for the three disciplines separately.
No. Intervals.icu only stores the “all sports” versions of those. You would need to compute it yourself from the load on each activity.
How to create an event in athlete calendar and upload attachments in one single request?
There isn’t an endpoint to create attachments yet. I need to think about how to do that. Probably not as a single call though because the endpoint will accept multipart form data for the attachment file and that doesn’t play nicely with a JSON event payload.
When uploading activity files (POST /api/v1/athlete/{id}/activities
), is there a way to signal that the external_id
belongs to a specific platform? Specifically, I’m uploading old Zwift rides and I have the Zwift ID, so it’d be neat if I could properly link it.
Edit: Or afterwards with an update.
Unfortunately not really. Activities do have a source (e.g. ZWIFT) which is what triggers the link creation in the client app but making that updatable would cause problems with some sources.
Sorry for responding to an old post. I just discovered Streamlit it looks interesting. Are there any apps published that would interact with Intervals.icu or related to Running in general? I’m thinking for example taking some specific workouts performed as Test and then predicting various metrics and training zones depending on some models.
I fixed the CORS problem, I’d initially spelled “Authorization” using British English with an “s”, and then browser caching meant that the bad request kept being submitted. For the benefit of any future readers here is working code to fetch data from the intervals.icu API using browser based JavaScript.
async function fetchData() {
const base64UsernamePassword = btoa("API_KEY:YOURKEY");
const url = "https://intervals.icu/api/v1/athlete/0/wellness/2025-01-29";
try {
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": "Basic " + base64UsernamePassword,
},
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
console.log(data);
} catch (error) {
console.error("Error fetching data:", error);
}
}
Hope that’s helpful to someone else!
Can’t we have the Authorisation spelt the proper way?
Nice one! I tried all morning to connect but to no avail until I stumbled on this post:)
Hi, I’m begginer in this things but I’m trying get data from my specific workout and I’m getting this error:
{“status”:500,“error”:“org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type ‘java.lang.String’ to required type ‘int’; nested exception is java.lang.NumberFormatException: For input string: "13632114836"”}%
This is what I type in terminal:
curl -X GET “https://intervals.icu/api/v1/athlete/i235611/workouts/13632114836”
-H ‘accept: /’ -u “API_KEY:xxxxx”
Do you have some ideas?
I beleive you’re usigthe wrong endpoint
https://intervals.icu/api/v1/docs/swagger-ui/index.html
/api/v1/activity/{id} <<< should be this one i believe
or are you trying to get the FIT file?
also take a look here
Hello, I’m new to using APIs to access data and would like to be able to automate bringing the Gear table into Google Sheets. I tried =IMPORTDATA(“https://intervals.icu/api/athlete//gear.csv”,“,”) but that didn’t work. I know I will need to pass the API key, but I don’t know if there is a way to do it in the URL. I’m open to other ways of doing it. Can anyone help?
Thanks!