> ## 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 OHLCV candles

> Historical open/high/low/close/volume candles for a 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 historical OHLCV candles for a market at a chosen interval.

## Notes

* **Query window is capped at 7 days** per request. Walk `start_timestamp` forward to page through longer windows.
* **Last bucket is mutable.** If `end_timestamp` is "now", the most recent candle keeps updating until its interval closes. Clients polling live data should refresh or discard the last bucket.
* **Empty buckets are omitted.** Zero-volume intervals are not padded; interpolate client-side if you need a dense series.
* **`volume` is base-asset volume**, not USD notional.

## Coming soon

`volume_quote` — quote-denominated (USD) volume — is not yet returned. For now, approximate it as `volume × mid`. To request prioritization, reach out to your account manager.


## OpenAPI

````yaml _openapi/market-data-api.json GET /api/v1/markets/{market_id}/ohlcv
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}/ohlcv:
    get:
      summary: Get OHLCV candles
      description: >-
        Historical OHLCV candles for a market. Query window capped at 7 days per
        request.
      parameters:
        - $ref: '#/components/parameters/MarketIdPath'
        - name: interval
          in: query
          required: true
          description: Candle interval.
          schema:
            type: string
            enum:
              - 1m
              - 5m
              - 15m
              - 1h
              - 4h
              - 1d
          example: 1h
        - $ref: '#/components/parameters/StartTimestamp'
        - $ref: '#/components/parameters/EndTimestamp'
        - name: limit
          in: query
          description: Maximum candles to return (1–5000).
          schema:
            type: integer
            default: 500
            minimum: 1
            maximum: 5000
      responses:
        '200':
          description: Candles, ascending by time.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Candle'
                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:
    Candle:
      type: object
      properties:
        market_id:
          type: string
          examples:
            - hl:perp:BTC-USDC
        interval:
          type: string
          enum:
            - 1m
            - 5m
            - 15m
            - 1h
            - 4h
            - 1d
        open_time:
          type: integer
          description: Candle start, Unix milliseconds.
          examples:
            - 1746057600000
        close_time:
          type: integer
          description: Candle end, Unix milliseconds.
          examples:
            - 1746061199999
        open:
          type: string
          examples:
            - '104120.00'
        high:
          type: string
          examples:
            - '104880.50'
        low:
          type: string
          examples:
            - '103990.10'
        close:
          type: string
          examples:
            - '104830.10'
        volume:
          type: string
          description: Base-asset volume.
          examples:
            - '1842.35'
        trade_count:
          type: integer
          examples:
            - 1234
      required:
        - market_id
        - interval
        - open_time
        - close_time
        - open
        - high
        - low
        - close
        - volume
        - trade_count
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````