Streams

Open one WebSocket connection and subscribe to any channel. Send a subscribe message with an optional filters object. Events stream back as JSON with the same shape as the REST API.

Connection

Authenticate with your API key as a query parameter when opening the socket.

wss://api.anaxer.com/v1/stream?key=YOUR_KEY

Subscribe

After connecting, send a JSON message with a subscribe field set to the channel name. The server acknowledges before events flow:

const ws = new WebSocket("wss://api.anaxer.com/v1/stream?key=YOUR_KEY");

ws.onopen = () => ws.send(JSON.stringify({
  subscribe: "creations",
  filters: { enriched: true, excludeMayhem: true }
}));

ws.onmessage = (msg) => {
  const token = JSON.parse(msg.data);
  console.log(token.symbol, token.socials);
};

Server response:

{
  "type": "subscribed",
  "channel": "creations"
}

Unsubscribe

Stop a channel without closing the connection. Send unsubscribe with the channel name:

{
  "unsubscribe": "creations"
}

Server response:

{
  "type": "unsubscribed",
  "channel": "creations"
}

Connection health

The server sends an application-level heartbeat every 30 seconds:

{ "type": "ping" }

Reply with a pong within 10 seconds or the connection is closed:

{ "type": "pong" }

This lets you distinguish a dead connection from a quiet channel. The SDKs respond to pings and detect stale connections automatically — including on reconnect with exponential backoff.

Stream errors

If a subscription is rejected — for example, your plan does not include a channel — the server sends an error frame instead of a subscribed ack:

{
  "type": "error",
  "code": "forbidden",
  "channel": "trades",
  "message": "Your plan doesn't include this stream."
}

See Error handling for the full list of codes on both REST and stream responses.

Close codes

When the server closes the WebSocket, it uses these application close codes:

CodeReason
1000Normal closure
4001Invalid or missing API key
4002Rate limit exceeded
4003Plan limit on concurrent connections exceeded

Gap recovery

Every event includes a Solana slot and a unix-ms timestamp. If your connection drops, note the last event you received. After reconnecting, backfill via the REST list equivalent with from / to (and walk next cursors). There is no REST since slot parameter:

curl "https://api.anaxer.com/v1/tokens/EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm/trades?from=1751000000000&source=pump_fun&limit=100" \
  -H "Authorization: Bearer YOUR_KEY"

Use GET /v1/creations, GET /v1/graduations, or GET /v1/tokens/:mint/trades for backfill. Transfers REST backfill ships with that endpoint.

Connection limits

Each WebSocket connection is one stream, subscribed to a single channel. Your plan sets how many concurrent streams you can run — Free: 1, Starter: 4, Pro: 8. To follow creations and graduations at once, open two connections — one per channel.

Sources

Use the sources filter to limit events to one or more venues. The same values appear on each event as source. Catalog slugs are the human-readable IDs we use internally; pass the source value on the wire.

source valueVenueCatalog slug
pump_funPump.funpump-fun
pump_ammPumpSwap (AMM)pump-amm
raydium_launchlabRaydium LaunchLabraydium-launchlab
raydium_cpmmRaydium CPMMraydium-cpmm
raydium_clmmRaydium CLMMraydium-clmm
raydium_v4Raydium V4raydium-v4
meteora_dbcMeteora DBC (historical filter only)meteora-dbc
meteora_damm_v2Meteora DAMM v2meteora-damm-v2
meteora_dlmmMeteora DLMMmeteora-dlmm
meteora_poolsMeteora Poolsmeteora-pools
orca_whirlpoolOrca Whirlpoolorca-whirlpool
pancakeswapPancakeSwappancakeswap
bonkfunBonk.funbonkfun

Available streams

Reconnection. If the socket drops, reconnect with exponential backoff and re-send your subscribe messages. Use REST list endpoints to backfill any events you missed. The TypeScript SDK handles heartbeat and reconnection (live resume only in v1 — gap backfill stays a REST concern).