Pump.fun API
New tokens, migrations, and price changes
This SolanaStreaming WebSocket API provides live Pump.fun new tokens, migrations and price changes. See example
code snippets for different use cases below.
A Pump.fun token migration appears as a new-pair event on its destination exchange, with
pair.migration set to pumpfun.
Install ws with npm install ws and set
YOUR_API_KEY_HERE. Each example below opens its own authenticated connection.
Subscribe to new Pump.fun tokens
const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
ws.send(JSON.stringify({
method: "newPairSubscribe",
params: { include: { sourceExchange: ["pumpfun"] } }
}));
console.log("Listening for new Pump.fun tokens...");
});
ws.on("message", raw => {
const message = JSON.parse(raw.toString());
if (message.error) return console.error("API error:", message.error);
if (message.params)
console.log("New Pump.fun token:", message.params);
});
ws.on("error", console.error);
Subscribe to Pump.fun migrations
const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
ws.send(JSON.stringify({
method: "newPairSubscribe",
params: { include: { migration: ["pumpfun"] } }
}));
console.log("Listening for Pump.fun migrations...");
});
ws.on("message", raw => {
const message = JSON.parse(raw.toString());
if (message.error) return console.error("API error:", message.error);
if (message.params)
console.log("Pump.fun migration:", message.params);
});
ws.on("error", console.error);
Subscribe to a single Pump.fun token for price changes by mint address
const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
ws.send(JSON.stringify({
method: "swapSubscribe",
params: { include: { baseTokenMint: ["TOKEN_MINT_HERE"] } }
}));
console.log("Listening for Pump.fun token price changes...");
});
ws.on("message", raw => {
const message = JSON.parse(raw.toString());
if (message.error) return console.error("API error:", message.error);
if (message.params)
console.log("Pump.fun token price change:", message.params);
});
ws.on("error", console.error);
Subscribe to a single Pump.fun token for price changes by bonding curve address
const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com/", {
headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
ws.send(JSON.stringify({
method: "swapSubscribe",
params: { include: { ammAccount: ["BONDING_CURVE_ADDRESS_HERE"] } }
}));
console.log("Listening for Pump.fun bonding curve price changes...");
});
ws.on("message", raw => {
const message = JSON.parse(raw.toString());
if (message.error) return console.error("API error:", message.error);
if (message.params)
console.log("Pump.fun bonding curve price change:", message.params);
});
ws.on("error", console.error);
Subscribe to all Pump.fun tokens price changes
const WebSocket = require("ws");
const ws = new WebSocket("wss://api.solanastreaming.com:443/", {
headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
});
ws.on("open", () => {
ws.send(JSON.stringify({
method: "swapSubscribe",
params: { include: { sourceExchange: ["pumpfun"] } }
}));
console.log("Listening for Pump.fun price changes...");
});
ws.on("message", raw => {
const message = JSON.parse(raw.toString());
if (message.error) return console.error("API error:", message.error);
if (message.params)
console.log("Pump.fun price change:", message.params);
});
ws.on("error", console.error);
Use swap.quotePrice, swap.usdValue, and
swap.swapType with the event's slot and block time to process price changes. QuotePrice
is denoted in the quote token of the swap. To get the usdPrice you must convert the quoteToken to USD.
See new-pair fields, swap fields, and connection details.
Pump.fun WebSocket API FAQ
How do I detect a Pump.fun token migration?
Subscribe to newPairSubscribe with migration: ["pumpfun"] and check
pair.migration. The event describes the new pool on the destination exchange.
Does the API provide continuous Pump.fun price data?
Yes. swapSubscribe reports individual observed swaps and their price fields, such as
quotePrice. Build any price series from those trade events in your application.