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. |
mintMethod | At the moment, it is only present in raydium-cpmm events. This indicates the method by which the token was minted. If the token was minted through Bonk, the value is "bonk". If it was minted through other methods or manually, the value is "custom". |
block | Block number in which the transaction was included. New blocks are produced every 400 ms |
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",
"block": 353800518,
"timestamp": 1752715922584
}
{
"signature": "5tBm1SLayfNNiCygzjbLDyDEejgVywDKhxfXrPHPmLZkxenPgJwo9ytiWBKodPPQR2giNg8TCEcvsogxmRhFjq4m",
"mint": "5vnrQYeEprdPxHKK7bqRnzaAVQHNEGLU7TrM6MpRqxup",
"traderPublicKey": "3TofRdzMWUKnB1R7AXAvEvfqw6gdoEzXVqKBCtMGKHVp",
"txType": "sell",
"tokenAmount": 6167352.118172,
"solAmount": 1.203486555,
"vTokensInBondingCurve": 229913877.285415,
"vSolInBondingCurve": 43.793440503,
"price": 1.9047758673842397e-7,
"marketCapSol": 190.47758673842398,
"pool": "raydium-cpmm",
"mintMethod": "bonk", # or 'custom'
"block": 371212425,
"timestamp": 1759611786472
}
{
"signature": "2SkFiG5QdTyffcPcEsbufi4MBKV3MWxPq5Z8zcmtqULpwiiQccdbRh5Bm2ipiEgyr9HodYMpCtsiPV2F4k6efRA5",
"mint": "Abq4jykeNupaBSLbjDkBLU64qogviFUpSG9VKiUypump",
"traderPublicKey": "program",
"txType": "migrate",
"vTokensInBondingCurve":206900000.0,
"vSolInBondingCurve": 84.990361876,
"price": 4.1077990273562105e-07,
"marketCapSol": 410.7799027356211,
"pool": "pump-amm",
"block": 354025548,
"timestamp": 1752805033782
}