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

# Get candles

> ### Parameters

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| instrumentId | yes | integer (int64) | Instrument ID to fetch candles for |
| interval | yes | string | Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, 1d) |
| startTime | yes | integer (int64) | Start timestamp in milliseconds (optional, defaults to 24h ago) |
| endTime | yes | integer (int64) | End timestamp in milliseconds (optional, defaults to now) |
| limit | yes | integer | null | Maximum number of candles to return (optional, defaults to 500, max 1000) |

### Response fields

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| `candles` | yes | object[] | List of OHLCV candles |
| `candles[].close` | yes | number (float) | — |
| `candles[].high` | yes | number (float) | — |
| `candles[].low` | yes | number (float) | — |
| `candles[].open` | yes | number (float) | — |
| `candles[].slot` | yes | integer (int64) | — |
| `candles[].timestamp` | yes | integer (int64) | — |
| `candles[].volume` | yes | number (float) | — |

### Response example

A sample **`200`** JSON body is attached to this operation as an OpenAPI **example** (Mintlify shows it in the example panel, similar to other exchange API docs).



## OpenAPI

````yaml /specs/openapi.json get /candles
openapi: 3.1.0
info:
  title: RocketFi REST API
  description: REST API for Rocket Chain / RocketFi integrations.
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://beta.rocketfi.io
    description: Beta
  - url: https://testnet.rocket-cluster-1.com
    description: Testnet
  - url: https://devnet.rocket-cluster-1.com
    description: Devnet
security: []
tags:
  - name: Service
    description: Health and availability.
  - name: Market data
    description: Instruments, candles, fees, leverage, and funding data.
  - name: Account
    description: Account nonce, fees, collateral, positions, and orders.
  - name: Trading
    description: Transactions and order activity.
  - name: Vault and bridge
    description: Vaults, history, and bridge events.
  - name: Faucet (testnet)
    description: Testnet faucet for development.
paths:
  /candles:
    get:
      tags:
        - Market data
      summary: Get candles
      description: >-
        ### Parameters


        | Parameter | Required | Type | Description |

        | --------- | -------- | ---- | ----------- |

        | instrumentId | yes | integer (int64) | Instrument ID to fetch candles
        for |

        | interval | yes | string | Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h,
        1d) |

        | startTime | yes | integer (int64) | Start timestamp in milliseconds
        (optional, defaults to 24h ago) |

        | endTime | yes | integer (int64) | End timestamp in milliseconds
        (optional, defaults to now) |

        | limit | yes | integer | null | Maximum number of candles to return
        (optional, defaults to 500, max 1000) |


        ### Response fields


        | Parameter | Required | Type | Description |

        | --------- | -------- | ---- | ----------- |

        | `candles` | yes | object[] | List of OHLCV candles |

        | `candles[].close` | yes | number (float) | — |

        | `candles[].high` | yes | number (float) | — |

        | `candles[].low` | yes | number (float) | — |

        | `candles[].open` | yes | number (float) | — |

        | `candles[].slot` | yes | integer (int64) | — |

        | `candles[].timestamp` | yes | integer (int64) | — |

        | `candles[].volume` | yes | number (float) | — |


        ### Response example


        A sample **`200`** JSON body is attached to this operation as an OpenAPI
        **example** (Mintlify shows it in the example panel, similar to other
        exchange API docs).
      operationId: get_candles
      parameters:
        - name: instrumentId
          in: path
          description: Instrument ID to fetch candles for
          required: true
          schema:
            $ref: '#/components/schemas/InstrumentId'
        - name: interval
          in: path
          description: Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, 1d)
          required: true
          schema:
            $ref: '#/components/schemas/CandleTimeframe'
        - name: startTime
          in: path
          description: Start timestamp in milliseconds (optional, defaults to 24h ago)
          required: true
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/u64'
        - name: endTime
          in: path
          description: End timestamp in milliseconds (optional, defaults to now)
          required: true
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/u64'
        - name: limit
          in: path
          description: >-
            Maximum number of candles to return (optional, defaults to 500, max
            1000)
          required: true
          schema:
            type:
              - integer
              - 'null'
            minimum: 0
      responses:
        '200':
          description: Historical OHLCV candles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCandlesResponse'
              example:
                candles:
                  - slot: 982341
                    timestamp: 1704067200000
                    open: 67000
                    high: 67500
                    low: 66800
                    close: 67250.5
                    volume: 128.75
        '400':
          description: Bad request
components:
  schemas:
    InstrumentId:
      type: integer
      format: int64
      description: An instrument identifier (8-byte hash).
      minimum: 0
    CandleTimeframe:
      type: string
      description: Candle timeframe/interval for aggregation
      enum:
        - 1m
        - 5m
        - 15m
        - 30m
        - 1h
        - 4h
        - 1d
    u64:
      type: integer
      format: int64
      minimum: 0
    GetCandlesResponse:
      type: object
      description: Response containing historical candles
      required:
        - candles
      properties:
        candles:
          type: array
          items:
            $ref: '#/components/schemas/CandleResponseItem'
          description: List of OHLCV candles
    CandleResponseItem:
      type: object
      required:
        - slot
        - timestamp
        - open
        - high
        - low
        - close
        - volume
      properties:
        close:
          type: number
          format: float
        high:
          type: number
          format: float
        low:
          type: number
          format: float
        open:
          type: number
          format: float
        slot:
          type: integer
          format: int64
          minimum: 0
        timestamp:
          $ref: '#/components/schemas/u64'
        volume:
          type: number
          format: float

````