WebSocket: live candles, trades and board feeds
const url = 'https://api.getchord.xyz/v1/ws/live';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.getchord.xyz/v1/ws/liveUpgrade to a WebSocket. No key needed, rate-limit exempt, up to 8 channels per connection. With an API key (X-API-Key, or ?apiKey= from a browser) the connection joins a separate pool: up to 64 channels per connection and 20 connections per key (429 beyond). Subscribe with {op:"sub", channel:"candles", token, tf}, {op:"sub", channel:"trades", token} or {op:"sub", channel:"prices", chain} (chain 5042, 4663 or 143); the server pushes candle, trades and prices frames (every print within ~400 ms; on 5042 / 4663 each item also carries the token’s live 24h volume and trade counts), new frames for tokens trading for the first time (5042 / 4663), ping every 25 s, and error with a code (bad_op · bad_token · bad_tf · bad_chain · channel_cap). Full protocol under Concepts → Streaming.
Responses
Section titled “ Responses ”Switching protocols.
This API key already holds its maximum of live connections.
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}WS_LIVE_DISABLED or at capacity.
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}