Streams
Live trades and launches over Server-Sent Events and WebSocket.
WebSocket
Connect to wss://api.justi.fun/v1/ws (add ?key=jf_live_... in browsers, or an Authorization header elsewhere). The server greets with welcome; then subscribe to channels.
| Channel | Events |
|---|---|
| launches | launch.created |
| trades | every trade |
| trades:<mint> | trades of one coin |
| graduations | coin.graduated |
| burns | burn |
const sub = justi.subscribe(["launches", `trades:${mint}`], (e) => {
if (e.event === "trade") console.log(e.data.side, e.data.solLamports);
});
// reconnects and resubscribes on its own; sub.add(...), sub.remove(...), sub.close()→ {"op":"subscribe","channels":["trades:<mint>","launches"],"id":1}
← {"type":"welcome","channels":["launches","trades","trades:<mint>","graduations","burns"],"heartbeatSec":20,"tier":"anon","maxSubscriptions":20,"ts":1793110000}
← {"type":"subscribed","channels":["trades:<mint>","launches"],"id":1}
← {"type":"event","channel":"trades:<mint>","event":"trade","id":"evt_7804","ts":1793110266,"data":{ ...same as the webhook... }}
← {"type":"heartbeat","ts":1793110280}
→ {"op":"unsubscribe","channels":["launches"]} → {"op":"ping"} ← {"type":"pong","ts":...}
← {"type":"error","code":"invalid_params","message":"Unknown channel: ..."}Server-Sent Events
GET /v1/stream sends event: trade and event: launch, with a heartbeat comment every 15 s. Add ?mint= for one coin. Good for browsers with EventSource and for curl -N.
curl -N "https://api.justi.fun/v1/stream?mint=<mint>"event: trade
data: {"mint","ticker","image","side":"buy","sol":"<lamports>","tokens":"<raw>","wallet","signature","ts","priceSol","mcapSol"}
event: launch
data: {"mint","ticker","name","image","ts"}Limits
| anon | free key | partner key | |
|---|---|---|---|
| Open streams at once (SSE + WS) | 5 | 20 | 200 |
| Subscriptions per WS connection | 20 | 50 | 500 |
| New connections | 10 burst, 20/min | 20, 60/min | 100, 300/min |
Client messages: 4 KB each, 30 per 10 s (more closes with 1008). A client that does not answer pings for 40 s is dropped. More than 4 MB of unread output closes with 1013. A bad key is refused with HTTP 401 before the upgrade, too many connections with 429.
Reference
#Server-Sent Events: trades and launches
event: trade data {"mint","ticker","image","side","sol","tokens","wallet","signature","ts","priceSol","mcapSol","ix","createTx"}; event: launch data {"mint","ticker","name","image","ts"}. Heartbeat comment every 15s. Optional ?mint= filter. For more channels use the WebSocket at /v1/ws.
Parameters
| Name | Type | About |
|---|---|---|
| mintquery | address |
Response: text/event-stream
curl "https://api.justi.fun/v1/stream" -o out