Skip to main content
GET
/
trade
/
quote
Get trade quote
curl --request GET \
  --url https://public-api-v2.bags.fm/api/v1/trade/quote \
  --header 'x-api-key: <api-key>'
{
  "success": true,
  "response": {
    "requestId": "<string>",
    "contextSlot": 123,
    "inAmount": "<string>",
    "inputMint": "<string>",
    "outAmount": "<string>",
    "outputMint": "<string>",
    "minOutAmount": "<string>",
    "otherAmountThreshold": "<string>",
    "priceImpactPct": "<string>",
    "slippageBps": 123,
    "routePlan": [
      {
        "venue": "<string>",
        "inAmount": "<string>",
        "outAmount": "<string>",
        "inputMint": "<string>",
        "outputMint": "<string>",
        "inputMintDecimals": 123,
        "outputMintDecimals": 123,
        "marketKey": "<string>",
        "data": "<string>"
      }
    ],
    "platformFee": {
      "amount": "<string>",
      "feeBps": 123,
      "feeAccount": "<string>",
      "segmenterFeeAmount": "<string>",
      "segmenterFeePct": 123
    },
    "outTransferFee": "<string>",
    "simulatedComputeUnits": 123
  }
}

Authorizations

x-api-key
string
header
required

API key authentication. Provide your API key as the header value.

Query Parameters

inputMint
string
required

Public key of the input token mint

outputMint
string
required

Public key of the output token mint

amount
number
required

Amount to swap in the token's smallest unit (e.g., lamports for SOL)

slippageMode
enum<string>
default:auto

Slippage mode: 'auto' for automatic calculation, 'manual' for user-specified slippage

Available options:
auto,
manual
slippageBps
number

Slippage tolerance in basis points (0-10000, where 10000 = 100%). Required when slippageMode is 'manual'

Required range: 0 <= x <= 10000

Response

Successfully retrieved trade quote

success
boolean
required
Example:

true

response
object