> ## 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 meal and nutrition summary data for a specific user from their connected tracking provider.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
       --url {{BASE_URL}}/v2/summary/meal/{user_id}?start_date={{START_DATE}}&end_date={{END_DATE}} \
       --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.meal.get(
      "<user_id>",
      start_date="2021-01-01",
      end_date="2021-01-02",
  )
  ```

  ```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.meal.get({
      userId: "<user_id>",
      startDate: "2021-01-01",
      endDate: "2021-01-02",
  });
  ```

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

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

  var data = client.meal().get(
      "<user_id>",
      GetMealRequest.builder()
          .startDate("2021-01-01")
          .endDate("2021-01-02")
          .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 := "2021-01-02"
  response, err := c.Meal.Get(context.TODO(), &junction.GetMealRequest{
      UserId:    "<user_id>",
      StartDate: "2021-01-01",
      EndDate:   &endDate,
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</RequestExample>


## OpenAPI

````yaml GET /v2/summary/meal/{user_id}
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/summary/meal/{user_id}:
    get:
      tags:
        - summary
      summary: Get Meals
      description: Get user's meals
      operationId: get_meals_v2_summary_meal__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: 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/ClientFacingMealResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ClientFacingMealResponse:
      properties:
        meals:
          items:
            $ref: '#/components/schemas/MealInDBBase_ClientFacingSource_'
          type: array
          title: Meals
      type: object
      required:
        - meals
      title: ClientFacingMealResponse
      example:
        meals:
          - calendar_date: '2019-08-24'
            created_at: '2023-02-27T20:31:24+00:00'
            data:
              Chiken coquet starter:
                energy:
                  unit: kcal
                  value: 400
                macros:
                  carbs: 75
                  fats:
                    monounsaturated: 1
                    omega3: 0
                    omega6: 0
                    polyunsaturated: 1
                    saturated: 98
                    total: 100
                  protein: 10
                  sugar: 25
                micros:
                  minerals:
                    sodium: 500
              Coffee, black, 1 tbsp(s):
                energy:
                  unit: kcal
                  value: 0
                macros:
                  carbs: 0
                  fats:
                    total: 0
                  protein: 0
                  sugar: 0
                micros:
                  minerals:
                    sodium: 0
            id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
            name: Dinner
            priority_id: 42
            provider_id: '123456'
            source:
              app_id: com.myfitnesspal.mfp
              device_id: 550e8400-e29b-41d4-a716-446655440000
              provider: apple_health_kit
              type: unknown
            source_app_id: com.myfitnesspal.mfp
            source_id: 10
            timestamp: '2019-08-24T00:00:00Z'
            updated_at: '2023-02-28T01:22:38+00:00'
            user_id: a169451c-8525-4352-b8ca-070dd449a1a5
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    MealInDBBase_ClientFacingSource_:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          type: string
          format: uuid
          title: User Id
        priority_id:
          type: integer
          title: Priority Id
          description: This value has no meaning.
          deprecated: true
        source_id:
          type: integer
          title: Source Id
          description: This value has no meaning.
          deprecated: true
        provider_id:
          type: string
          title: Provider Id
          description: This value is identical to `id`.
          deprecated: true
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        calendar_date:
          type: string
          format: date
          title: Calendar Date
          description: >-
            Date of the meal in the YYYY-mm-dd format. For providers that only
            expose a date, this is the calendar date as recorded by the user.
        name:
          type: string
          title: Name
        energy:
          anyOf:
            - $ref: '#/components/schemas/Energy'
            - type: 'null'
        macros:
          anyOf:
            - $ref: '#/components/schemas/Macros'
            - type: 'null'
        micros:
          anyOf:
            - $ref: '#/components/schemas/Micros'
            - type: 'null'
        data:
          additionalProperties:
            $ref: '#/components/schemas/ClientFacingFood'
          type: object
          title: Data
          default: {}
        source:
          $ref: '#/components/schemas/ClientFacingSource'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        source_app_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source App Id
        source_device_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Source Device Id
      type: object
      required:
        - id
        - user_id
        - priority_id
        - source_id
        - provider_id
        - timestamp
        - calendar_date
        - name
        - energy
        - macros
        - micros
        - source
        - created_at
        - updated_at
      title: MealInDBBase[ClientFacingSource]
      example:
        calendar_date: '2019-08-24'
        created_at: '2023-02-27T20:31:24+00:00'
        data:
          Chiken coquet starter:
            energy:
              unit: kcal
              value: 400
            macros:
              carbs: 75
              fats:
                monounsaturated: 1
                omega3: 0
                omega6: 0
                polyunsaturated: 1
                saturated: 98
                total: 100
              protein: 10
              sugar: 25
            micros:
              minerals:
                sodium: 500
          Coffee, black, 1 tbsp(s):
            energy:
              unit: kcal
              value: 0
            macros:
              carbs: 0
              fats:
                total: 0
              protein: 0
              sugar: 0
            micros:
              minerals:
                sodium: 0
        id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
        name: Dinner
        priority_id: 42
        provider_id: '123456'
        source:
          app_id: com.myfitnesspal.mfp
          device_id: 550e8400-e29b-41d4-a716-446655440000
          provider: apple_health_kit
          type: unknown
        source_app_id: com.myfitnesspal.mfp
        source_id: 10
        timestamp: '2019-08-24T00:00:00Z'
        updated_at: '2023-02-28T01:22:38+00:00'
        user_id: a169451c-8525-4352-b8ca-070dd449a1a5
    Energy:
      properties:
        unit:
          type: string
          const: kcal
          title: Unit
        value:
          type: number
          title: Value
      type: object
      required:
        - unit
        - value
      title: Energy
    Macros:
      properties:
        carbs:
          anyOf:
            - type: number
            - type: 'null'
          title: Carbs
          description: Amount of carbohydrates in grams (g)
        protein:
          anyOf:
            - type: number
            - type: 'null'
          title: Protein
          description: Amount of protein in grams (g)
        fats:
          $ref: '#/components/schemas/Fats'
          description: Details of fat content
        alcohol:
          anyOf:
            - type: number
            - type: 'null'
          title: Alcohol
          description: Amount of alcohol in grams (g)
        water:
          anyOf:
            - type: number
            - type: 'null'
          title: Water
          description: Amount of water in grams (g)
        fibre:
          anyOf:
            - type: number
            - type: 'null'
          title: Fibre
          description: Amount of dietary fiber in grams (g)
        sugar:
          anyOf:
            - type: number
            - type: 'null'
          title: Sugar
          description: Amount of sugar in grams (g)
        cholesterol:
          anyOf:
            - type: number
            - type: 'null'
          title: Cholesterol
          description: Amount of cholesterol in grams (g)
      type: object
      title: Macros
    Micros:
      properties:
        minerals:
          anyOf:
            - additionalProperties:
                type: number
              propertyNames:
                $ref: '#/components/schemas/Minerals'
              type: object
            - type: 'null'
          title: Minerals
          description: >-
            Amount of each mineral in their respective units. Most minerals are
            measured in mg (milligrams), while sodium and potassium are in g
            (grams).
        trace_elements:
          anyOf:
            - additionalProperties:
                type: number
              propertyNames:
                $ref: '#/components/schemas/TraceElements'
              type: object
            - type: 'null'
          title: Trace Elements
          description: >-
            Amount of each trace element in their respective units, most
            measured in μg (micrograms), while copper and manganese are in mg
            (milligrams).
        vitamins:
          anyOf:
            - additionalProperties:
                type: number
              propertyNames:
                $ref: '#/components/schemas/Vitamins'
              type: object
            - type: 'null'
          title: Vitamins
          description: >-
            Amount of each vitamin in their respective units. A, B12, D and K in
            μg (micrograms), while B1, B2, B3, B5, B6, C and folic acid are in
            mg (milligrams).
      type: object
      title: Micros
    ClientFacingFood:
      properties:
        energy:
          anyOf:
            - $ref: '#/components/schemas/Energy'
            - type: 'null'
        macros:
          anyOf:
            - $ref: '#/components/schemas/Macros'
            - type: 'null'
        micros:
          anyOf:
            - $ref: '#/components/schemas/Micros'
            - type: 'null'
      type: object
      title: ClientFacingFood
    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
    Fats:
      properties:
        saturated:
          anyOf:
            - type: number
            - type: 'null'
          title: Saturated
          description: Amount of saturated fats in grams (g)
        monounsaturated:
          anyOf:
            - type: number
            - type: 'null'
          title: Monounsaturated
          description: Amount of monounsaturated fats in grams (g)
        polyunsaturated:
          anyOf:
            - type: number
            - type: 'null'
          title: Polyunsaturated
          description: Amount of polyunsaturated fats in grams (g)
        omega3:
          anyOf:
            - type: number
            - type: 'null'
          title: Omega3
          description: Amount of Omega-3 fatty acids in grams (g)
        omega6:
          anyOf:
            - type: number
            - type: 'null'
          title: Omega6
          description: Amount of Omega-6 fatty acids in grams (g)
        total:
          anyOf:
            - type: number
            - type: 'null'
          title: Total
          description: Total amount of fats in grams (g)
      type: object
      title: Fats
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````