GET /api/v1/ws/trades
WebSocket endpoint that streams live trade events across all markets. Connect to receive a real-time feed of every trade executed on the platform.
Authentication​
None. This is a public WebSocket endpoint.
Connection​
Upgrade an HTTP connection to WebSocket:
wscat -c wss://intotes.com/api/v1/ws/trades
Or in JavaScript:
const ws = new WebSocket("wss://intotes.com/api/v1/ws/trades");
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log(data);
};
Messages​
Initial Message​
Upon connection, the server sends a batch of recent trades:
{
"type": "initial",
"trades": [
{
"amount": 25050,
"name": "trader42",
"token": "YES",
"event": "Will BTC hit $100k by June?",
"market": "BTC $100k",
"avatar": "https://cdn.intotes.com/avatars/7.jpg"
}
]
}
Trade Update​
Each new trade is broadcast individually:
{
"type": "trade",
"trade": {
"amount": 10000,
"name": "betKing",
"token": "NO",
"event": "Champions League Final - Real Madrid vs Man City",
"market": "Real Madrid Win",
"avatar": "https://cdn.intotes.com/avatars/15.jpg"
}
}
Field Reference​
| Field | Type | Description |
|---|---|---|
amount | integer | Trade size in kopecks |
name | string | Display name of the trader |
token | string | Token side: "YES" or "NO" |
event | string | Event title |
market | string | Market name within the event |
avatar | string | Trader's avatar URL |
Connection Notes​
- The server sends ping frames periodically. Clients should respond with pong to keep the connection alive.
- If the connection drops, clients should implement reconnection logic with exponential backoff.
- No client-to-server messages are expected.