Managed Trading API Docs
To buy or sell a Pump.fun token with the funds in your wallet, send a POST request to
https://pumpportal.fun/api/trade?api-key=your-api-key-here
Once the transaction passes a simulation check, a response is sent with the transaction signature or error(s).
PumpPortal will attempt to land your transaction using multiple RPC nodes, as well as sending your transaction as a Jito bundle.
Your request body must contain the following options:
action
: "buy" or "sell"mint
: The contract address of the token you want to trade (this is the text after the '/' in the pump.fun url for the token.)amount
: The amount of SOL or tokens to trade. If selling, amount can be a percentage of tokens in your wallet (ex. amount: "100%")denominatedInSol
: "true" if amount is SOL, "false" if amount is tokensslippage
: The percent slippage allowedpriorityFee
: Amount to use as priority fee or Jito tippool
: (optional) Currently 'pump' and 'raydium' are supported options. Default is 'pump'.
Examples
- Python
- JavaScript
- CURL
import requests
response = requests.post(url="https://pumpportal.fun/api/trade?api-key=your-api-key-here", data={
"action": "buy", # "buy" or "sell"
"mint": "your CA here", # contract address of the token you want to trade
"amount": 100000, # amount of SOL or tokens to trade
"denominatedInSol": "false", # "true" if amount is amount of SOL, "false" if amount is number of tokens
"slippage": 10, # percent slippage allowed
"priorityFee": 0.005, # amount to use as Jito tip or priority fee
"pool": "pump" # exchange to trade on. "pump" or "raydium"
})
data = response.json() # Tx signature or error(s)
const response = await fetch("https://pumpportal.fun/api/trade?api-key=your-api-key-here", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"action": "buy", // "buy" or "sell"
"mint": "your CA here", // contract address of the token you want to trade
"amount": 0.01, // amount of SOL or tokens to trade
"denominatedInSol": "true", // "true" if amount is SOL, "false" if amount is tokens
"slippage": 10, // percent slippage allowed
"priorityFee": 0.005, // amount to use as Jito tip or priority fee
"pool": "pump" // exchange to trade on. "pump" or "raydium"
})
});
const data = await response.json(); // JSON object with tx signature or error(s)
curl -L \
-X POST \
-H 'Content-Type: application/json' \
'https://pumpportal.fun/api/trade?api-key=your-api-key-here' \
-d '
{
"action": "buy",
"mint": "your CA here",
"amount": 0.01,
"denominatedInSol": "true",
"slippage": 10,
"priorityFee": 0.005,
"pool": "pump"
}
'