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

# Calories Basal

<Card title="View Full Response Schema »" icon="diamond-turn-right" iconType="sharp-solid" color="#F3A712" href="https://api.tryvital.io/redoc#tag/timeseries/operation/get_calories_basal_grouped">
  The Response section on the page still needs work. Click here to check out the complete schema.
</Card>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
       --url {{BASE_URL}}/v2/timeseries/{user_id}/calories_basal/grouped?start_date={{START_DATE}}&end_date={{END_DATE}} \
       --header 'Accept: application/json' \
       --header 'x-vital-api-key: <API_KEY>'
  ```

  ```python Python theme={null}
  from vital.client import Vital
  from vital.environment import VitalEnvironment

  client = Vital(
    api_key="YOUR_API_KEY",
    environment=VitalEnvironment.SANDBOX
  )

  data = client.vitals.calories_basal_grouped(
    user_id="<user_id>", 
    start_date="2021-10-01", 
    end_date="2021-10-02"
  )
  ```

  ```javascript Node theme={null}
  import { VitalClient, VitalEnvironment } from '@tryvital/vital-node';
  import { VitalsCaloriesBasalGroupedRequest } from '@tryvital/vital-node/api/resources/vitals';

  const client = new VitalClient({
      apiKey: '<my_api_key>',
      environment: VitalEnvironment.Sandbox,
  });

  const request: VitalsCaloriesBasalGroupedRequest = {
      startDate: "2022-05-01",
      endDate: "2022-06-01"
  }

  const data = await client.vitals.caloriesBasalGrouped(
      '<my_user_id>',
      request
  );
  ```

  ```java Java theme={null}
  import com.vital.api.Vital;
  import com.vital.api.core.Environment;
  import com.vital.api.resources.vitals.requests.VitalsCaloriesBasalGroupedRequest;

  Vital vital = Vital.builder()
          .apiKey("YOUR_API_KEY")
          .environment(Environment.SANDBOX)
          .build();

  VitalsCaloriesBasalGroupedRequest request = VitalsCaloriesBasalGroupedRequest.builder()
          .startDate("2022-05-01")
          .endDate("2022-06-01")
          .build();

  var data = vital.vitals().caloriesBasalGrouped("<user_id>", request);
  ```

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

    vital "github.com/tryVital/vital-go"
    vitalclient "github.com/tryVital/vital-go/client"
  )

  client := vitalclient.NewClient(
    vitalclient.WithApiKey("<YOUR_API_KEY>"),
    vitalclient.WithBaseURL(vital.Environments.Sandbox),
  )

  EndDate := "2022-06-01"
  request := &vital.VitalsCaloriesBasalGroupedRequest{
    StartDate: "2022-05-01",
    EndDate:   &EndDate,
  }

  response, err := client.Vitals.CaloriesBasalGrouped(context.TODO(), "*", request)
  if err != nil {
    return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>

<ResponseExample>
  ```json Example theme={null}
  {
    "groups": {
      "oura": [
        {
          "data": [
            {
              "end": "2023-02-13T14:57:24+00:00",
              "start": "2023-02-13T14:30:52+00:00",
              "unit": "kcal",
              "value": 22.8
            }
          ],
          "source": {
            "provider": "oura",
            "type": "ring"
          }
        }
      ]
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v2/timeseries/{user_id}/calories_basal/grouped
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.483
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/{user_id}/calories_basal/grouped:
    get:
      tags:
        - timeseries
      summary: Calories Basal
      operationId: get_calories_basal_grouped
      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: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The cursor for fetching the next page, or `null` to fetch the
              first page.
            deprecated: true
            title: Cursor
          description: >-
            The cursor for fetching the next page, or `null` to fetch the first
            page.
          deprecated: true
        - name: next_cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Next Cursor
            description: >-
              The cursor for fetching the next page, or `null` to fetch the
              first page.
          description: >-
            The cursor for fetching the next page, or `null` to fetch the first
            page.
        - name: provider
          in: query
          required: false
          schema:
            type: string
            description: Provider oura/strava etc
            default: ''
            title: Provider
          description: Provider oura/strava etc
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            description: >-
              Date from in YYYY-MM-DD or ISO formatted date time. If a date is
              provided without a time, the time will be set to 00:00:00
            title: Start Date
          description: >-
            Date from in YYYY-MM-DD or ISO formatted date time. If a date is
            provided without a time, the time will be set to 00:00:00
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Date to YYYY-MM-DD or ISO formatted date time. If a date is
              provided without a time, the time will be set to 23:59:59
            title: End Date
          description: >-
            Date to YYYY-MM-DD or ISO formatted date time. If a date is provided
            without a time, the time will be set to 23:59:59
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupedCaloriesBasalResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GroupedCaloriesBasalResponse:
      properties:
        groups:
          additionalProperties:
            items:
              $ref: '#/components/schemas/GroupedCaloriesBasal'
            type: array
          type: object
          title: Groups
          description: >-
            For each matching provider or lab, a list of grouped timeseries
            values.
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
          description: >-
            The cursor for fetching the next page, or `null` if there is no more
            data.
          deprecated: true
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            The cursor for fetching the next page, or `null` if there is no more
            data.
      type: object
      required:
        - groups
      title: GroupedCaloriesBasalResponse
      example:
        groups:
          oura:
            - data:
                - end: '2023-02-13T14:57:24+00:00'
                  start: '2023-02-13T14:30:52+00:00'
                  unit: kcal
                  value: 22.8
              source:
                provider: oura
                type: ring
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    GroupedCaloriesBasal:
      properties:
        source:
          $ref: '#/components/schemas/ClientFacingSource'
        data:
          items:
            $ref: '#/components/schemas/ClientFacingCaloriesBasalTimeseries'
          type: array
      type: object
      required:
        - source
        - data
      title: GroupedCaloriesBasal
    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
    ClientFacingCaloriesBasalTimeseries:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: Deprecated
        timezone_offset:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timezone Offset
          description: >-
            Time zone UTC offset in seconds. Positive offset indicates east of
            UTC; negative offset indicates west of UTC; and null indicates the
            time zone information is unavailable at source.
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: Type is always null for this resource.
        unit:
          type: string
          const: kcal
          title: Unit
          description: Measured in kilocalories (kcal)
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: The timestamp of the measurement.
        value:
          type: number
          title: Value
          description: Basal Metabolic Rate at the time or interval::kilocalories
      type: object
      required:
        - unit
        - timestamp
        - value
      title: ClientFacingCaloriesBasalTimeseries
      example:
        end: '2023-02-13T14:57:24+00:00'
        start: '2023-02-13T14:30:52+00:00'
        unit: kcal
        value: 22.8
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````