Get swap quote
curl --request GET \
--url https://raptor.solanatracker.io/quoteimport requests
url = "https://raptor.solanatracker.io/quote"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://raptor.solanatracker.io/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://raptor.solanatracker.io/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://raptor.solanatracker.io/quote"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://raptor.solanatracker.io/quote")
.asString();require 'uri'
require 'net/http'
url = URI("https://raptor.solanatracker.io/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"minAmountOut": "11645275",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"priceImpact": 0,
"percent": 100
}
],
"swapUsdValue": "11.72",
"platformFee": {
"feeBps": 0,
"feeFromInput": false,
"chargeBps": 0
},
"contextSlot": 454215309,
"timeTaken": 0.026,
"quoteId": "AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU",
"searchMode": "fast"
}{
"error": "Invalid amount: must be greater than 0",
"code": 400
}{
"error": "Failed to get quote: No multi-hop route found",
"code": 422
}{
"error": "Failed to get quote: No multi-hop route found",
"code": 500
}{
"error": "<string>",
"code": 123
}API Reference
Get a Solana Swap Quote with Raptor
Find the best route for a Solana swap and get the expected output. No wallet needed. Pass the response to POST /swap within a few seconds. GET /quote.
GET
/
quote
Get swap quote
curl --request GET \
--url https://raptor.solanatracker.io/quoteimport requests
url = "https://raptor.solanatracker.io/quote"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://raptor.solanatracker.io/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://raptor.solanatracker.io/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://raptor.solanatracker.io/quote"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://raptor.solanatracker.io/quote")
.asString();require 'uri'
require 'net/http'
url = URI("https://raptor.solanatracker.io/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"minAmountOut": "11645275",
"priceImpact": 0,
"slippageBps": 50,
"routePlan": [
{
"programId": "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp",
"dex": "Humidifi",
"pool": "8sKQHfjNhvmAw94PhfvfMcytmqW6jmxvwieYyzXCCPu",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amountIn": "100000000",
"amountOut": "11703794",
"priceImpact": 0,
"percent": 100
}
],
"swapUsdValue": "11.72",
"platformFee": {
"feeBps": 0,
"feeFromInput": false,
"chargeBps": 0
},
"contextSlot": 454215309,
"timeTaken": 0.026,
"quoteId": "AbvXxjPyBhaxiDuRNB5XM54c_V8e-S0jPyMceNLpJQmU",
"searchMode": "fast"
}{
"error": "Invalid amount: must be greater than 0",
"code": 400
}{
"error": "Failed to get quote: No multi-hop route found",
"code": 422
}{
"error": "Failed to get quote: No multi-hop route found",
"code": 500
}{
"error": "<string>",
"code": 123
}Find the best route for a swap and return the expected output. No wallet is needed.
Pass the whole response to
POST /swap unchanged, and do it within a few seconds: quotes that carry a quoteId point to a short-lived execution plan.Query Parameters
Just-in-time routing. auto uses it when it improves execution, true always uses it, false turns it off. See JIT routing.
Available options:
auto, true, false Response
Quote
Quote returned by GET /quote. Send it back unchanged as quoteResponse.
Was this page helpful?