Appearance
Frames
All client commands and server responses are JSON objects with an op field.
Authenticate
Pass the API key in the URL, or send it as the first message:
json
{ "op": "auth", "key": "tsk_live_..." }Use the message form when you do not want the key in the WebSocket URL.
Subscribe
json
{
"op": "subscribe",
"id": 1,
"stream": "token_trades",
"params": {
"mint": "DD9e...",
"detail": "full"
}
}| Field | Description |
|---|---|
op | Must be "subscribe" |
id | Client correlation id; server responses to the command carry it |
stream | One of the eight stream names |
params | Stream-specific target, filters, and detail options |
cursor | Optional replay cursor, beside stream rather than inside params |
The server acknowledges a successful subscription and assigns its id:
json
{ "op": "ack", "id": 1, "sub": "tt_1" }Use sub to match later events and to unsubscribe.
Parameter validation
- A list accepts at most 50 values.
- A string accepts at most 64 characters.
- Unknown parameters fail with
invalid_params, so misspellings are not silently ignored. - Required stream targets (
mintorwallet) must be valid Solana addresses.
Event
json
{
"op": "event",
"sub": "tt_1",
"stream": "token_trades",
"cursor": "436312304:15:0",
"data": {}
}| Field | Description |
|---|---|
sub | Subscription that produced the event |
stream | Stream name |
cursor | Event position used for replay after reconnecting |
data | Stream-specific payload |
Unsubscribe
json
{ "op": "unsubscribe", "id": 2, "sub": "tt_1" }The sub value is the id returned by the subscription acknowledgement.
Check the connection
json
{ "op": "ping", "id": 3 }The server replies:
json
{ "op": "pong", "id": 3 }WebSocket protocol pings are sent as well. The JSON command is useful through proxies that consume protocol-level pings.
Errors and notices
Errors include the id of the command that caused them. Notices are asynchronous and usually include the affected sub. See Errors & notices.