Real-time Token Aggregation
Connect to the PumpPortal WebSocket at: wss://pumpfunscreener.com/api/data
.
This stream provides real-time aggregated trading data for tokens created on Pump.fun. The server supports only one subscription method and one type of payload.
✅ Supported Method
subscribeTokenAggregation
Subscribe to aggregated token updates across the Pump.fun ecosystem.
You only need to send this method once per connection. Closing the WebSocket will automatically stop the stream—no explicit unsubscribe
is needed.
📦 Payload Format
You must send the following message after connecting:
{
"action": "subscribe",
"topic": "subscribeTokenAggregation"
}
Usage Examples
- JavaScript
- Python
import WebSocket from 'ws';
const ws = new WebSocket('wss://pumpfunscreener.com/api/data');
ws.on('open', () => {
console.log('Connected to WebSocket server');
ws.send(JSON.stringify({ action: 'subscribe', topic: 'subscribeTokenAggregation' }));
});
ws.on('message', (data) => {
const message = JSON.parse(data);
console.log('Received aggregation:', message);
});
// Close connection to stop streaming
setTimeout(() => ws.close(), 10000); // Stops after 10 seconds
import asyncio
import websockets
import json
async def main():
uri = "wss://pumpfunscreener.com/api/data"
async with websockets.connect(uri) as websocket:
await websocket.send(json.dumps({"action": "subscribe", "topic": "subscribeTokenAggregation"}))
async for message in websocket:
data = json.loads(message)
print("Received aggregation:", data)
# Run the listener
asyncio.run(main())
Received data Example
{
"time": "2025-03-31T15:57:47.451Z",
"age": 1588.254,
"mint": "AZoRLqw9XHiZShASgM8Lh4LQRBNqHS4wSmtLzmRcpump",
"symbol": "",
"lastPrice": 2.3792005476236903e-7,
"priceChanged5sec": -0.9856558530545358,
"priceChanged10sec": -3.0229512526977573,
"priceChanged30sec": -4.493443375678899,
"priceChanged1min": -2.684657358858088,
"priceChanged5min": -3.29427400754686,
"priceChanged10min": 13.574088647506596,
"totalTrades": 3031,
"countOfBuys": 1690,
"countOfSells": 1341,
"amountInWallets": 10505519302.734539,
"totalHolders": 86,
"top10Traders": [
{"trader": "HAN61KQbgzjDBC4RpZJ1ET8v32S4zdKAjoD7EApJ96q6", "percent": 7.2107825769993905},
{"trader": "CFpFtatJUBj1tbTV5tCHHLUriPRBxSpqqg4evXDJXdKC", "percent": 5.852630336446155},
{"trader": "FbVbRbGqLk7DtprRHV1THa26ynoRZjUC6RuAxT9yaohM", "percent": 3.9395700437951957},
{"trader": "8CuHzxZvrmrkfeDgd8r7grugasVpZBLsGMvGsVrb5Fnm", "percent": 3.781979994650993},
{"trader": "2BcPmw6acbbATvU7xhdx3H8toDbkG7EyWeuiagEz3Fgc", "percent": 3.210596904159434},
{"trader": "Cv778SjPepXHAhbSwKGaN8UK697paYWh7PEzqmwqFSSD", "percent": 3.191921932814776},
{"trader": "2YccFbKBnGtCne2DdHAyLnybUAfwpmVy4A7URAb91qhQ", "percent": 2.962311352752224},
{"trader": "AxnuoEMdrFRJHGtoiotpzv3UQTWbeGuppA2Cj3G6Fguk", "percent": 2.9054128098257497},
{"trader": "8ak5XQ9eqWcdjux7UejCfyyQrybd1P6UWgbjd5v1iwoU", "percent": 2.752652745247176},
{"trader": "5T229oePmJGE5Cefys8jE9Jq8C7qfGNNWy3RVA7SmwEP", "percent": 2.646368030295263}
],
"lastSignature": "2w2aU1FQyRTYo17uocJ2BE2YRJmcs81fSazG6eVQVub1EiVh8TdqaikWgVJpv9E6LazyttEhyjDREr3CBYbWFQSf"
}
Notes
You don't need to manage subscriptions manually. Just open a WebSocket, send the subscription message, and stream begins.
To stop streaming, simply close the WebSocket connection.
Make sure to keep the connection alive if you want to continue receiving data.