ohlcv_history - recent candles (one-shot)
One-shot request: returns the most recent N 1-second candles for a pool. Use it to seed a chart, then upgrade to subscribe_ohlcv for live updates. Pass one of mint or pool, plus an optional limit (1 – 500, default 200).
No key needed
Without a key it answers once a minute per IP address; sooner, the ack is rate_limited with retryAfterMs. With your plan's key in the handshake it answers every second (Lite) or five times a second (Developer).
| Channel | Socket.IO event with ack |
| Auth | none for once a minute; your plan's key, auth: { api_key }, for more |
| Cost | Free: 1 a minute · Lite: 1 a second · Developer: 5 a second |
Example
- JavaScript
- Python
socket.emit("ohlcv_history", { pool: "4mBL…", limit: 200 }, (ack) => {
if (!ack.ok) return console.error(ack);
for (const [t, o, h, l, c, v] of ack.data) {
console.log(new Date(t), `o=${o} h=${h} l=${l} c=${c} v=${v}`);
}
});
from datetime import datetime
# sio.call blocks until the server acks the one-shot request.
ack = sio.call("ohlcv_history", {"pool": "4mBL…", "limit": 200})
if ack["ok"]:
for t, o, h, l, c, v in ack["data"]:
print(datetime.fromtimestamp(t / 1000), f"o={o} h={h} l={l} c={c} v={v}")
Response (ack)
{
"ok": true,
"pool": "4mBL…",
"data": [
[1779812627000, 0.000000033, 0.000000034, 0.000000033, 0.000000034, 5.12],
[1779812628000, 0.000000034, 0.000000035, 0.000000034, 0.000000035, 7.40]
]
}
Tuples are [ timestamp_ms, open, high, low, close, volume ], sorted oldest → newest. Format matches the live ohlcv stream.
Notes
- Works without a key once a minute per IP address. With your plan's key in the handshake,
auth: { api_key: … }, every second (Lite) or five times a second (Developer). Sooner than that, the ack israte_limitedwithretryAfterMs. - Returns up to
limitof the most recent candles. For anything older, the hourly replay files hold every trade.