> ## Documentation Index
> Fetch the complete documentation index at: https://openwearables.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /openapi.json get /api/v1/users/{user_id}/events/workouts/totals
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.9.0
servers: []
security: []
paths:
  /api/v1/users/{user_id}/events/workouts/totals:
    get:
      tags:
        - 'External: Events'
      summary: Get Workout Totals
      description: >-
        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.
      operationId: get_workout_totals_api_v1_users__user_id__events_workouts_totals_get
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            description: >-
              ISO 8601 datetime (e.g. `2023-11-07T05:31:56Z`) or Unix timestamp
              in seconds. Date-only strings (e.g. `2023-11-07`) are also
              accepted and cover the whole day, so a date-only range includes
              both boundary days.
            examples:
              - '2023-11-07T05:31:56Z'
              - '2023-11-07'
            format: date-time
            title: Start Date
          description: >-
            ISO 8601 datetime (e.g. `2023-11-07T05:31:56Z`) or Unix timestamp in
            seconds. Date-only strings (e.g. `2023-11-07`) are also accepted and
            cover the whole day, so a date-only range includes both boundary
            days.
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            description: >-
              ISO 8601 datetime (e.g. `2023-11-07T05:31:56Z`) or Unix timestamp
              in seconds. Date-only strings (e.g. `2023-11-07`) are also
              accepted and cover the whole day, so a date-only range includes
              both boundary days.
            examples:
              - '2023-11-07T05:31:56Z'
              - '2023-11-07'
            format: date-time
            title: End Date
          description: >-
            ISO 8601 datetime (e.g. `2023-11-07T05:31:56Z`) or Unix timestamp in
            seconds. Date-only strings (e.g. `2023-11-07`) are also accepted and
            cover the whole day, so a date-only range includes both boundary
            days.
        - name: record_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Record Type
        - name: type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/WorkoutType'
              - type: 'null'
            description: >-
              Exact normalized workout type. Unlike `record_type`, does not
              substring-match.
            title: Type
          description: >-
            Exact normalized workout type. Unlike `record_type`, does not
            substring-match.
        - name: provider
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ProviderName'
              - type: 'null'
            title: Provider
        - name: source
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Source
        - name: device_model
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Device Model
        - name: data_source_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Data Source Id
        - name: X-Open-Wearables-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Open-Wearables-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkoutTotals'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    WorkoutType:
      type: string
      enum:
        - 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
      title: WorkoutType
      description: >-
        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).
    ProviderName:
      type: string
      enum:
        - apple
        - samsung
        - garmin
        - health_connect
        - google_health
        - polar
        - suunto
        - whoop
        - strava
        - oura
        - fitbit
        - ultrahuman
        - sensorbio
        - withings
        - unknown
        - internal
      title: ProviderName
      description: Supported data providers.
    WorkoutTotals:
      properties:
        count:
          type: integer
          title: Count
          description: Workouts that match the filters
          example: 42
        duration_seconds:
          type: integer
          title: Duration Seconds
          description: Sum of their durations
          example: 95400
        calories_kcal:
          anyOf:
            - type: number
            - type: 'null'
          title: Calories Kcal
          description: Sum of reported energy burned; null when none reported any
          example: 18250.5
        distance_meters:
          anyOf:
            - type: number
            - type: 'null'
          title: Distance Meters
          description: Sum of reported distance; null when none reported any
          example: 212400
      type: object
      required:
        - count
        - duration_seconds
      title: WorkoutTotals
      description: Workouts matching a filter, added up in the database rather than paged.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.