Skip to Content
Scalar
Data APIs

Get OHLC candles

Returns OHLC candlestick data for a feed. Reads from ClickHouse with gap detection; missing ranges are backfilled from the Pyth Lazer History API and the in-progress candle is appended from the live ingester. Set ema=true to include EMA-12 and EMA-26 arrays, bb=true to include Bollinger Bands. Live windows are cached for 5 seconds; fully historical windows for 10 minutes.

GET
/candles/{feed_id}

Returns OHLC candlestick data for a feed. Reads from ClickHouse with gap detection; missing ranges are backfilled from the Pyth Lazer History API and the in-progress candle is appended from the live ingester. Set ema=true to include EMA-12 and EMA-26 arrays, bb=true to include Bollinger Bands. Live windows are cached for 5 seconds; fully historical windows for 10 minutes.

Path Parameters

feed_id*number

Pyth Lazer feed ID (e.g. 1 for BTC)

Range1 <= value

Query Parameters

resolution*string
Value in"1""5""15""60"
from*number

Start Unix timestamp (seconds, inclusive)

to*number

End Unix timestamp (seconds, inclusive)

ema?string

Set to 'true' to include EMA-12 and EMA-26 arrays

bb?string

Set to 'true' to include Bollinger Bands (upper/middle/lower) arrays

Response Body

OHLC candles for a feed

application/json
  1. response

OHLC candles for a feed

timestamps*array<number>

Candle open time, Unix timestamp (seconds)

opens*array<number>

Open prices

highs*array<number>

High prices

lows*array<number>

Low prices

closes*array<number>

Close prices

ema12?array<number>

EMA-12 of closes

ema26?array<number>

EMA-26 of closes

bb_upper?array<number>

Bollinger upper band

bb_middle?array<number>

Bollinger middle band

bb_lower?array<number>

Bollinger lower band

Example Request
curl -X GET 'https://data.scalar.market/candles/1?resolution=1&from=0&to=0'
Example Response
{
  "timestamps": [
    0
  ],
  "opens": [
    0
  ],
  "highs": [
    0
  ],
  "lows": [
    0
  ],
  "closes": [
    0
  ],
  "ema12": [
    0
  ],
  "ema26": [
    0
  ],
  "bb_upper": [
    0
  ],
  "bb_middle": [
    0
  ],
  "bb_lower": [
    0
  ]
}