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.
Perguntas frequentes
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.
Continue lendo
Recarregue, pegue a chave e publique.
Autoatendimento. Pague em cripto ou cartão. Medido por créditos: primitivas pesadas custam mais, as simples são baratas.
Obter chave de API