Quickstart
Get from zero to your first event in a few minutes.
You need Node.js with a WebSocket-capable runtime, or Python 3.10+ with the websockets package. Browser WebSockets work for experiments, but production keys should stay server-side.
1. Create an API key
- Sign in at tessium.dev.
- Open the dashboard.
- Create a key. The free plan needs no payment details.
2. Connect
Open a WebSocket to the stream endpoint and pass your key as a query parameter:
wss://api.tessium.dev/stream?key=YOUR_API_KEY3. Subscribe
Send a JSON subscribe frame after the socket opens. This example watches every new token on pump.fun:
For the Python example, install its only dependency:
pip install websocketsconst ENDPOINT = 'wss://api.tessium.dev/stream?key=YOUR_API_KEY'
const ws = new WebSocket(ENDPOINT)
ws.onopen = () =>
ws.send(
JSON.stringify({
op: 'subscribe',
stream: 'launches',
params: { platforms: ['pumpfun'] },
id: 1,
}),
)
ws.onmessage = (e: MessageEvent) => {
const message = JSON.parse(e.data as string)
if (message.op === 'ack') console.log('subscribed:', message.sub)
if (message.op === 'event') console.log(message.data)
}import asyncio, json, websockets
ENDPOINT = "wss://api.tessium.dev/stream?key=YOUR_API_KEY"
SUB = {
"op": "subscribe",
"stream": "launches",
"params": {"platforms": ["pumpfun"]},
"id": 1,
}
async def main():
async with websockets.connect(ENDPOINT) as ws:
await ws.send(json.dumps(SUB))
async for message in ws:
frame = json.loads(message)
if frame["op"] == "ack":
print("subscribed:", frame["sub"])
elif frame["op"] == "event":
print(frame["data"])
asyncio.run(main())4. Read the event
The server first acknowledges the subscription:
{ "op": "ack", "id": 1, "sub": "ln_1" }Events then arrive with "op": "event". A launch looks like this:
{
"op": "event",
"sub": "ln_1",
"stream": "launches",
"cursor": "000436312304:000015:0000",
"data": {
"slot": 436312304,
"signature": "2ypWH1eZ...",
"blockTime": 1785482177,
"protocol": "pumpfun",
"mint": "3hz7...pump",
"creator": "9GXm...",
"bondingCurve": "79Pe...",
"name": "Example Token",
"symbol": "EXMP"
}
}You are live
The ack confirms that the subscription is open. Receiving the first event confirms the complete path from Solana to your consumer.
You are connected once the ack arrives. Persist each event's cursor after processing it so you can replay a short disconnect.
Runnable examples
The same connection, turned into programs you can start right now. Each one is a single file with a Node and a Python version that print the same output.
- Launch to trades — catch a token at its launch and follow its trades from the same handler.
- Early volume filter — give every launch a five second window and keep the ones that trade above 5 SOL.
- Telegram alerts — send a Telegram message on every trade above a dollar threshold.