Market data

Build a token price chart

A chart is just OHLCV candles over a window. Request the interval and count you need, then draw. OHLCV is a cheap C1 read, so the win is caching the series rather than refetching it on every render.

开始之前
  • A live API key
  • The token id and the interval and window you want to plot

1Request the candle series

Ask for the id, interval and limit. This example pulls a week of hourly candles. OHLCV is a C1 read.

curl "https://api.1st-node.com/v1/market/ohlcv?id=eth&interval=1h&limit=168" \
  -H "Authorization: Bearer sk_live_..."

2Read the OHLCV rows

Each row is timestamp, open, high, low, close and volume — exactly what a candlestick renderer expects. Feed the array straight into your charting library.

> { "candles": [
>   [1712000000, 3140.1, 3162.8, 3130.0, 3155.4, 812.3] ] }

3Cache the series and append the tail

Historical candles never change, so cache the window and only refetch the most recent interval. This keeps a live chart cheap even though the underlying reads are already C1.

常见问题

How far back can I chart?

Set interval and limit to define the window — for example interval=1h with limit=168 for a week. Larger windows just return more rows.

Are OHLCV reads expensive?

No, they are C1 reads. Cache the historical portion and only pull the newest candle so a refreshing chart stays cheap.

继续阅读

充值、拿密钥、上线。

自助开通。支持加密货币或银行卡。按额度计费——重型原语更贵,简单调用很便宜。

获取 API 密钥