> ## 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 Trailing Returns

> Latest (or ?as_of) trailing returns for up to batch_max_codes funds in one call.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/trailing-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/trailing-returns/batch:
    post:
      tags:
        - Returns
      summary: Batch Trailing Returns
      description: >-
        Latest (or ?as_of) trailing returns for up to batch_max_codes funds in
        one call.
      operationId: batchTrailingReturns
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrailingBatchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TrailingReturns'
                type: array
                title: Response Batchtrailingreturns
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TrailingBatchRequest:
      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
        as_of:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: As Of
          description: >-
            As-of date for every fund. Non-trading days snap back to each fund's
            nearest prior trading day. Omit for each fund's latest.
      type: object
      required:
        - codes
      title: TrailingBatchRequest
    TrailingReturns:
      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
        as_of_date:
          type: string
          format: date
          title: As Of Date
        return_1d:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 1D
        return_1w:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 1W
        return_1m:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 1M
        return_3m:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 3M
        return_6m:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 6M
        return_ytd:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return Ytd
        return_1y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 1Y
        return_2y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 2Y
        return_3y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 3Y
        return_4y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 4Y
        return_5y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 5Y
        return_7y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 7Y
        return_10y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 10Y
        return_15y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 15Y
        return_20y:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return 20Y
        return_earliest_available:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Return Earliest Available
        extra_returns:
          additionalProperties:
            anyOf:
              - type: string
                pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
              - type: 'null'
          type: object
          title: Extra Returns
      type: object
      required:
        - code
        - as_of_date
      title: TrailingReturns
    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.

````