Skip to content

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 holds date isn'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's duration counts 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, activities and duration of 0 and an empty sports list.
  • 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.
  • sport is the root sport: cycling.road and cycling+stationary count as cycling.
  • 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 duration have 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:

  1. Rank the weekdays by activities for cycling. Monday and Thursday are highest, at 0.5 each.
  2. Rank the weekdays by activities for rowing. Tuesday is highest, at 0.5.
  3. Pick the time of day with the largest value. All three are in the evening.
  4. Divide duration by activities for the length. The rides are 44 and 35 minutes, the row 22 minutes.
  5. Keep the weekday with the lowest frequency free. Wednesday is at 0.417, the likeliest rest day.

Errors

  • 422 with code insufficient_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.