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

# Get single product APY history

> Returns the 12h, 24h, 3d, 7d and 31d trailing APYs of an active top vault over time, sampled
from hourly indexer snapshots. Public endpoint: no integrator authentication.

Date bounds filter snapshots inclusively at whole-second precision. The span from the first
to the last matching snapshot is divided into equal-width buckets of at least one hour;
only the latest snapshot in each nonempty bucket is returned. Buckets are not aligned to
calendar hours or days. At most `points` results are returned, with original timestamps:
no interpolation or gap filling. The newest matching snapshot is always included.

For example, a January-to-December request for a vault with data only from October samples
the available October-to-December span, without reserving empty buckets for earlier months.
If metadata resolves successfully but no snapshots match, `data` is empty.



## OpenAPI

````yaml /api-reference/openapi-integrator.json get /v1/query/apy-history
openapi: 3.0.3
info:
  title: Byzantine Integrator API
  description: Byzantine REST API for integrators.
  license:
    name: ''
  version: 0.2.0
servers:
  - url: https://api.byzantine.fi
    description: Prod deployment
security: []
tags:
  - name: API health
    description: Check API status.
  - name: Customer management
    description: Endpoints to create, update, and retrieve customer information.
  - name: Account management
    description: Endpoints to manage accounts, bank accounts, invitations, and user roles.
  - name: Products
    description: Endpoints to get data about products and vaults.
  - name: Transactions
    description: Endpoints to create and manage transactions.
  - name: OTP authentication
    description: Endpoints to initialize and manage user authentication with OTP.
  - name: Events
    description: Endpoints to list lifecycle events.
  - name: Webhooks
    description: Integrator-managed outbound webhook subscriptions and delivery history.
  - name: Integrator key management
    description: >-
      Endpoints to inspect the current integrator credential scope, create,
      update and delete integrator keys.
paths:
  /v1/query/apy-history:
    get:
      tags:
        - Products
      summary: Get single product APY history
      description: >-
        Returns the 12h, 24h, 3d, 7d and 31d trailing APYs of an active top
        vault over time, sampled

        from hourly indexer snapshots. Public endpoint: no integrator
        authentication.


        Date bounds filter snapshots inclusively at whole-second precision. The
        span from the first

        to the last matching snapshot is divided into equal-width buckets of at
        least one hour;

        only the latest snapshot in each nonempty bucket is returned. Buckets
        are not aligned to

        calendar hours or days. At most `points` results are returned, with
        original timestamps:

        no interpolation or gap filling. The newest matching snapshot is always
        included.


        For example, a January-to-December request for a vault with data only
        from October samples

        the available October-to-December span, without reserving empty buckets
        for earlier months.

        If metadata resolves successfully but no snapshots match, `data` is
        empty.
      operationId: get_vault_apy_history
      parameters:
        - name: vault_address
          in: query
          description: Address of the vault
          required: true
          schema:
            type: string
        - name: chain_id
          in: query
          description: >-
            Chain of the vault. Required only when the address is a top vault on
            several chains.
          required: false
          schema:
            type: integer
            format: int32
            nullable: true
        - name: start_date
          in: query
          description: >-
            Inclusive lower bound on snapshot time (RFC 3339), evaluated at
            whole Unix-second

            precision. Dates before the Unix epoch are rejected. Omit to include
            the earliest data.
          required: false
          schema:
            type: string
            format: date-time
            nullable: true
        - name: end_date
          in: query
          description: >-
            Inclusive upper bound on snapshot time (RFC 3339), evaluated at
            whole Unix-second

            precision. Omit to include the latest data. Must not precede
            `start_date`.
          required: false
          schema:
            type: string
            format: date-time
            nullable: true
        - name: points
          in: query
          description: >-
            Maximum result count (1 to 365, default 100), not a guaranteed count
            or frequency.

            Buckets span the first to last available snapshot within the date
            bounds, have equal

            widths of at least one hour, and retain their latest snapshot. Empty
            buckets are omitted.

            With points=1, only the latest snapshot in range is returned.
          required: false
          schema:
            type: integer
            format: int64
            nullable: true
        - name: order
          in: query
          description: >-
            Order by snapshot time: `asc` (default) or `desc`. Reverses the same
            selected points;

            it does not change which snapshots are sampled.
          required: false
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: APY history retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApyHistoryResponse'
        '400':
          description: Invalid parameters, or top vault on several chains without chain_id
        '404':
          description: Not an active top vault
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ApyHistoryResponse:
      type: object
      description: APY history of a top vault, sampled from the hourly indexer snapshots.
      required:
        - vault_address
        - chain_id
        - data
      properties:
        vault_address:
          type: string
        chain_id:
          type: integer
          format: int32
        data:
          type: array
          items:
            $ref: '#/components/schemas/ApyHistoryPoint'
          description: Sampled snapshots, oldest first unless `order=desc`
    ErrorResponse:
      type: object
      required:
        - error
        - status
      properties:
        error:
          type: string
          description: Error message
          example: Resource not found
        status:
          type: integer
          format: int32
          description: HTTP status code
          example: 404
          minimum: 0
    ApyHistoryPoint:
      type: object
      description: >-
        Trailing APYs of a top vault at one hourly indexer snapshot.


        Same semantics as `ApyResponse`: ratios (`0.05` == 5%), computed by the
        indexer at snapshot

        time, not averaged over sampling buckets or recalculated as returns
        between the selected

        points.
      required:
        - timestamp
        - block_number
        - share_price
        - apy_12h
        - apy_24h
        - apy_3d
        - apy_7d
        - apy_31d
      properties:
        timestamp:
          type: string
          format: date-time
          description: Block time of the snapshot
        block_number:
          type: integer
          format: int64
          minimum: 0
        share_price:
          $ref: '#/components/schemas/Decimal'
        apy_12h:
          $ref: '#/components/schemas/Decimal'
        apy_24h:
          $ref: '#/components/schemas/Decimal'
        apy_3d:
          $ref: '#/components/schemas/Decimal'
        apy_7d:
          $ref: '#/components/schemas/Decimal'
        apy_31d:
          $ref: '#/components/schemas/Decimal'
    Decimal:
      type: string
      description: A high-precision decimal number represented as a string
      example: '123.456789'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.