Websocket API
Subscribe to the WS to catch up (real time) the completed information about the tokens being created on the PumpFun. Entrypoint address:
https://pumpzone.fun/api/v2/ws
Through WS, a JSON structure will be transmitted that contains:
- signature — Transaction signature
- signature_url — solscan.io link to a transaction
- mint — Token address (base58)
- creator — Creator public key (base58)
- action — Actions: «create»
- initial_buy — First buy (tokens)
- amount_sol — First buy (SOL)
- bonding_curve — A pool address (base58)
- virtual_tokens — Tokens in a pool
- virtual_sol — SOL in a pool
- market_cap — Market capitalization
- token_name — Token name
- token_symbol — Token symbol
- token_url — URL address (token meta-data)
Examples
import asyncio
import websockets
import json
async def subscribe():
async with websockets.connect('wss://pumpzone.fun/api/v2/ws') as websocket:
async for message in websocket:
print(json.loads(message))
asyncio.get_event_loop().run_until_complete(subscribe())
import WebSocket from 'ws';
const ws = new WebSocket('wss://pumpzone.fun/api/v2/ws');
ws.on('open', () => {console.log('WS has opened')});
ws.on('message', (data) => {console.log(JSON.parse(data))});
ws.on('close', () => {console.log('WS has closed')});
{
"signature": "652F7a4cA3bg6SdTvXFywTr2uf3oAie43xnzcvUiuDMNFeb1xww66WPHXDMxaDQfychjhMKJ4KLGGs9L9ZppmJim",
"signature_url": "https://solscan.io/tx/652F7a4cA3bg6SdTvXFywTr2uf3oAie43xnzcvUiuDMNFeb1xww66WPHXDMxaDQfychjhMKJ4KLGGs9L9ZppmJim",
"mint": "5xQqR3Mx4JZQWhPpzxgVUNo3oFS7Uv5nL5XXELcSRRh5",
"creator": "BwaVFCDJ4HfRfFWq1S23LHkk5VF4GKEw9oz7F1PxgcHv",
"action": "create",
"initial_buy": 153285714.285714,
"amount_sol": 5,
"bonding_curve": "EGnkW8m1LSHHj8rUHvwbXtYVMerWzQXcWZuKnM3NeELa",
"virtual_tokens": 919714285.714286,
"virtual_sol": 34.99999999999999,
"market_cap": 38.05529667598631,
"token_name": "STUMP THE TRUMP",
"token_symbol": "STT",
"token_url": "http://134.195.157.197/json/4d4c2fb3-25b3-4420-ae9b-be26f3677628"
}