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

# Get funding rates

> Historical funding rate timeseries for a perpetual market.

<Warning>
  **Alpha** — The Market Data API is in alpha. Schema and response format may change. To request access, [contact us](https://www.allium.so/contact) or reach out to your account manager.
</Warning>

Returns the historical funding rate timeseries for a perpetual market, collapsed to hourly buckets. Perp markets only.

<Note>
  The query window is currently capped at **7 days** per request.
</Note>


## OpenAPI

````yaml _openapi/market-data-api.json GET /api/v1/markets/{market_id}/perps/funding
openapi: 3.1.0
info:
  title: Allium Market Data API
  version: 0.1.0
  description: >-
    Unified market data — reference, pricing, and perps primitives across
    trading venues. Alpha; schema may change.
servers:
  - url: https://api.allium.so
security:
  - APIKeyBearer: []
paths:
  /api/v1/markets/{market_id}/perps/funding:
    get:
      summary: Get funding rates
      description: >-
        Hourly funding rate timeseries for a perpetual market. Query window
        capped at 7 days per request.
      parameters:
        - $ref: '#/components/parameters/MarketIdPath'
        - $ref: '#/components/parameters/StartTimestamp'
        - $ref: '#/components/parameters/EndTimestamp'
        - name: limit
          in: query
          description: Maximum rows to return (1–5000).
          schema:
            type: integer
            default: 168
            minimum: 1
            maximum: 5000
      responses:
        '200':
          description: Funding samples, one per hour.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/FundingRate'
                required:
                  - items
components:
  parameters:
    MarketIdPath:
      name: market_id
      in: path
      required: true
      description: Canonical market slug, {venue}:{instrument_type}:{pair}.
      schema:
        type: string
      example: hl:perp:BTC-USDC
    StartTimestamp:
      name: start_timestamp
      in: query
      required: true
      description: Start of the window (ISO 8601; naive datetimes treated as UTC).
      schema:
        type: string
      example: '2026-05-01T00:00:00Z'
    EndTimestamp:
      name: end_timestamp
      in: query
      required: true
      description: End of the window (ISO 8601).
      schema:
        type: string
      example: '2026-05-02T00:00:00Z'
  schemas:
    FundingRate:
      type: object
      properties:
        market_id:
          type: string
          examples:
            - hl:perp:BTC-USDC
        ts:
          type: string
          description: ISO 8601 timestamp aligned to the hour boundary.
          examples:
            - '2026-05-01T00:00:00.000000+00:00'
        funding_rate:
          type: string
          description: Funding rate applied for the hour.
          examples:
            - '0.0000125'
        premium_index:
          type: string
          description: Time-weighted average premium index over the hour.
          examples:
            - '0.0000098'
        interval_seconds:
          type: integer
          description: Seconds in the funding interval (3600 on Hyperliquid).
          examples:
            - 3600
      required:
        - market_id
        - ts
        - funding_rate
        - premium_index
        - interval_seconds
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````