Pumpfun Trading API
Trade API
Place the buy and sell order for pumpfun tokens
To place a buy or sell trade for Pump.fun tokens, send a POST request to:
We will try to land your transaction as fast as possible!
Endpoint URL: https://pumpapi.fun/api/trade
Your request body must contain the following Parameters:
Parameter | Example | Description | Required |
---|---|---|---|
trade_type | Buy or sell | ”buy” or “sell” to specify trade type | Yes |
mint | Token mint address | Token mint address | Yes |
amount | Value in of SOL/Tokens | Amount of SOL or tokens to trade | Yes |
slippage | Desired slippage | Slippage allowed (integer) | Yes |
priorityFee | Value in SOL (optional) | Amount to use as priority fee (optional) In SOL | No |
userPrivateKey | wallet privatekey | The wallet used the sign the transaction in string format (Phantom wallet’s key format) | Yes |
Note Amount in SOL , if buying or of tokens if selling.
Accepted Parameters:
The API accepts all parameters listed in the table above.
Examples Usage:
Response Type:
The API returns JSON data upon successful execution:
It returns the transaction hash.
Note:
This endpoint requires private key to sign the Tx, our server don’t store the keys. If you need to self sign then get a transaction on Trade Transaction endpoint instead.
Error Codes
400 Bad Request
: Invalid request parameters or missing required fields.401 Unauthorized
: Authentication failed.404 Not Found
: The requested resource (endpoint) is not found.429 Too Many Requests
: Rate limit exceeded.500 Internal Server Error
: Unexpected server-side error.
API Codes
200 OK
: The request was successful.