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

# Batch Calendar Returns

> Latest (or ?year) calendar-year return for up to batch_max_codes funds in one call.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/calendar-returns/batch
openapi: 3.1.0
info:
  title: Fruit Stand Fund Returns API
  description: Trailing and calendar-year total returns for US mutual funds and ETFs.
  version: 1.0.0
servers:
  - url: https://api.fruitstand.dev
    description: Production
security:
  - apiKey: []
tags:
  - name: Meta
    description: Service liveness and data-freshness checks. No API key required.
  - name: Funds
    description: >-
      Search the universe of ~32,000 US mutual funds and ETFs and fetch fund
      metadata by ticker.
  - name: Returns
    description: >-
      Trailing total returns (1d through 20y, plus YTD and since-inception) and
      calendar-year returns — for a single fund or batched across many in one
      call.
paths:
  /v1/calendar-returns/batch:
    post:
      tags:
        - Returns
      summary: Batch Calendar Returns
      description: >-
        Latest (or ?year) calendar-year return for up to batch_max_codes funds
        in one call.
      operationId: batchCalendarReturns
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CalendarBatchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CalendarYearReturns'
                type: array
                title: Response Batchcalendarreturns
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CalendarBatchRequest:
      properties:
        codes:
          items:
            type: string
          type: array
          minItems: 1
          title: Codes
          description: Bare tickers, e.g. ['SPY', 'QQQ'].
        market:
          type: string
          title: Market
          description: >-
            Market/exchange code for the funds. Defaults to US; informational
            and does not affect lookups (codes are bare tickers). Reserved for
            future multi-market support.
          default: US
        year:
          anyOf:
            - type: integer
            - type: 'null'
          title: Year
          description: Return each fund's row for this year. Omit for each fund's latest.
      type: object
      required:
        - codes
      title: CalendarBatchRequest
    CalendarYearReturns:
      properties:
        code:
          type: string
          title: Code
          description: Bare ticker, e.g. SPY.
        market:
          type: string
          title: Market
          description: Market/exchange code. Always US for now.
          default: US
        calendar_year:
          type: integer
          title: Calendar Year
        base_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Base Date
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
        calendar_year_return:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Calendar Year Return
      type: object
      required:
        - code
        - calendar_year
      title: CalendarYearReturns
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Your Fruit Stand API key from app.fruitstand.dev.

````