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

> Get OHLC (Open, High, Low, Close) price data for Bitcoin Runes trading pairs on DEXs with historical candles.

# Rune OHLC data



## OpenAPI

````yaml bitcoin/market-price-api/openapi.json get /dexs/ohlc/{dex}/{symbol}
openapi: 3.1.0
info:
  description: >-
    Maestro’s Market Price API delivers real-time, rollback-protected DEX
    trading activity alongside historical price mapping for both Bitcoin and
    Rune assets in USD. It combines deep network-level indexing with robust
    trade tracking, abstracting away the complexity of UTXO handling.

    #### Key Features:

    - **Mempool Awareness:** Provides insight into the latest trades from the
    mempool for the most dynamic price discovery.

    - **Multi-DEX Support:** Query data from supported decentralized
    exchanges—including Magic Eden and Dotswap—individually or in aggregate.

    - **Rollback Protection:** Ensures price accuracy by tracking chain
    reorganizations and updating data accordingly—no stale or orphaned block
    data.

    - **Dual-Pipeline Indexing:** Separately indexes UTXOs and trades for
    accuracy and real-time responsiveness.

    - **Real-Time DEX Price Feeds:** Continuously updated trade and price data,
    optimized for wallets, traders, and analytics platforms.

    - **Historical Price Mapping:** Access time-series price data (USD) for both
    Bitcoin and Rune assets, enabling historical analysis and charting.


    #### Key Benefits for Developers:

    - Track accurate, chain-verified prices without maintaining your own
    indexers.

    - Build DEX-integrated wallets and apps with reliable, real-time market
    signals.

    - Identify and act on price trends immediately, with confidence the data
    won’t be invalidated by reorgs.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.txt
  title: Bitcoin - Market Price API
  version: 0.1.0
servers:
  - description: Bitcoin Mainnet
    url: https://xbt-mainnet.gomaestro-api.org/v0/markets
  - description: Bitcoin Testnet (coming soon)
    url: https://xbt-testnet.gomaestro-api.org/v0/markets
security:
  - api-key: []
externalDocs:
  description: ''
  url: ''
paths:
  /dexs/ohlc/{dex}/{symbol}:
    get:
      tags:
        - DEX
      summary: Rune OHLC data
      description: >-
        Returns candlestick-formatted market data (Open, High, Low, Close,
        Volume) for a specific DEX and Rune pair, segmented by time intervals.
        This is ideal for price charting, trend analysis, and historical
        performance. Data is sourced from both confirmed blocks and optionally
        from the mempool, depending on configuration.
      operationId: mkt-dex-ohlc
      parameters:
        - description: Name of the DEX
          example: magiceden
          in: path
          name: dex
          required: true
          schema:
            default: magiceden
            enum:
              - all
              - magiceden
              - dotswap
            type: string
        - description: Symbol of the Rune asset trading pair (BTC-Rune ID)
          example: BTC-840000:28
          in: path
          name: symbol
          required: true
          schema:
            default: BTC-840000:28
            type: string
        - description: Mempool mode
          example: included
          in: query
          name: mempool
          schema:
            default: excluded
            enum:
              - included
              - excluded
              - only
            type: string
        - description: Time resolution (1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1M)
          example: 1h
          in: query
          name: resolution
          required: true
          schema:
            default: 1h
            enum:
              - 1m
              - 5m
              - 15m
              - 30m
              - 1h
              - 4h
              - 1d
              - 1w
              - 1M
            type: string
        - description: Start timestamp in Unix
          example: '1735689600'
          in: query
          name: from
          schema:
            default: '1735689600'
            type: string
        - description: End timestamp in Unix
          example: '1742428800'
          in: query
          name: to
          schema:
            default: '1742428800'
            type: string
        - description: 'Limit number of Runes returned (min: 1, max: 50000)'
          example: 10000
          in: query
          name: limit
          schema:
            default: 5000
            maximum: 50000
            minimum: 1
            type: integer
        - description: Sort by descending (desc) or ascending (asc)
          example: asc
          in: query
          name: sort
          schema:
            default: desc
            enum:
              - asc
              - desc
            type: string
        - description: >-
            Fill candles with no trades with synthetic data (OHLC filled with
            previous closing price, volume=0)
          example: false
          in: query
          name: carry
          schema:
            default: false
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.CandleList'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bitcoin_api.APIError'
          description: Bad Request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bitcoin_api.APIError'
          description: Server Error
components:
  schemas:
    models.CandleList:
      properties:
        data:
          items:
            $ref: '#/components/schemas/models.Candle'
          type: array
          uniqueItems: false
      type: object
    bitcoin_api.APIError:
      properties:
        error:
          description: Error returned from the API request
          example: Bad Request
          type: string
      type: object
    models.Candle:
      properties:
        bucket:
          description: Start time of the candle interval
          example: '2024-03-25T14:00:00Z'
          type: string
        close:
          description: Price at the end of the interval (in satoshis)
          example: 19.75
          type: number
        high:
          description: Highest price during the interval (in satoshis)
          example: 20
          type: number
        low:
          description: Lowest price during the interval (in satoshis)
          example: 19.25
          type: number
        open:
          description: Price at the start of the interval (in satoshis)
          example: 19.5
          type: number
        symbol:
          description: Symbol of the Rune asset trading pair (BTC-Rune ID)
          example: BTC-840000:28
          type: string
        volume:
          description: >-
            Total traded amount during the interval. Volume=0 for backfilled,
            synthetic candles (queried with carry=true)
          example: 3780
          type: number
      type: object
  securitySchemes:
    api-key:
      description: Project API Key
      in: header
      name: api-key
      type: apiKey

````