curl --request GET \
--url https://api.example.com/api/v1/users/{user_id}/events/workouts/totals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/users/{user_id}/events/workouts/totals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/users/{user_id}/events/workouts/totals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/users/{user_id}/events/workouts/totals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/users/{user_id}/events/workouts/totals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/users/{user_id}/events/workouts/totals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/users/{user_id}/events/workouts/totals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 42,
"duration_seconds": 95400,
"calories_kcal": 18250.5,
"distance_meters": 212400
}{
"code": "VALIDATION_ERROR",
"detail": "body.email: value is not a valid email address: An email address must have an @-sign. (and 1 more)",
"errors": [
{
"loc": [
"body",
"email"
],
"msg": "value is not a valid email address: An email address must have an @-sign.",
"type": "value_error"
},
{
"loc": [
"body",
"first_name"
],
"msg": "String should have at most 100 characters",
"type": "string_too_long"
}
],
"status": 422,
"title": "Unprocessable Content"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}Get Workout Totals
Returns the count, duration, energy and distance of the workouts the same filters would list.
Added up in the database, so it covers every matching workout however many there are, without paging through them.
curl --request GET \
--url https://api.example.com/api/v1/users/{user_id}/events/workouts/totals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/users/{user_id}/events/workouts/totals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/users/{user_id}/events/workouts/totals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/users/{user_id}/events/workouts/totals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/users/{user_id}/events/workouts/totals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/users/{user_id}/events/workouts/totals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/users/{user_id}/events/workouts/totals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"count": 42,
"duration_seconds": 95400,
"calories_kcal": 18250.5,
"distance_meters": 212400
}{
"code": "VALIDATION_ERROR",
"detail": "body.email: value is not a valid email address: An email address must have an @-sign. (and 1 more)",
"errors": [
{
"loc": [
"body",
"email"
],
"msg": "value is not a valid email address: An email address must have an @-sign.",
"type": "value_error"
},
{
"loc": [
"body",
"first_name"
],
"msg": "String should have at most 100 characters",
"type": "string_too_long"
}
],
"status": 422,
"title": "Unprocessable Content"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}Authorizations
Query Parameters
Exact normalized workout type. Unlike record_type, does not substring-match.
Unified workout/activity types for Polar, Suunto, and Garmin.
Based on FIT SDK sport types and common activities across platforms. Excludes branded/niche activities (e.g., LES MILLS classes, specific dance types).
running, trail_running, treadmill, walking, hiking, mountaineering, cycling, mountain_biking, indoor_cycling, cyclocross, swimming, pool_swimming, open_water_swimming, strength_training, cardio_training, fitness_equipment, elliptical, rowing_machine, stair_climbing, yoga, pilates, stretching, meditation, cross_country_skiing, alpine_skiing, backcountry_skiing, downhill_skiing, snowboarding, snowshoeing, ice_skating, snowmobiling, winter_sports, snow_sports, rowing, kayaking, canoeing, paddling, stand_up_paddleboarding, surfing, kitesurfing, windsurfing, sailing, water_polo, wakeboarding, water_skiing, boating, water_sports, soccer, basketball, football, american_football, baseball, tennis, badminton, volleyball, handball, rugby, hockey, floorball, lacrosse, cricket, squash, table_tennis, padel, pickleball, racquetball, racket_sports, boxing, martial_arts, wrestling, fencing, rock_climbing, indoor_climbing, bouldering, trail_hiking, orienteering, archery, fishing, hunting, paragliding, parkour, golf, skating, inline_skating, skateboarding, horseback_riding, gymnastics, bowling, curling, disc_sports, triathlon, multisport, motorcycling, motor_sports, dance, aerobics, group_exercise, e_biking, virtual_activity, diving, snorkeling, walking_fitness, casual_walking, transition, team_sports, para_sports, play, wheelchair, recovery, gaming, chores, lifestyle, work, operations, generic, other, sport all returns every source's sessions. per_session drops a session when the sessions of one source ranked higher by provider, then device type priority, cover at least SESSION_DUPLICATE_OVERLAP of it (default 0.5); sessions nothing better covers stay, and equally ranked sources never hide each other. Source filters narrow which sessions compete. Defaults to all.
all, per_session Response
Successful Response
Workouts matching a filter, added up in the database rather than paged.
Was this page helpful?