Trade
Get trade quote
Get a quote for swapping tokens. Returns expected output amount, price impact, slippage, and route plan.
get/trade/quote
Request
- Base URLhttps://public-api-v2.bags.fm/api/v1
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
inputMintstring required
Public key of the input token mint
outputMintstring required
Public key of the output token mint
amountnumber required
Amount to swap in the token's smallest unit (e.g., lamports for SOL)
slippageMode'auto' | 'manual'
Slippage mode: 'auto' for automatic calculation, 'manual' for user-specified slippage
slippageBpsnumber
Slippage tolerance in basis points (0-10000, where 10000 = 100%). Required when slippageMode is 'manual'
Response
Successfully retrieved trade quote
Example response
{
"success": true
}Changes
No recorded changes to this operation across all 1 revision of this API.