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

# APY history (daily granularity)

> Time series of `underlying_apy` and `net_apy_for_user` for the product, one row per day.
APY values are decimals (`0.0612` = 6.12%). Use this to render the APY chart on a partner dashboard.

`days` defaults to 30. Range options: `7`, `30`, `180`.




## OpenAPI

````yaml /openapi.yaml get /api/partner/products/{slug}/apy-history
openapi: 3.0.3
info:
  title: Barker Yield Engine API
  version: 1.0.0
  description: >
    Yield-embed API for partners (wallets, payment apps).


    Authentication: `X-Api-Key` header, self-served from portal.barker.money.

    Revenue: 100% via on-chain fee split inside the engine contract — calling
    this API is free.

    Rate limit: 1000 req/min for production keys (`bk_live_*`), 100 req/min for
    sandbox keys (`bk_test_*`). Anti-abuse, not usage billing.


    Two integration modes — same engines, same key, same fee split, different UI
    surface:
      - Embed (iframe): drop-in UI hosted at app.barker.money, no contract calls in your code.
      - Headless API: your UI calls BarkerEngine (ERC-4626) directly with the user's wallet; this API serves metadata, position, fee stats, and webhooks.
    See https://docs.barker.money/integration-modes for the decision guide.


    Error responses share `{ success: false, code, message }`. Full code catalog
    at https://docs.barker.money/error-codes.
  contact:
    name: Barker
    url: https://docs.barker.money
servers:
  - url: https://api.barker.money
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: products
    description: Partner products (engines) — read access
  - name: position
    description: User position queries
  - name: webhooks
    description: Event subscriptions and callbacks
paths:
  /api/partner/products/{slug}/apy-history:
    get:
      tags:
        - products
      summary: APY history (daily granularity)
      description: >
        Time series of `underlying_apy` and `net_apy_for_user` for the product,
        one row per day.

        APY values are decimals (`0.0612` = 6.12%). Use this to render the APY
        chart on a partner dashboard.


        `days` defaults to 30. Range options: `7`, `30`, `180`.
      parameters:
        - $ref: '#/components/parameters/SlugParam'
        - $ref: '#/components/parameters/DaysParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApyHistoryPoint'
              example:
                success: true
                data:
                  - date: '2026-05-04'
                    underlying_apy: '0.0612'
                    net_apy_for_user: '0.0490'
                  - date: '2026-05-03'
                    underlying_apy: '0.0598'
                    net_apy_for_user: '0.0478'
                  - date: '2026-05-02'
                    underlying_apy: '0.0605'
                    net_apy_for_user: '0.0484'
        '404':
          description: Slug not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    SlugParam:
      in: path
      name: slug
      required: true
      schema:
        type: string
      example: acme-usdc-base
    DaysParam:
      in: query
      name: days
      required: false
      schema:
        type: integer
        enum:
          - 7
          - 30
          - 180
  schemas:
    ApyHistoryPoint:
      type: object
      properties:
        date:
          type: string
          format: date
        underlying_apy:
          type: string
        net_apy_for_user:
          type: string
    Error:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Human-readable; wording may change. Do not parse.
        code:
          type: string
          description: >
            Stable machine-readable error code — switch on this in your code.


            Auth & rate-limit: `missing_api_key` · `invalid_api_key` ·
            `revoked_api_key` · `rate_limited`

            Product / slug: `not_found` · `not_owned` · `engine_not_deployed` ·
            `product_paused` · `product_deprecated`

            Position / address: `invalid_address` · `chain_not_supported`

            Yield-calc / fee-stats: `invalid_amount` · `range_too_large` ·
            `invalid_days`

            Webhooks (inbound): `signature_mismatch` · `missing_idempotency_key`
            · `unknown_event` · `idempotency_replay`

            Server: `internal_error` · `chain_rpc_unavailable`


            Full reference: https://docs.barker.money/error-codes
          example: engine_not_deployed
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````