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_KEYSubscribe
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:
| Code | Reason |
|---|---|
| 1000 | Normal closure |
| 4001 | Invalid or missing API key |
| 4002 | Rate limit exceeded |
| 4003 | Plan 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 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.
transfers