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_KEYAny 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:
| Code | Reason |
|---|---|
| 1008 | Unauthorized — invalid or missing API key (preceded by error frame) |
| 1013 | Slow consumer — outbound buffer exceeded (preceded by slow_consumer error) |
| 1011 | Internal 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 value | Venue | Catalog slug |
|---|---|---|
| pump_fun | Pump.fun | pump-fun |
| pump_amm | PumpSwap (AMM) | pump-amm |
| raydium_launchlab | Raydium LaunchLab | raydium-launchlab |
| raydium_cpmm | Raydium CPMM | raydium-cpmm |
| raydium_clmm | Raydium CLMM | raydium-clmm |
| raydium_v4 | Raydium V4 | raydium-v4 |
| meteora_dbc | Meteora DBC (historical filter only) | meteora-dbc |
| meteora_damm_v2 | Meteora DAMM v2 | meteora-damm-v2 |
| meteora_dlmm | Meteora DLMM | meteora-dlmm |
| meteora_pools | Meteora Pools | meteora-pools |
| orca_whirlpool | Orca Whirlpool | orca-whirlpool |
| pancakeswap | PancakeSwap | pancakeswap |
| bonkfun | Bonk.fun | bonkfun |
Available streams
Token Creation
Every new token launch as it happens. Fast mode delivers immediately; set enriched: true for socials after metadata fetch.
creationsToken Graduation
Know instantly when a token graduates — with liquiditySol, mayhemMode, and filters to skip thin Mayhem grads.
graduationsToken Prices
Live USD and SOL prices with market cap.
pricesToken Trades
Real-time swaps. Filter by source, mint, wallet, and USD volume.
tradesWallet Transfers
Coming soonToken transfers for watched wallets, as they land on-chain.
transfersfrom / 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).