Data Stream β WebSocket API
Use this endpoint to stream live Pump.fun, PumpSwap, Bonk, and Raydium-CPMM transactions the moment they happen.
Subscribing delivers every event β token creations, buys, sells, and migrations.
Endpointβ
wss://stream.pumpapi.io/
Filter on the client. The server sends all events.
One connection only. Open a single WebSocket per client and reuse it to avoid rate limits.
Reconnect logic. Connections can drop (for example, due to server-side updates or your network issues). You should implement automatic reconnection in your client.
π¦ Code Examplesβ
- Python
- JavaScript
- Rust
- Go
import asyncio
import websockets
import orjson as json # or use the standard json module (orjson is faster)
async def pumpapi_data_stream():
uri = "wss://stream.pumpapi.io/"
async with websockets.connect(uri) as websocket:
async for message in websocket:
event = json.loads(message)
print(event) # {'txType': 'buy', 'pool': 'pump', ...}
asyncio.run(pumpapi_data_stream())
import WebSocket from 'ws'; // npm i ws
const ws = new WebSocket('wss://stream.pumpapi.io/');
ws.on('message', data => {
const event = JSON.parse(data);
console.log(event); // { txType: 'create', pool: 'pump', ... }
});
ws.on('error', console.error);
use futures_util::StreamExt;
use serde_json::Value;
use tokio_tungstenite::connect_async;
use url::Url;
#[tokio::main]
async fn main() {
let url = Url::parse("wss://stream.pumpapi.io/").unwrap();
let (mut ws, _) = connect_async(url).await.expect("Failed to connect");
while let Some(msg) = ws.next().await {
if let Ok(msg) = msg {
if msg.is_text() {
let event: Value = serde_json::from_str(msg.to_text().unwrap()).unwrap();
println!("{:?}", event);
}
}
}
}
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"nhooyr.io/websocket"
)
func main() {
ctx := context.Background()
c, _, err := websocket.Dial(ctx, "wss://stream.pumpapi.io/", nil)
if err != nil {
log.Fatal(err)
}
defer c.Close(websocket.StatusNormalClosure, "")
for {
_, data, err := c.Read(ctx)
if err != nil {
log.Fatal(err)
}
var event map[string]interface{}
json.Unmarshal(data, &event)
fmt.Println(event)
}
}
Event Schemaβ
Field | Description |
---|---|
signature | Transaction signature on the Solana blockchain. |
mint | Token mint address. |
traderPublicKey | Public key of the trader who initiated the transaction. |
txType | Transaction type β one of create , buy , sell , or migrate . |
tokenAmount | Amount of tokens involved in the transaction. |
solAmount | Amount of SOL involved in the transaction. |
vTokensInBondingCurve | Virtual token reserves in the bonding curve pool. Reflects liquidity available on the token side. |
vSolInBondingCurve | Virtual SOL reserves in the bonding curve pool. Reflects liquidity available on the SOL side. |
price | Price in SOL including this transactionβs impact. |
marketCapSol | Market capitalization in SOL |
pool | Liquidity source. Before migration, the value is either pump or bonk . After migration, pump β pump-amm , bonk β raydium-cpmm . |
timestamp | Blockchain timestamp of transaction. |
Example Eventsβ
- Create Event
- Trade Event
- Migration Event
{
"signature": "2daXd54pi7yqJYb4L2eTygRfZgikXhtbJjsTVb9AANVtucpn36j1bZZZMrT8GCiDjPYtskSBZuQNcURsDyqmhZxH",
"mint": "47zuBTaqGzZnqg6mDYmoKLYobTXAsvnnSiXFus8zbonk",
"traderPublicKey": "Dr7V12M5AcXAC2EEdzMHmwYwgUQbhUcT791szi5pzggw",
"txType": "create",
"initialBuy": 354675353.131364,
"solAmount": 15.0,
"bondingCurveKey": "38LrhTXXNbjtDoZ9DXqJyBZDzHbDn9adcLHRR484zNDu",
"vTokensInBondingCurve": 718350252.465018,
"vSolInBondingCurve": 44.813352951,
"price": 6.238370877886245e-08,
"marketCapSol": 62.38370877886245,
"name": "Planet Nine",
"symbol": "PLANETNINE",
"uri": "https://ipfs.io/ipfs/QmYDs4A8agRDdQCCjxVKPX4VdVUJ7J55gEWJVsuHdH1h75",
"pool": "bonk",
"timestamp": 1752715922584
}
{
"signature": "38UPGck2tq2cNintM1QBPMpC4bN7WkFuDc1spnk5t1dZUYrf7F7pnnkXqtpJLXHkQBDvpcq8nN3inMMa8oEy6DJF",
"mint": "FkCGbzY8Z6ZBm5eRveWeKRrcrPQUbCYYTtz5YWiLbonk",
"traderPublicKey": "GxBthUBnAXxzqLTNHFEn985bUa9cr99g4MGbgeWzDQ8u",
"txType": "buy", # or sell
"tokenAmount": 22350.962176,
"solAmount": 0.136898948,
"vTokensInBondingCurve": 41239031.838106,
"vSolInBondingCurve": 252.093215394,
"price": 6.112976084978284e-06,
"marketCapSol": 6112.976084978284,
"pool": "raydium-cpmm",
"timestamp": 1752716036129
}
{
"signature": "2SkFiG5QdTyffcPcEsbufi4MBKV3MWxPq5Z8zcmtqULpwiiQccdbRh5Bm2ipiEgyr9HodYMpCtsiPV2F4k6efRA5",
"mint": "Abq4jykeNupaBSLbjDkBLU64qogviFUpSG9VKiUypump",
"traderPublicKey": "program",
"txType": "migrate",
"vTokensInBondingCurve":206900000.0,
"vSolInBondingCurve": 84.990361876,
"price": 4.1077990273562105e-07,
"marketCapSol": 410.7799027356211,
"pool": "pump-amm",
"timestamp": 1752805033782
}