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?apiKey=YOUR_KEY

Any WebSocket client works — the TypeScript SDK, a browser WebSocket, or wscat from a terminal. The Quickstart shows a no-code connection test.

Subscribe

After connecting, send a JSON control message with type: "subscribe", a client id, and the channel name. The server acknowledges before events flow:

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

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

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

Server response:

{
  "v": 1,
  "type": "subscribed",
  "id": "launches",
  "channel": "creations",
  "ts": 1783259497100
}

Unsubscribe

Stop a subscription without closing the connection. Send type: "unsubscribe" with the subscription id:

{
  "type": "unsubscribe",
  "id": "launches"
}

Server response:

{
  "v": 1,
  "type": "unsubscribed",
  "id": "launches",
  "ts": 1783259497200
}

Connection health

Client ping frames are optional in v1. Send one when you want a liveness check; the server replies with pong:

Client → server:

{ "type": "ping" }

Server → client:

{
  "v": 1,
  "type": "pong",
  "ts": 1783259497300
}

The server does not send application-level pings on a timer. It may still close idle or dead sockets. The TypeScript SDK handles 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. Fatal codes (unauthorized, slow_consumer) are followed by a socket close:

{
  "v": 1,
  "type": "error",
  "code": "plan_restricted",
  "message": "Your plan doesn't include this stream.",
  "id": "trades-1",
  "ts": 1783259497400
}

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

Close codes

Fatal stream errors close the WebSocket with a standard close code after an error frame. Codes used today:

CodeReason
1008Unauthorized — invalid or missing API key (preceded by error frame)
1013Slow consumer — outbound buffer exceeded (preceded by slow_consumer error)
1011Internal server error

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

One WebSocket connection may hold subscriptions on multiple channels. Your plan caps concurrent subscriptions per channel across your account (Free: 1, Starter: 1, Pro: 2) — every connection and every API key shares that counter. Exceeding the cap returns subscription_limit. On Pro, a higher per-channel cap lets you run separate filtered subscriptions side by side (still counted account-wide).

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 with from / to (and cursor) to backfill any events you missed. The TypeScript SDK handles reconnection (live resume only in v1 — gap backfill stays a REST concern).