API for pump.fun
We provide RPC for you, so that the transaction is faster, and better
import fetch from "node-fetch";
const url = 'https://pumpclown.zeabur.app/transaction/Buy';
const data = {
mintAddress: "14uNeiwwemx6iEDcNfHrmdLuM6p3bTNzABaGjPggfuCk", // token address
amount: 0.01, // In solana
slippageDecimal: 0.02, // Slippage in percentage, 0.02 mean 2% slippage
priorityFee: 0, // by default it uses 0.000005 solana per transaction, if set to 0.1 then total transaction would be 0.000005 + 0.1 solana
secretKeypair: "xxx"
};
fetch(url, {
method: 'POST', // Specify the request method
headers: {
'Content-Type': 'application/json' // Set the content type to JSON
},
body: JSON.stringify(data) // Convert the data to a JSON string
})
.then(response => {
if (!response.ok) {
// Handle HTTP errors
throw new Error(`HTTP error! status: ${response.status}`);
}
// Check if the response is JSON
const contentType = response.headers.get('content-type');
if (contentType && contentType.includes('application/json')) {
return response.json(); // Parse JSON response
} else {
return response.text(); // Parse text response
}
})
.then(responseData => {
console.log('Success:', responseData); // Log the response data
})
.catch(error => {
console.error('Error:', error); // Log any errors
});
import fetch from "node-fetch";
const url = 'https://pumpclown.zeabur.app/transaction/Sell';
const data = {
mintAddress: "14uNeiwwemx6iEDcNfHrmdLuM6p3bTNzABaGjPggfuCk", // token address
sellPercent: 100, // In percentage 100 means 100%
slippageDecimal: 0.02, // Slippage in percentage, 0.02 mean 2% slippage
priorityFee: 0, // by default it uses 0.000005 solana per transaction, if set to 0.1 then total transaction would be 0.000005 + 0.1 solana
secretKeypair: "xxx"
};
fetch(url, {
method: 'POST', // Specify the request method
headers: {
'Content-Type': 'application/json' // Set the content type to JSON
},
body: JSON.stringify(data) // Convert the data to a JSON string
})
.then(response => {
if (!response.ok) {
// Handle HTTP errors
throw new Error(`HTTP error! status: ${response.status}`);
}
// Check if the response is JSON
const contentType = response.headers.get('content-type');
if (contentType && contentType.includes('application/json')) {
return response.json(); // Parse JSON response
} else {
return response.text(); // Parse text response
}
})
.then(responseData => {
console.log('Success:', responseData); // Log the response data
})
.catch(error => {
console.error('Error:', error); // Log any errors
});
import requests
url = 'https://pumpclown.zeabur.app/transaction/Buy'
data = {
"mintAddress": "14uNeiwwemx6iEDcNfHrmdLuM6p3bTNzABaGjPggfuCk",
"amount": 0.01, # In solana
"slippageDecimal": 0.02, # Slippage in percentage, 0.02 mean 2% slippage
"priorityFee": 0, # by default it uses 0.000005 solana per transaction, if set to 0.1 then total transaction would be 0.000005 + 0.1 solana
"secretKeypair": "xxx"
}
try:
response = requests.post(url, json=data)
response.raise_for_status() # Raise HTTPError for bad responses (4xx and 5xx)
# Check if the response is JSON
if response.headers.get('Content-Type') == 'application/json':
response_data = response.json()
else:
response_data = response.text
print('Success:', response_data)
except requests.exceptions.RequestException as e:
print('Error:', e)
import requests
url = 'https://pumpclown.zeabur.app/transaction/Sell'
data = {
"mintAddress": "14uNeiwwemx6iEDcNfHrmdLuM6p3bTNzABaGjPggfuCk",
"sellPercent" : 100, # In percentage 100 means 100%
"slippageDecimal": 0.02, # Slippage in percentage, 0.02 mean 2% slippage
"priorityFee": 0, # by default it uses 0.000005 solana per transaction, if set to 0.1 then total transaction would be 0.000005 + 0.1 solana
"secretKeypair": "xxx"
}
try:
response = requests.post(url, json=data)
response.raise_for_status() # Raise HTTPError for bad responses (4xx and 5xx)
# Check if the response is JSON
if response.headers.get('Content-Type') == 'application/json':
response_data = response.json()
else:
response_data = response.text
print('Success:', response_data)
except requests.exceptions.RequestException as e:
print('Error:', e)
Every transaction will cost 0.25% of fee of total transaction amount