quote
curl --request GET \
--url https://api.jup.ag/swap/v1/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/swap/v1/quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.jup.ag/swap/v1/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://api.jup.ag/swap/v1/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://api.jup.ag/swap/v1/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jup.ag/swap/v1/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/swap/v1/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"inputMint": "So11111111111111111111111111111111111111112",
"inAmount": "100000000",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outAmount": "17057460",
"otherAmountThreshold": "16886885",
"swapMode": "ExactIn",
"slippageBps": 100,
"priceImpactPct": "0.0001",
"platformFee": {
"amount": "0",
"feeBps": 0
},
"routePlan": [
{
"swapInfo": {
"ammKey": "HXpGFJGCEEFdV31tDmjDBaJMEB1fKLiAoKoWr3Fnonid",
"label": "Meteora DLMM",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "17057460",
"feeAmount": "1285",
"feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
"percent": 100
}
],
"contextSlot": 324307186,
"timeTaken": 0.012
}Get Quote
Request for a quote to be used in POST /swap
GET
/
quote
quote
curl --request GET \
--url https://api.jup.ag/swap/v1/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/swap/v1/quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.jup.ag/swap/v1/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://api.jup.ag/swap/v1/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://api.jup.ag/swap/v1/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jup.ag/swap/v1/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/swap/v1/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"inputMint": "So11111111111111111111111111111111111111112",
"inAmount": "100000000",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outAmount": "17057460",
"otherAmountThreshold": "16886885",
"swapMode": "ExactIn",
"slippageBps": 100,
"priceImpactPct": "0.0001",
"platformFee": {
"amount": "0",
"feeBps": 0
},
"routePlan": [
{
"swapInfo": {
"ammKey": "HXpGFJGCEEFdV31tDmjDBaJMEB1fKLiAoKoWr3Fnonid",
"label": "Meteora DLMM",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "17057460",
"feeAmount": "1285",
"feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
"percent": 100
}
],
"contextSlot": 324307186,
"timeTaken": 0.012
}Metis Swap API is no longer actively maintained and has been superseded by Swap V2.
Authorizations
Get API key via https://developers.jup.ag/portal
Query Parameters
- Raw amount to swap (before decimals)
- Input Amount if
SwapMode=ExactIn - Output Amount if
SwapMode=ExactOut
- Default: 50
- This is threshold denoted in basis points.
- If exact in and output amount exceeds the threshold, then the swap transaction will fail.
- ExactOut is for supporting use cases where you need an exact output amount
- In the case of
ExactIn, the slippage is on the output token - In the case of
ExactOut, the slippage is on the input token - Not all AMMs support
ExactOut: Currently only Orca Whirlpool, Raydium CLMM, Raydium CPMM - We do not recommend using
ExactOutfor most use cases
Available options:
ExactIn, ExactOut - Multiple DEXes can be pass in by comma separating them
- For example:
dexes=Raydium,Orca+V2,Meteora+DLMM - If a DEX is indicated, the route will only use that DEX
- Full list of DEXes here using the
/program-id-to-labelendpoint
- Multiple DEXes can be pass in by comma separating them
- For example:
excludeDexes=Raydium,Orca+V2,Meteora+DLMM - If a DEX is indicated, the route will not use that DEX
- Full list of DEXes here using the
/program-id-to-labelendpoint
- Restrict intermediate tokens within a route to a set of more stable tokens
- This will help to reduce exposure to potential high slippage routes
- Direct route limits Jupiter routing to single hop routes only
- This may result in worse routes
- Instead of using versioned transaction, this will use the legacy transaction
- Take fees in basis points
- If
platformFeeBpsis passed in, thefeeAccountin/swapmust be passed as well
- Rough estimate of the max accounts to be used for the quote
- Useful if composing your own transaction or to be more precise in resource accounting for better routes
- The version of instruction to use in the swap program
Available options:
V1, V2 - No longer applicable, only required to pass in via
/swapendpoint
Set to true if the quote will be used in a Jito bundle. This excludes DEXes that are incompatible with Jito bundles (e.g. HumidiFi).
Response
200 - application/json
Successful response to be used in /swap
- Best output amount after deducting AMM fees and platform fees
- Does not account for slippage
- Minimum acceptable output amount —
outAmountafter applyingslippageBpstolerance - Not used by
/swapendpoint to build transaction
Available options:
ExactIn, ExactOut Required range:
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
- Markets that would have quoted for this pair
- Useful for debugging and verifying route decisions
- Each key is an AMM account address, each value is the quoted output amount
Show child attributes
Show child attributes
Was this page helpful?
⌘I
