Skip to content
Swaps

Quote the best direct pool

GET
/v1/swap/quote

Provide the input/output mint pair and amount; no pool address is required or accepted. Compares up to 50 indexed candidates using the native engine, including fees and liquidity. ExactIn maximizes output; ExactOut minimizes input. Ties use lexical pool address order. 404 NO_POOLS means the pair is absent; 422 NO_QUOTABLE_POOL means no supported pool can fill the whole amount. RPC failures abort selection with 503, never a partial ranking. Exceeding 50 candidates returns 422 TOO_MANY_POOLS.

Authorization

IntegrationKey
headerx-api-key<token>

Integration credential issued to your team. All team keys share the same request quota.

Query Parameters

inputMint*string

SPL mint to sell. Paired with outputMint for automatic pool selection.

Match^[1-9A-HJ-NP-Za-km-z]{32,44}$
Formatsolana-address
outputMint*string

SPL mint to receive; must differ from inputMint.

Match^[1-9A-HJ-NP-Za-km-z]{32,44}$
Formatsolana-address
amount*string

Positive u64 token atoms as a decimal string. Input atoms for ExactIn; output atoms for ExactOut. For 6 decimals, 1000000 represents one token.

Match^[1-9][0-9]{0,19}$
Lengthlength <= 20
swapMode?string

ExactIn fixes input and maximizes output; ExactOut fixes output and minimizes input.

Default"ExactIn"
Value in"ExactIn""ExactOut"
slippageBps?integer

Slippage tolerance in basis points: 50 = 0.5%. Sets the returned threshold; does not change which pool has the best nominal quote.

Range0 <= value <= 10000
Default50
taker?string

Optional wallet context for future contextual adapters. Providing an address is not proof of authorization.

Match^[1-9A-HJ-NP-Za-km-z]{32,44}$
Formatsolana-address

Response Body

Successful request

application/json
  1. response
success*true
Value intrue
data*
curl -X GET '{GRAPL_API_ORIGIN}/v1/swap/quote?inputMint=string&outputMint=string&amount=string' \  -H 'x-api-key: {GRAPL_API_KEY}'

Captured from the API's isolated selection-test fakes. Test addresses and amounts illustrate the contract, not a market quote. Only the random request ID is normalized.

{  "success": true,  "data": {    "pool": "11111111111111111111111111111111",    "requestId": "isolated-selection-fixture",    "inputMint": "11111111111111111111111111111111",    "outputMint": "So11111111111111111111111111111111111111112",    "inAmount": "1000",    "outAmount": "990",    "otherAmountThreshold": "985",    "swapMode": "ExactIn",    "slippageBps": 50,    "priceImpactPct": null,    "contextSlot": "42",    "expiresAt": "2026-10-12T12:30:10.000Z",    "fees": [      {        "mint": "11111111111111111111111111111111",        "amount": "3",        "kind": "trade"      }    ]  }}

The interactive playground is unavailable because no service origin is configured. Replace {GRAPL_API_ORIGIN} and {GRAPL_API_KEY} with your deployment values, and provide valid values for the schema-generated request inputs before running a sample. Responses without captured examples show Empty; the response schema remains available.

All public endpoints · OpenAPI JSON