Typical week¶
Beta
The typical week is in beta and is subject to breaking changes. If you plan to use it in production, email [email protected] before you integrate, so we can tell you about changes in advance and help you migrate.
The typical week describes how an athlete trains in a normal week, day by day: how many days, activities and hours, of which sports, on which weekdays, and at which time of day.
Why it's useful¶
An app that plans training for an athlete starts from how they train now. The typical week answers four questions in one request:
- How much, and of what? Activities and hours per sport, to size a plan.
- Which days does the athlete train, and which are rest days?
- What does the athlete do on a training day: which sport, and for how long?
- When in the day? Morning or evening decides when you schedule a workout.
It describes the athlete's recent past. It doesn't prescribe anything.
Get the typical week¶
GET /api/v1/profile/typical-week returns the athlete's typical week.
curl -X GET "https://app.sweatstack.no/api/v1/profile/typical-week?date=2026-11-26" \
-H "Authorization: Bearer {your_access_token}"
Query parameters:
date(optional, default today): the typical week as of this date. The week that holdsdateisn't used until it's complete.
Requires the activities:read scope.
An example response, with Friday, Saturday and Sunday left out here:
{
"training_days": 4.5,
"activities": 5.417,
"duration": 15493,
"sports": [
{"sport": "cycling", "activities": 2.5, "duration": 6230},
{"sport": "walking", "activities": 1.167, "duration": 5378},
{"sport": "rowing", "activities": 1.083, "duration": 1489},
{"sport": "generic", "activities": 0.25, "duration": 622},
{"sport": "running", "activities": 0.25, "duration": 498},
{"sport": "xc_skiing", "activities": 0.167, "duration": 1276}
],
"days": {
"monday": {
"frequency": 0.583, "activities": 0.667, "duration": 1563,
"sports": [
{"sport": "cycling", "activities": 0.5, "duration": 1325,
"time_of_day": {"morning": 0.0, "afternoon": 0.083, "evening": 0.417}},
{"sport": "rowing", "activities": 0.167, "duration": 238,
"time_of_day": {"morning": 0.0, "afternoon": 0.0, "evening": 0.167}}
]
},
"tuesday": {
"frequency": 0.833, "activities": 1.0, "duration": 1948,
"sports": [
{"sport": "rowing", "activities": 0.5, "duration": 679,
"time_of_day": {"morning": 0.0, "afternoon": 0.0, "evening": 0.5}},
{"sport": "cycling", "activities": 0.333, "duration": 962,
"time_of_day": {"morning": 0.083, "afternoon": 0.0, "evening": 0.25}},
{"sport": "running", "activities": 0.083, "duration": 174,
"time_of_day": {"morning": 0.0, "afternoon": 0.083, "evening": 0.0}},
{"sport": "walking", "activities": 0.083, "duration": 133,
"time_of_day": {"morning": 0.0, "afternoon": 0.083, "evening": 0.0}}
]
},
"wednesday": {
"frequency": 0.417, "activities": 0.583, "duration": 1801,
"sports": [
{"sport": "cycling", "activities": 0.333, "duration": 781,
"time_of_day": {"morning": 0.083, "afternoon": 0.083, "evening": 0.167}},
{"sport": "walking", "activities": 0.167, "duration": 891,
"time_of_day": {"morning": 0.0, "afternoon": 0.167, "evening": 0.0}},
{"sport": "rowing", "activities": 0.083, "duration": 129,
"time_of_day": {"morning": 0.0, "afternoon": 0.0, "evening": 0.083}}
]
},
"thursday": {
"frequency": 0.75, "activities": 0.75, "duration": 1671,
"sports": [
{"sport": "cycling", "activities": 0.5, "duration": 1065,
"time_of_day": {"morning": 0.0, "afternoon": 0.167, "evening": 0.333}},
{"sport": "walking", "activities": 0.167, "duration": 516,
"time_of_day": {"morning": 0.083, "afternoon": 0.083, "evening": 0.0}},
{"sport": "rowing", "activities": 0.083, "duration": 90,
"time_of_day": {"morning": 0.0, "afternoon": 0.0, "evening": 0.083}}
]
}
}
}
Read the numbers¶
Every number is per week, counting only weeks with training. A week without any activity, such as a holiday or an illness, doesn't count. Because every number is divided by the same number of weeks, every level adds up to the level above it.
| Field | Meaning, per week |
|---|---|
training_days |
Days with at least one activity, from 0 to 7. |
activities |
Activities. |
duration |
Seconds of training, as a whole number. |
sports |
The same activities and duration for each root sport, most activities first. They add up to the week. |
days |
All seven weekdays, Monday first. They add up to the week. |
days.{weekday}.frequency |
How often the athlete trains on this weekday, from 0 (never) to 1 (every week). The seven values add up to training_days. |
days.{weekday}.activities, duration |
Activities and seconds of training on this weekday. |
days.{weekday}.sports |
The same for each sport done on this weekday, most activities first. They add up to the weekday. |
time_of_day |
That sport's activities on that weekday, by local start time: morning before 12:00, afternoon from 12:00 to 17:00, evening from 17:00. They add up to its activities. |
Two numbers are one division away:
- One activity's length:
duration / activities, for a sport in the week or on a weekday. Cycling on Monday above: 1325 / 0.5 = 2650 seconds, a 44-minute ride. - The training on a day the athlete trains:
duration / frequency, for a weekday. A weekday'sdurationcounts the weeks without training on that weekday as zero, so it is what the weekday adds to the week. Monday above: 1563 / 0.583 = 2681 seconds, about 45 minutes.
If activities is larger than frequency on a weekday, the athlete sometimes does more than one activity on that day.
Boundaries:
- A weekday the athlete never trains on has
frequency,activitiesanddurationof 0 and an emptysportslist. - Every sport the athlete did is listed, however rarely. A sport done once is
1 / weeks, such as 0.083. A sport that isn't listed on a weekday was never done on that weekday. sportis the root sport:cycling.roadandcycling+stationarycount ascycling.- An activity counts on the local weekday and at the local time it starts, with all its time, also when it ends after midnight.
- Duration is elapsed time, from start to end, pauses included.
- Recordings shorter than 5 minutes aren't counted.
- Values other than
durationhave three decimals. - The response doesn't say how many weeks it's based on. SweatStack can change the number of recent weeks it uses, and the numbers keep their meaning.
Plan a week from it¶
Say your app wants to schedule two rides and a row next week. With the response above:
- Rank the weekdays by
activitiesforcycling. Monday and Thursday are highest, at 0.5 each. - Rank the weekdays by
activitiesforrowing. Tuesday is highest, at 0.5. - Pick the time of day with the largest value. All three are in the evening.
- Divide
durationbyactivitiesfor the length. The rides are 44 and 35 minutes, the row 22 minutes. - Keep the weekday with the lowest
frequencyfree. Wednesday is at 0.417, the likeliest rest day.
Errors¶
422withcodeinsufficient_data: fewer than 4 recent weeks have an activity, so there's no typical week yet. A new athlete gets this. Ask the athlete how they train, or call again once they have trained in 4 different weeks.