get_swap_quote
Obtain price quotes and unsigned transactions for Solana swaps. Free API call that doesn't execute, enabling transaction preparation.
Instructions
Get a swap quote and unsigned transaction from Jupiter Ultra API.
This function is FREE to call and does not execute any transactions. Use this to get price quotes and prepare transactions for execution.
Args: input_mint: The input token mint address (e.g., SOL: "So11111111111111111111111111111111111111112") output_mint: The output token mint address (e.g., USDC: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v") amount: The amount of input token to swap in smallest unit (e.g., "1000000" = 0.001 SOL)
Returns: Dictionary containing: - success: Boolean indicating if the request was successful - data: Contains 'transaction' (unsigned) and 'requestId' for execution - error: Error message if request failed
Example: >>> result = await api.get_swap_quote( ... input_mint="So11111111111111111111111111111111111111112", # SOL ... output_mint="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC ... amount="1000000" # 0.001 SOL ... ) >>> if result["success"]: ... transaction = result["data"]["transaction"] ... request_id = result["data"]["requestId"]
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_mint": "<input_mint>",
"output_mint": "<output_mint>",
"amount": "<amount>"
},
"name": "get_swap_quote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | ||
| input_mint | Yes | ||
| output_mint | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||