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

# Get investment holdings

> Get investment holdings grouped by asset class.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/yoshi/openapi.documented.yml get /investments
openapi: 3.1.0
info:
  title: Yoshi API
  version: 1.0.0
  description: Consumer API for accessing your Yoshi financial data programmatically.
servers:
  - url: https://api.yoshi.ai/v1
    description: Production
  - url: https://staging-api.yoshi.ai/v1
    description: Staging
security:
  - bearerAuth: []
paths:
  /investments:
    get:
      tags:
        - Investments
      summary: Get investment holdings
      description: Get investment holdings grouped by asset class.
      operationId: listInvestments
      parameters:
        - schema:
            type: string
            format: uuid
          required: false
          name: account_id
          in: query
        - schema:
            type: string
            description: Filter by asset class
          required: false
          description: Filter by asset class
          name: category
          in: query
        - schema:
            type: string
            enum:
              - symbol
              - last_price
              - day_change
              - total_gain_loss
              - current_value
              - quantity
              - cost_basis_total
          required: false
          name: sort_by
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
          required: false
          name: sort_dir
          in: query
      responses:
        '200':
          description: Investment holdings retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      groups:
                        type: array
                        items:
                          type: object
                          properties:
                            asset_class:
                              type:
                                - string
                                - 'null'
                            holdings:
                              type: array
                              items:
                                type: object
                                properties:
                                  security_id:
                                    type: string
                                  symbol:
                                    type:
                                      - string
                                      - 'null'
                                  name:
                                    type:
                                      - string
                                      - 'null'
                                  security_type:
                                    type:
                                      - string
                                      - 'null'
                                  asset_class:
                                    type:
                                      - string
                                      - 'null'
                                  category:
                                    type:
                                      - string
                                      - 'null'
                                  last_price:
                                    type:
                                      - number
                                      - 'null'
                                  last_price_at:
                                    type:
                                      - string
                                      - 'null'
                                  day_change:
                                    type:
                                      - number
                                      - 'null'
                                  day_change_percent:
                                    type:
                                      - number
                                      - 'null'
                                  total_gain_loss:
                                    type:
                                      - number
                                      - 'null'
                                  total_gain_loss_percent:
                                    type:
                                      - number
                                      - 'null'
                                  current_value:
                                    type: number
                                  percent_of_account:
                                    type: number
                                  quantity:
                                    type: number
                                  average_cost_basis:
                                    type:
                                      - number
                                      - 'null'
                                  cost_basis_total:
                                    type:
                                      - number
                                      - 'null'
                                required:
                                  - security_id
                                  - symbol
                                  - name
                                  - security_type
                                  - asset_class
                                  - category
                                  - last_price
                                  - last_price_at
                                  - day_change
                                  - day_change_percent
                                  - total_gain_loss
                                  - total_gain_loss_percent
                                  - current_value
                                  - percent_of_account
                                  - quantity
                                  - average_cost_basis
                                  - cost_basis_total
                          required:
                            - asset_class
                            - holdings
                      account_total:
                        type: object
                        properties:
                          current_value:
                            type: number
                          day_change:
                            type: number
                          day_change_percent:
                            type:
                              - number
                              - 'null'
                          total_gain_loss:
                            type: number
                          total_gain_loss_percent:
                            type:
                              - number
                              - 'null'
                          cost_basis_total:
                            type: number
                        required:
                          - current_value
                          - day_change
                          - day_change_percent
                          - total_gain_loss
                          - total_gain_loss_percent
                          - cost_basis_total
                    required:
                      - groups
                      - account_total
                  meta:
                    type: object
                    properties:
                      request_id:
                        type: string
                        example: req_a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      timestamp:
                        type: string
                        format: date-time
                        example: '2026-04-10T12:00:00.000Z'
                    required:
                      - request_id
                      - timestamp
                required:
                  - data
                  - meta
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Yoshi from '@yoshi-ai/sdk';

            const client = new Yoshi({
              apiKey: process.env['YOSHI_API_KEY'], // This is the default and can be omitted
            });

            const investments = await client.investments.list();

            console.log(investments.data);
        - lang: Python
          source: |-
            import os
            from yoshi_sdk import Yoshi

            client = Yoshi(
                api_key=os.environ.get("YOSHI_API_KEY"),  # This is the default and can be omitted
            )
            investments = client.investments.list()
            print(investments.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/yoshi-ai-dev/yoshi-go\"\n\t\"github.com/yoshi-ai-dev/yoshi-go/option\"\n)\n\nfunc main() {\n\tclient := yoshi.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tinvestments, err := client.Investments.List(context.TODO(), yoshi.InvestmentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", investments.Data)\n}\n"
        - lang: CLI
          source: |-
            yoshi investments list \
              --api-key 'My API Key'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Yoshi API key from Settings → API Keys, or a Yoshi OAuth access token
        issued by Sign in with Yoshi.
      x-default: yoshi_test_...

````