PumpSwapApi - HTTP API for Pump.funPumpSwapApi - HTTP API for Pump.fun
Telegram
Telegram
  • Welcome

    • What is PumpSwapApi?
  • Local Transaction API

    • Trade
    • Create token
  • Data API

    • Quote
  • Fees
  • Legal

Get Token Quote

Calculates the estimated amount of tokens receivable for a given amount of SOL, based on the current market price.

Endpoint

POST https://pumpswapapi.fun/api/data/quote

Request Parameters

ParameterTypeRequiredDescription
solAmountnumberYesThe amount of SOL to be exchanged.
tokenstringYesThe mint address of the target token.

Request Body Example

{
  "solAmount": 1.5,
  "token": "6yMUY2SBA9cKT935FxEDG4oEs8fMx3Tfw8SsyKupVfER"
}

Response Parameters

ParameterTypeDescription
tokenAmountnumberThe estimated amount of token tokens receivable for solAmount SOL.
pricenumberThe price of one token token in SOL, as fetched

Response Body Example

{
    "tokenAmount": 6452299.969789664,
    "price": 1.54983e-7
}

Example Usage

Note

The price is fetched from an external oracle and represents the current market rate. The actual executed price may vary due to market volatility and slippage.