Tokens

Candle / OHLC Data

Returns OHLC candles built from on-chain reserve sync events. The price is the token's quote reserve divided by its own reserve: in main units for a factory token, in pair-asset units for a main. quote=pair and quote=usd convert it. The newest 50,000 ticks of the window are used; truncated says when the window held more.

GET
/api/v1/tokens/{address}/candles
Get OHLC price candles for a token.
Auth: API Key required

Query Parameters

ParamTypeDescription
intervalstring1m, 5m, 15m, 1h (default), 4h, 1d
fromnumberStart time (unix seconds; unix ms accepted above 1e12; default: 7 days ago)
tonumberEnd time (unix seconds; unix ms accepted above 1e12; default: now)
limitnumberMax candles to return (default: 500, max: 1000)
quotestringtoken (default: the token's own quote), pair (the main's pair asset) or usd (ticks with a known USD price only)

Response

Response
{
  "data": [
    { "time": 1710000000, "open": 0.0015, "high": 0.0018, "low": 0.0014, "close": 0.0017 },
    { "time": 1710003600, "open": 0.0017, "high": 0.0020, "low": 0.0016, "close": 0.0019 }
  ],
  "interval": "1h",
  "count": 2,
  "truncated": false,
  "main": "0x...",
  "quote": { "mode": "token", "asset": "0x...", "symbol": "STASIS", "decimals": 18 }
}
Example Code
// Get OHLC candle data
const res = await fetch(
  "https://launchonbasis.com/api/v1/tokens/0xTokenAddress/candles?interval=1h&limit=200",
  { headers: { "X-API-Key": "bsk_your_key" } }
);
const { data, interval, count } = await res.json();
// data = [{ time, open, high, low, close }, ...]