NoLimitNodes
PricingDocsBlogAbout
SupportContact
Log in
Blog/Guides

Pump.fun WebSocket New-Token Stream: Real-Time Launches

It's 4 am and you're smashing the refresh button trying to get in on new tokens as soon as they launch. Wouldn't it be better to have a bot that hands you pump.fun token addresses the moment they're created?

N
NoLimitNodes Team
Community & Tutorials
Dec 24, 2024updated Aug 25, 20264 min read
On this page +
  • 01What Do I Need To Start?
  • 02What We're Building with a Pump.fun WebSocket
  • 03Registering An Account
  • 04Understanding Pump.fun WebSocket Events
  • 05Building a Pump.fun WebSocket Token Stream

It's 4 am and you're smashing the refresh button trying to get in on new tokens as soon as they launch. Wouldn't it be better to have a bot that hands you pump.fun token addresses the moment they're created? That's exactly what we're building today: a small Python script that streams newly launched tokens in real time.

Pump.fun WebSocket real-time token launch stream illustration
Probably you after this tutorial with a newly launched token stream coming in on your vertical monitor.

What Do I Need To Start?

  1. Python installed (any version is fine, but if you're still on < 2.x, seriously, why? Upgrade to 3.x+)
  2. 10 minutes (probably just 5 if you're into speedrunning).

What We're Building with a Pump.fun WebSocket

We're going to build a Python app that listens to pump.fun for any tokens that just got created and prints them to the console. Before we get started, let's get you a free-forever API key.

Registering An Account

Head over to nolimitnodes.com and click on Start Building to get an account.

NoLimitNodes account setup for the Pump.fun WebSocket API

Once you have registered, click on the Get button to get your free API key.

Pump.fun WebSocket API key dashboard

You should then see your generated API key.

Pump.fun WebSocket token stream API key example

Click copy and take a note of your API key. You'll need it for the rest of this tutorial.

Understanding Pump.fun WebSocket Events

Before we get our hands dirty, let's talk about what the WebSocket request and response look like.

We'll start by establishing a WebSocket connection with wss://api.nolimitnodes.com/pump-fun?api_key=YOUR_API_KEY

Once we have the socket connection open, we're going to send this request:

{
    "method": "pumpFunCreateEventSubscribe",
    "params": {
        "eventType": "coin",
        "referenceId": "litrally-anything-here-to-use-as-reference"
    }
}

Once we send this in, we'll get a confirmation that the subscription request succeeded, like this:

{
    "status": "Create Event Subscribed",
    "subscription_id": "9c37a3e8-d39b-497c-902d-162e19a0bcda",
    "reference_id": "litrally-anything-here-to-use-as-reference"
}

After the confirmation message, we'll keep getting a real-time stream of coins as they get created. Coin creation events come back in this format:

{
  "method": "createEventNotification",
  "result": {
    "metadata": {
      "network": "solana",
      "chain": "mainnet-beta",
      "block": "308709941"
    },
    "timestamp": "1734713628",
    "name": "TRUMPCOIN",
    "symbol": "TRUMPCOIN",
    "uri": "https://ipfs.io/ipfs/QmSSme2anrzV4NWrofS3uzXTq9B1L5Jxy54FgvPcrAsrhe",
    "mint": "CWVtv9SQMVibEqzFBLy5FZdLhozzZzRDBbX9HGnypump",
    "bondingCurve": "HZzaNo92zpqqyTb3pBr5P9fAJ7GT9xnSAxygWLbgUV7X",
    "associatedBondingCurve": "BnNAk9AtBvQS3vmv9UpkEoAqPAC96PMUig9HtMdJescU",
    "creator_wallet": {
      "address": "91U3uKcD2EuC7eW8bbBtC7ftwrNpmgGmJQFpgBZbaBAB"
    },
    "event_type": "create_coin"
  },
  "subscription_id": "litrally-anything-here-to-use-as-reference"
}

There's a ton of valuable information in this message. Let me break it down for you.

  1. block - The block number when this token was created.
  2. timestamp - The unix timestamp when this token was created.
  3. name - The token name.
  4. symbol - The token's ticker.
  5. uri - The token's metadata, like the token image.
  6. mint - The token's address.
  7. bondingCurve - That's the account that sells/buys from you when you try to buy/sell.
  8. associatedBondingCurve - That's the token account the bondingCurve uses to store the tokens for this specific token.
  9. address - That's the wallet address of the degen who launched the token.

That's everything you need to know about the format. Let's get coding.

Pump.fun WebSocket token creation event animation

Building a Pump.fun WebSocket Token Stream

Fire up your favourite IDE (I use PyCharm) and create a new script called token_creation_watcher.py.

Start by importing websocket and json.

import websocket
import json

Let's set up the WebSocket connection next (don't forget to replace YOUR_API_KEY with your actual API key).

import websocket
import json

socket_url = "wss://api.nolimitnodes.com/pump-fun?api_key=YOUR_API_KEY"

ws = websocket.WebSocketApp(
  socket_url, 
  on_open=on_open, # we havent defined this method just yet.
  on_message=on_message, # we havent defined this method just yet.
  on_close=on_close, # we havent defined this method just yet.
  on_error=on_error # we havent defined this method just yet.
)
ws.run_forever()

This is all it takes to establish a WebSocket connection. Now let's send a subscription message to start getting a stream of newly created tokens.

import websocket
import json

def on_open(ws):
    subscribe_message = {
        "method": "pumpFunTradeSubscribe",
        "params": {
            "coinAddress": "all",
            "referenceId": "1"
        }
    }
    ws.send(json.dumps(subscribe_message))

socket_url = "wss://api.nolimitnodes.com/pump-fun?api_key=YOUR_API_KEY"

ws = websocket.WebSocketApp(
  socket_url, 
  on_open=on_open,
  on_message=on_message,
  on_close=on_close,
  on_error=on_error
)
ws.run_forever()

Next, let's create the on_message method to receive the coin creation events.

import websocket
import json

def on_open(ws):
    subscribe_message = {
        "method": "pumpFunTradeSubscribe",
        "params": {
            "coinAddress": "all",
            "referenceId": "1"
        }
    }
    ws.send(json.dumps(subscribe_message))

def on_message(ws, message):
    print("Received data:", json.loads(message))

socket_url = "wss://api.nolimitnodes.com/pump-fun?api_key=YOUR_API_KEY"

ws = websocket.WebSocketApp(
  socket_url, 
  on_open=on_open,
  on_message=on_message,
  on_close=on_close,
  on_error=on_error
)
ws.run_forever()

To finish up, we'll also add the on_close and on_error methods to gracefully handle disconnects and errors. For this tutorial, we'll just print them.

import websocket
import json

def on_open(ws):
    subscribe_message = {
        "method": "pumpFunTradeSubscribe",
        "params": {
            "coinAddress": "all",
            "referenceId": "1"
        }
    }
    ws.send(json.dumps(subscribe_message))

def on_message(ws, message):
    print("Received data:", json.loads(message))

def on_close(ws, close_status_code, close_msg):
    print("Disconnected from WebSocket")

def on_error(ws, error):
    print("WebSocket error:", error)

socket_url = "wss://api.nolimitnodes.com/pump-fun?api_key=YOUR_API_KEY"

ws = websocket.WebSocketApp(
  socket_url, 
  on_open=on_open,
  on_message=on_message,
  on_close=on_close,
  on_error=on_error
)
ws.run_forever()

That's it. You're done.

If you want to check out the other pump.fun APIs, head over to https://nolimitnodes.com/blog/pump-fun-websocket-build-a-real-time-crypto-trading-bot-with-nolimitnodes-price-data/

If you're stuck anywhere or need general consulting on anything crypto related, I'm happy to help. You can email me at [email protected]. I usually check my email once a day.

- Cheers

#Pumpfun WebSocket#solana#pumpfun#websocket#tutorial
N
NoLimitNodes Team
Community & Tutorials

Tutorials, market notes, and product walkthroughs from across the NoLimitNodes team.

On this page
  • 01What Do I Need To Start?
  • 02What We're Building with a Pump.fun WebSocket
  • 03Registering An Account
  • 04Understanding Pump.fun WebSocket Events
  • 05Building a Pump.fun WebSocket Token Stream
↑ back to top
///Read next
GuidesJan 27, 2025

Pump.fun WebSocket Drawdown Trading Bot: Pullback Strategy

Part three of the Pump.Fun trading bot series covers drawdown trading: the bot tracks each token's peak price over WebSocket, waits for a defined percentage drop, then buys the recovery off the trough and exits on a…

#Pumpfun WebSocket#solana#pumpfun
6 min read
GuidesFeb 4, 2025

Pump.fun WebSocket Guide: Build a Crypto Trading Bot for Popular Coins

The fourth bot in the Pump.Fun series trades on popularity rather than price action alone: it counts unique wallets interacting with each token over the live WebSocket trade stream, buys once the wallet count crosses a…

#solana#pumpfun#websocket
6 min read
///Relevant Solana infrastructure
Solana WebSocket Nodes

Standard Solana subscriptions for account, program, slot, and transaction updates.

Explore Solana WebSocket Nodes →
Solana Enhanced Streams

Decoded swaps, token lifecycle events, transfers, and system feeds.

Explore Solana Enhanced Streams →
Pump.fun Enhanced Stream

Decoded Pump.fun launches, trades, graduations, and lifecycle events.

Explore Pump.fun Enhanced Stream →
← Older
Pump.Fun WebSocket: Build a Real-Time Crypto Trading Bot with NoLimitNodes Price Data
Newer →
Mastering Pump.fun trade with WebSocket Series : Buy , Book profit and set stop loss with NoLimitNodes Data
Run it yourself

Every benchmark in this blog runs against our public endpoints.

Spin up an RPC, WebSocket, or gRPC endpoint in under a minute. Flat pricing, no request caps. Reproduce the numbers for your own workload.

See pricing

Ready to get started?

Choose a plan and start building in under 30 seconds.

Talk to Sales
NoLimitNodes

Solana RPC infrastructure built for performance and scale.

RPC Access
  • Solana HTTP RPC nodes
  • Solana WebSocket nodes
  • Yellowstone gRPC nodes
  • Solana Shredstream
  • UltraSend transaction relay
Infrastructure
  • Compute Platform
  • VPS
  • VDS
  • Bare Metal
  • Geyser Plugin Hosting
Enhanced Streams
  • PumpFun
  • PumpSwap
  • Raydium
  • Orca
  • Meteora
  • System Events
  • Browse all Solana Enhanced Streams →
Program Streams
  • PumpFun
  • PumpSwap
  • Raydium CLMM
  • Orca Whirlpool
  • Meteora DLMM
  • Jupiter Swap
  • Jupiter Perps
  • Kamino Lending
  • Browse all 37 Solana programs →
Trading
  • EZWallet
Analytics
  • Historical Datasets
  • Historical Raw Blocks
Company
  • About
Resources
  • Pricing
  • RPC Rate Limits
  • Custom Development
  • Documentation
  • Blog
  • System Status
  • Support
  • Contact Sales
Compare
  • Yellowstone gRPC vs LaserStream
  • Triton vs Helius
  • Raydium API vs Helius
  • PumpSwap API vs Bitquery
  • QuickNode Streams vs NLN
  • All comparisons →
Legal
  • Terms & Conditions
  • Privacy Policy
© 2026 CLR3 Inc., operating as NoLimitNodes. Registered in Ontario, Canada. All rights reserved.solana mainnet