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

# Stream

> Retrieve timeseries workouts stream via the Junction API. Requires authentication with your team API key.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
       --url {{BASE_URL}}/v2/summary/workouts/{workout_id}/stream \
       --header 'Accept: application/json' \
       --header 'x-vital-api-key: <API_KEY>'
  ```

  ```python Python theme={null}
  from junction import Junction
  from junction.environment import JunctionEnvironment

  client = Junction(
      api_key="YOUR_API_KEY",
      environment=JunctionEnvironment.SANDBOX,
  )

  data = client.workouts.get_by_workout_id("<workout_id>")
  ```

  ```typescript TypeScript theme={null}
  import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";

  const client = new JunctionClient({
      apiKey: "YOUR_API_KEY",
      environment: JunctionEnvironment.Sandbox,
  });

  const data = await client.workouts.getByWorkoutId({ workoutId: "<workout_id>" });
  ```

  ```java Java theme={null}
  import com.junction.api.Junction;
  import com.junction.api.core.Environment;

  Junction client = Junction.builder()
      .apiKey("YOUR_API_KEY")
      .environment(Environment.SANDBOX)
      .build();

  var data = client.workouts().getByWorkoutId("<workout_id>");
  ```

  ```go Go theme={null}
  import (
      "context"

      junction "github.com/junction-api/junction-go"
      "github.com/junction-api/junction-go/client"
      "github.com/junction-api/junction-go/option"
  )

  c := client.NewClient(
      option.WithApiKey("YOUR_API_KEY"),
      option.WithBaseURL(junction.Environments.Sandbox),
  )

  response, err := c.Workouts.GetByWorkoutId(context.TODO(), &junction.GetByWorkoutIdWorkoutsRequest{
      WorkoutId: "<workout_id>",
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>


## OpenAPI

````yaml GET /v2/timeseries/workouts/{workout_id}/stream
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.495
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v2/timeseries/workouts/{workout_id}/stream:
    get:
      tags:
        - timeseries
      summary: Get User Workouts
      operationId: get_user_workouts_v2_timeseries_workouts__workout_id__stream_get
      parameters:
        - name: workout_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The Vital ID for the workout
            title: Workout Id
          description: The Vital ID for the workout
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientFacingStream'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ClientFacingStream:
      properties:
        cadence:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Cadence
          description: RPM for cycling, Steps per minute for running
          default: []
        time:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Time
          description: Corresponding time stamp in unix time for datapoint
          default: []
        altitude:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Altitude
          description: Data points for altitude
          default: []
        velocity_smooth:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Velocity Smooth
          description: Velocity in m/s
          default: []
        heartrate:
          anyOf:
            - items:
                anyOf:
                  - type: integer
                  - type: 'null'
              type: array
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Heartrate
          description: Heart rate in bpm
          default: []
        lat:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Lat
          description: Latitude for data point
          default: []
        lng:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Lng
          description: Longitude for data point
          default: []
        distance:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Distance
          description: Cumulated distance for exercise
          default: []
        power:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Power
          description: Power in watts
          default: []
        resistance:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Resistance
          description: Resistance on bike
          default: []
        temperature:
          anyOf:
            - items:
                anyOf:
                  - type: number
                  - type: 'null'
              type: array
            - items:
                type: number
              type: array
            - type: 'null'
          title: Temperature
          description: Temperature stream measured by device in Celsius
          default: []
      type: object
      title: ClientFacingStream
      example:
        altitude:
          - 10
          - 20
          - 30
          - 40
          - 50
        cadence:
          - 10
          - 12
          - 12
          - 11
          - 10
        distance:
          - 12
          - 15
          - 18
          - 20
          - 25
        heartrate:
          - 120
          - 125
          - 125
          - 130
          - 135
        lat:
          - 10
          - 20
          - 30
          - 40
          - 50
        lng:
          - 10
          - 20
          - 30
          - 40
          - 50
        power:
          - 100
          - 100
          - 100
          - 100
          - 100
        resistance:
          - 10
          - 20
          - 30
          - 40
          - 50
        time:
          - 1626625123
          - 1626625140
          - 1626625145
          - 1626625150
          - 162662560
        velocity_smooth:
          - 10
          - 20
          - 30
          - 40
          - 50
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````