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

# Summary

> Retrieve electrocardiogram summary data for a specific user from their connected wearable provider.

<Note>
  The Electrocardiogram summary type does not embed the voltage measurements.

  Use the [Get Electrocardiogram Voltage](/api-reference/data/timeseries/electrocardiogram-voltage) endpoint
  with the `session_start` and `session_end` timestamps to query the voltage measurements.
</Note>

<RequestExample>
  ```bash Shell theme={null}
  curl --request GET \
       --url {{BASE_URL}}/v2/summary/electrocardiogram/{user_id} \
       --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.electrocardiogram.get(
      "<user_id>",
      start_date="2022-05-01",
      end_date="2022-06-01",
  )
  ```

  ```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.electrocardiogram.get({
      userId: "<user_id>",
      startDate: "2022-05-01",
      endDate: "2022-06-01",
  });
  ```

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

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

  var data = client.electrocardiogram().get(
      "<user_id>",
      GetElectrocardiogramRequest.builder()
          .startDate("2022-05-01")
          .endDate("2022-06-01")
          .build()
  );
  ```

  ```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),
  )

  endDate := "2022-06-01"
  response, err := c.Electrocardiogram.Get(context.TODO(), &junction.GetElectrocardiogramRequest{
      UserId:    "<user_id>",
      StartDate: "2022-05-01",
      EndDate:   &endDate,
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>


## OpenAPI

````yaml GET /v2/summary/electrocardiogram/{user_id}
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/summary/electrocardiogram/{user_id}:
    get:
      tags:
        - summary
      summary: Get User Electrocardiogram
      description: Get electrocardiogram summary for user_id
      operationId: get_user_electrocardiogram_v2_summary_electrocardiogram__user_id__get
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: >-
              User id returned by vital create user id request. This id should
              be stored in your database against the user and used for all
              interactions with the vital api.
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
            description: Start date in YYYY-MM-DD
            title: Start Date
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: End date (inclusive) in YYYY-MM-DD
            title: End Date
        - name: provider
          in: query
          required: false
          schema:
            type: string
            description: Provider oura/strava etc
            default: ''
            title: Provider
          description: Provider oura/strava etc
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientFacingElectrocardiogramResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ClientFacingElectrocardiogramResponse:
      properties:
        electrocardiogram:
          items:
            $ref: '#/components/schemas/ClientFacingElectrocardiogram'
          type: array
          title: Electrocardiogram
      type: object
      required:
        - electrocardiogram
      title: Electrocardiogram Data
      example:
        electrocardiogram:
          - classification: sinus_rhythm
            created_at: '2023-02-27T20:31:24+00:00'
            heart_rate_mean: 73
            id: f1b3b3b3-1b3b-1b3b-1b3b-1b3b3b3b3b3b
            sampling_frequency_hz: 505
            session_end: '2022-01-01T08:00:00'
            session_start: '2022-01-01T00:00:00'
            source:
              device_id: 550e8400-e29b-41d4-a716-446655440000
              provider: apple_health_kit
              type: watch
            source_provider: oura
            source_type: ring
            time_zone: America/Los_Angeles
            updated_at: '2023-02-28T01:22:38+00:00'
            user_id: f1b3b3b3-1b3b-1b3b-1b3b-1b3b3b3b3b3b
            voltage_sample_count: 1600
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    ClientFacingElectrocardiogram:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        session_start:
          type: string
          format: date-time
          title: Session Start
        session_end:
          type: string
          format: date-time
          title: Session End
        voltage_sample_count:
          type: integer
          title: Voltage Sample Count
        heart_rate_mean:
          anyOf:
            - type: integer
            - type: 'null'
          title: Heart Rate Mean
        sampling_frequency_hz:
          anyOf:
            - type: number
            - type: 'null'
          title: Sampling Frequency Hz
        classification:
          anyOf:
            - type: string
              enum:
                - sinus_rhythm
                - atrial_fibrillation
                - inconclusive
            - type: 'null'
          title: Classification
          description: ℹ️ This enum is non-exhaustive.
        inconclusive_cause:
          anyOf:
            - type: string
              enum:
                - high_heart_rate
                - low_heart_rate
                - poor_reading
            - type: 'null'
          title: Inconclusive Cause
          description: ℹ️ This enum is non-exhaustive.
        algorithm_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Algorithm Version
        time_zone:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Zone
        source_provider:
          anyOf:
            - $ref: '#/components/schemas/Providers'
            - $ref: '#/components/schemas/Labs'
          title: Source Provider
          description: ℹ️ This enum is non-exhaustive.
        source_type:
          type: string
          enum:
            - unknown
            - phone
            - watch
            - app
            - multiple_sources
            - fingerprick
            - cuff
            - manual_scan
            - automatic
            - insulin_pump
            - scale
            - chest_strap
            - ring
            - lab
            - exercise_machine
            - earphone
          title: Source Type
          description: ℹ️ This enum is non-exhaustive.
        source_app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source App Id
        source_device_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Device Model
        source_device_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Source Device Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        user_id:
          type: string
          format: uuid
          title: User Id
        source:
          $ref: '#/components/schemas/ClientFacingSource'
      type: object
      required:
        - id
        - session_start
        - session_end
        - voltage_sample_count
        - source_provider
        - source_type
        - user_id
        - source
        - created_at
        - updated_at
      title: Electrocardiogram
      example:
        classification: sinus_rhythm
        created_at: '2023-02-27T20:31:24+00:00'
        heart_rate_mean: 73
        id: f1b3b3b3-1b3b-1b3b-1b3b-1b3b3b3b3b3b
        sampling_frequency_hz: 505
        session_end: '2022-01-01T08:00:00'
        session_start: '2022-01-01T00:00:00'
        source:
          device_id: 550e8400-e29b-41d4-a716-446655440000
          provider: apple_health_kit
          type: watch
        source_provider: oura
        source_type: ring
        time_zone: America/Los_Angeles
        updated_at: '2023-02-28T01:22:38+00:00'
        user_id: f1b3b3b3-1b3b-1b3b-1b3b-1b3b3b3b3b3b
        voltage_sample_count: 1600
    Providers:
      type: string
      enum:
        - oura
        - fitbit
        - garmin
        - whoop
        - strava
        - renpho
        - peloton
        - wahoo
        - zwift
        - freestyle_libre
        - abbott_libreview
        - tandem_source
        - freestyle_libre_ble
        - eight_sleep
        - withings
        - apple_health_kit
        - manual
        - ihealth
        - google_fit
        - beurer_api
        - beurer_ble
        - omron
        - omron_ble
        - onetouch_ble
        - accuchek_ble
        - contour_ble
        - dexcom
        - dexcom_v3
        - hammerhead
        - my_fitness_pal
        - health_connect
        - samsung_health
        - polar
        - cronometer
        - kardia
        - whoop_v2
        - ultrahuman
        - my_fitness_pal_v2
        - map_my_fitness
        - runkeeper
      title: Providers
      description: ℹ️ This enum is non-exhaustive.
    Labs:
      type: string
      enum:
        - ayumetrix
        - spiriplex
        - ussl
        - quest
        - sonora_quest
        - labcorp
        - bioreference
        - us_biotek
        - manual
        - sanocardio
        - ihd
        - nexus
        - my_uti
        - crl
      title: Labs
      description: ℹ️ This enum is non-exhaustive.
    ClientFacingSource:
      properties:
        provider:
          type: string
          title: Provider
          description: Provider slug. e.g., `oura`, `fitbit`, `garmin`.
        type:
          type: string
          title: Type
          description: >-
            The type of the data source (app or device) by which the summary or
            the timeseries data were recorded. This defaults to `unknown` when
            Vital cannot extract or infer that information
          default: unknown
        app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: App Id
          description: >-
            The identifier of the app which recorded this summary. This is only
            applicable to multi-source providers like Apple Health and Android
            Health Connect.
        device_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Device Id
          description: The identifier of the device which recorded this summary.
        sport:
          anyOf:
            - type: string
            - type: 'null'
          title: Sport
          description: >

            For workout stream timeseries, this is the standard sport slug of
            the workout with which the timeseries data are associated.


            For the `distance` timeseries, this is `wheelchair_pushing` if the
            user is a wheelchair user, or `null` otherwise.


            For all summary types and non-workout timeseries, this is always
            `null`.
        workout_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Workout Id
          description: >

            For workout stream timeseries, this is the workout ID with which the
            timeseries data are associated.


            For all other types, this is always `null`.
        name:
          type: string
          title: Name
          description: Deprecated. Subject to removal after 1 Jan 2024.
          default: ''
          deprecated: true
        slug:
          type: string
          title: Slug
          description: >-
            Deprecated. Use `provider` instead. Subject to removal after 1 Jan
            2024.
          default: ''
          deprecated: true
        logo:
          type: string
          title: Logo
          description: Deprecated. Subject to removal after 1 Jan 2024.
          default: ''
          deprecated: true
      type: object
      required:
        - provider
      title: Source
      description: |-
        Source summarizes where a sample or a summary is sourced from.
        At minimum, the source provider is always included.
      example:
        provider: oura
        type: ring
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````