Buy Pump.fun Token

POST

Buy a Pump.fun token from Rest API.

This endpoint is available to all users. Using this endpoint levels up your account and wallet.

Request Body

mint

(string)

The mint address of the token.

fromWallet

(string)

The id of the wallet buying the token.

amountInLamports

(number)

The amount of Sol to spend on the token buy.

feePayer

(string) nullable

The id of the wallet paying for the transaction.

slippage

(number) nullable

The slippage percentage for the transaction.

priorityUnitLimit

(number) nullable

The maximum amount of priority units the user is willing to pay for the transaction.

priorityUnitPrice

(number) nullable

The priority unit price for the transaction.

Response

result

(object)

An object containing the solana balance of the wallet.


mint

(string)

The mint address of the token.

wallet

(string)

The id of the wallet buying the token.

buyAmount

(number)

The amount of token bought.

preTokenBalance

(number)

The balance of the token before the buy.

postTokenBalance

(number)

The balance of the token after the buy.

signature

(string) nullable

The signature of the transaction.

transactionResult

(object)

The result of the transaction.

tokenAccount

(string)

The token account address.

solscan

(object)

An object containing Solana Explorer URLs for the wallet.


mint

(string)

The Solana Explorer URL for the token mint.

wallet

(string)

The Solana Explorer URL for the wallet.

tx

(string)

The Solana Explorer URL for the transaction.

tokenAccount

(string)

The Solana Explorer URL for the token account address.

pumpfun

(object)

An object containing the Pump.fun URL for the token.


mint

(string)

The Pump.fun URL for the token.

Useful for

  • Buying a Pump.fun token.

  • Building a Pump.fun token sniper bot.

Endpoint

https://api.tradepump.fun/v1/trade/buy

Example Request

Node
Curl
Axios
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import { PumpApiClient } from 'tradepumpfun'; const client = new PumpApiClient({ apiKey: '<your-api-key>' }); await client.trade.buy({ mint: "<mint>", fromWallet: "<wallet>", amountInLamports: 1000000000, feePayer: null, slippage: 500, priorityUnitLimit: null, priorityUnitPrice: null, });

Response Example

{ "result": { "mint": "<:mint>", "wallet": "<:id>", "buyAmount": 1000000000, "preTokenBalance": 0, "postTokenBalance": 1000000000, "signature": "<:signature>", "transactionResult": { "success": true, "signature": "<:signature>", "results": "<:tx-result>" }, }, "solscan": { "mint": "https://solscan.io/token/<:mint>", "wallet": "https://solscan.io/account/<:id>", "tx": "https://solscan.io/tx/<:signature>" }, "pumpfun": { "mint": "https://pump.fun/coin/<:mint>" } }