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

# List trade history

> List trade history for a Test Drive account with cursor-based pagination.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/yoshi/openapi.documented.yml get /paper-trading/accounts/{accountId}/trades
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:
  /paper-trading/accounts/{accountId}/trades:
    get:
      tags:
        - Test Drive
      summary: List trade history
      description: >-
        List trade history for a Test Drive account with cursor-based
        pagination.
      operationId: listTestDrives
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: accountId
          in: path
        - schema:
            type: string
            description: Opaque cursor from a previous response
          required: false
          description: Opaque cursor from a previous response
          name: cursor
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
            description: Items per page (1-100, default 50)
          required: false
          description: Items per page (1-100, default 50)
          name: limit
          in: query
      responses:
        '200':
          description: Trades retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type:
                            - string
                            - 'null'
                        subtype:
                          type:
                            - string
                            - 'null'
                        name:
                          type:
                            - string
                            - 'null'
                        symbol:
                          type:
                            - string
                            - 'null'
                        quantity:
                          type:
                            - number
                            - 'null'
                        price:
                          type:
                            - number
                            - 'null'
                        amount:
                          type:
                            - number
                            - 'null'
                        date:
                          type:
                            - string
                            - 'null'
                        created_at:
                          type:
                            - string
                            - 'null'
                      required:
                        - id
                        - type
                        - subtype
                        - name
                        - symbol
                        - quantity
                        - price
                        - amount
                        - date
                        - created_at
                  has_more:
                    type: boolean
                  cursor:
                    type:
                      - string
                      - 'null'
                    description: Opaque cursor for the next page, null if no more pages
                  count:
                    type: integer
                    description: Number of items in the current page
                  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
                  - has_more
                  - cursor
                  - count
                  - meta
        '404':
          description: Account not found.
      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 trades = await client.paperTrading.accounts.trades.list(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(trades.count);
        - 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
            )
            trades = client.paper_trading.accounts.trades.list(
                account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(trades.count)
        - 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\ttrades, err := client.PaperTrading.Accounts.Trades.List(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tyoshi.PaperTradingAccountTradeListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", trades.Count)\n}\n"
        - lang: CLI
          source: |-
            yoshi paper-trading:accounts:trades list \
              --api-key 'My API Key' \
              --account-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
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_...

````