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

# OHLC candlestick data



## OpenAPI

````yaml openapi-spec/history.yaml get /api/sol/tokens/ohlc/{tokenMint}
openapi: 3.0.3
info:
  title: Raze Database API
  description: >
    Paid subscription API for Solana transaction data and history.


    Also hosts write utilities (`/utils/sol/*`): token launch, transfer, burn,

    consolidate, fees claim/config, and agent initialize — previously on

    `router.raze.bot`. Mixer/distribute removed 2026-07-25.


    ## Batch Requests

    All endpoints with path parameters (mint, signer, address, tokenMint,
    ownerAddress) support batch queries

    via comma-separated values. For example:
    `/api/sol/trades/mint/mint1,mint2,mint3?limit=50`


    - Maximum 10 values per batch request

    - Each value must be a valid address (>= 32 characters)

    - Single values behave identically to non-batch requests

    - Batch response format: `{ "success": true, "results": { "value1": {...},
    "value2": {...} }, "count": N, "timestamp": "..." }`

    - Each key in `results` contains the full single-entity response

    - Queries run in parallel for maximum performance
  version: 1.0.0
servers:
  - url: https://api.raze.bot
    description: >-
      Raze global History API — GeoDNS routes to the nearest region
      automatically
security:
  - ApiKeyAuth: []
paths:
  /api/sol/tokens/ohlc/{tokenMint}:
    get:
      summary: OHLC candlestick data
      operationId: getOHLC
      parameters:
        - name: tokenMint
          in: path
          required: true
          schema:
            type: string
          example: Fyx78ew4wRY26gPj5CkTyuZ4kvW7CkPff5Jm2vNspump
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 2000
            default: 500
          description: Maximum number of candles to return.
        - name: countback
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 2000
          description: >-
            Alias of `limit` (TradingView-style). If both are provided,
            `countback` wins.
        - name: from
          in: query
          schema:
            type: integer
          description: Start timestamp (Unix seconds)
        - name: to
          in: query
          schema:
            type: integer
          description: End timestamp (Unix seconds)
        - name: timeframe
          in: query
          schema:
            type: string
            enum:
              - 1s
              - 5s
              - 15s
              - 30s
              - 1m
              - 5m
              - 15m
              - 30m
              - 1h
              - 4h
              - 1d
            default: 1s
          description: Candlestick timeframe resolution.
        - name: tf
          in: query
          schema:
            type: string
            enum:
              - 1s
              - 5s
              - 15s
              - 30s
              - 1m
              - 5m
              - 15m
              - 30m
              - 1h
              - 4h
              - 1d
          description: Alias of `timeframe`.
        - name: resolution
          in: query
          schema:
            type: string
            enum:
              - '1'
              - '5'
              - '15'
              - '30'
              - '60'
              - '240'
              - 1D
              - 1S
              - 5S
              - 15S
              - 30S
          description: >
            TradingView resolution code, mapped to a timeframe: `1`→1m, `5`→5m,
            `15`→15m, `30`→30m, `60`→1h, `240`→4h, `1D`→1d, `1S`→1s, `5S`→5s,
            `15S`→15s, `30S`→30s. Overrides `timeframe`/`tf` when set.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OHLCResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Database error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    OHLCResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              timestamp:
                type: string
                format: date-time
              token_mint:
                type: string
              open:
                type: string
              high:
                type: string
              low:
                type: string
              close:
                type: string
              volume:
                type: string
                description: Quote-side (SOL) volume in this candle.
              volumeTokens:
                type: string
                description: Token-side volume in this candle (4 decimal places).
              trades:
                type: string
              sol_price:
                type: string
        oldestTimestamp:
          type: integer
          nullable: true
          description: Unix timestamp in seconds for pagination
        count:
          type: integer
        timeframe:
          type: string
          enum:
            - 1s
            - 5s
            - 15s
            - 30s
            - 1m
            - 5m
            - 15m
            - 30m
            - 1h
            - 4h
            - 1d
          description: Candlestick timeframe used
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: string
        success:
          type: boolean
      example:
        error: Unauthorized
        message: Invalid API key
        code: INVALID_KEY
        success: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apiKey

````