curl --request GET \
--url https://api.jup.ag/swap/v2/order \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/swap/v2/order"
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/v2/order', 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/v2/order",
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/v2/order"
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/v2/order")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/swap/v2/order")
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{
"mode": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"inUsdValue": 123,
"outUsdValue": 123,
"priceImpact": 123,
"swapUsdValue": 123,
"otherAmountThreshold": "<string>",
"swapMode": "<string>",
"slippageBps": 123,
"priceImpactPct": "<string>",
"routePlan": [
{
"swapInfo": {
"ammKey": "<string>",
"label": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>"
},
"percent": 123,
"bps": 123,
"usdValue": 123
}
],
"referralAccount": "<string>",
"feeMint": "<string>",
"feeBps": 123,
"platformFee": {
"amount": "<string>",
"feeBps": 123,
"feeMint": "<string>"
},
"signatureFeeLamports": 123,
"signatureFeePayer": "<string>",
"prioritizationFeeLamports": 123,
"prioritizationFeePayer": "<string>",
"rentFeeLamports": 123,
"rentFeePayer": "<string>",
"swapType": "aggregator",
"router": "metis",
"transaction": "<string>",
"lastValidBlockHeight": "<string>",
"gasless": true,
"requestId": "<string>",
"totalTime": 123,
"taker": "<string>",
"quoteId": "<string>",
"maker": "<string>",
"expireAt": "<string>",
"errorCode": 123,
"errorMessage": "<string>",
"error": "<string>"
}{
"requestId": "<string>",
"error": "<string>"
}Get Order
Get a swap quote and assembled transaction
curl --request GET \
--url https://api.jup.ag/swap/v2/order \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/swap/v2/order"
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/v2/order', 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/v2/order",
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/v2/order"
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/v2/order")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/swap/v2/order")
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{
"mode": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>",
"inUsdValue": 123,
"outUsdValue": 123,
"priceImpact": 123,
"swapUsdValue": 123,
"otherAmountThreshold": "<string>",
"swapMode": "<string>",
"slippageBps": 123,
"priceImpactPct": "<string>",
"routePlan": [
{
"swapInfo": {
"ammKey": "<string>",
"label": "<string>",
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "<string>",
"outAmount": "<string>"
},
"percent": 123,
"bps": 123,
"usdValue": 123
}
],
"referralAccount": "<string>",
"feeMint": "<string>",
"feeBps": 123,
"platformFee": {
"amount": "<string>",
"feeBps": 123,
"feeMint": "<string>"
},
"signatureFeeLamports": 123,
"signatureFeePayer": "<string>",
"prioritizationFeeLamports": 123,
"prioritizationFeePayer": "<string>",
"rentFeeLamports": 123,
"rentFeePayer": "<string>",
"swapType": "aggregator",
"router": "metis",
"transaction": "<string>",
"lastValidBlockHeight": "<string>",
"gasless": true,
"requestId": "<string>",
"totalTime": 123,
"taker": "<string>",
"quoteId": "<string>",
"maker": "<string>",
"expireAt": "<string>",
"errorCode": 123,
"errorMessage": "<string>",
"error": "<string>"
}{
"requestId": "<string>",
"error": "<string>"
}Authorizations
Get API key via https://developers.jup.ag/portal
Query Parameters
The mint address of the input token
The mint address of the output token
The amount to swap in the smallest unit of the input token
- The public key of the wallet that will sign the transaction
- If not provided, the response will contain a quote but no transaction
- Must be present if you intend to sign and execute the transaction via
/execute
- The public key of the account that will receive the output tokens
- Must differ from
taker - Expects a wallet address, not a token account
- For non-SOL output: tokens are sent to the receiver's associated token account (ATA). If the ATA is not initialised, a create ATA instruction is added to the transaction
- For SOL output: native SOL is transferred directly to the receiver
- Does not support destination wSOL token accounts
- Swap mode. Currently only
ExactInis supported.
ExactIn - Slippage tolerance in basis points (0-10000)
- If not set, Jupiter automatically determines an appropriate slippage
0 <= x <= 10000- Address of your referral account for the Jupiter referral project
- Must be used together with
referralFee - See the Referral Program for setup
- Referral fee in basis points (50-255)
- Must be used together with
referralAccount
50 <= x <= 255- The public key of an account that will cover gas-related fees (signature fees, priority fees, and rent) on behalf of the taker
- Has no effect when set equal to
taker. Must be a different wallet to activate integrator-sponsored gas - Enabling this restricts routing to Metis (JupiterZ is disabled when an integrator payer is set)
- Priority fee in lamports
- If not set, Jupiter automatically determines an appropriate priority fee
- Setting this overrides the automatic optimisation
- Jito MEV tip in lamports for faster block inclusion
- Fee cap strategy:
maxCaptreats the fee as a maximum,exactFeeuses the exact amount - Ignored if neither
priorityFeeLamportsnorjitoTipLamportsare set
maxCap, exactFee - Comma-separated list of routers to exclude
- Available routers:
metis,jupiterz,dflow,okx
- Comma-separated list of DEXes to exclude from the Metis router
- Important: This only affects the Metis router, not other routers
- For example:
excludeDexes=Raydium,Orca+V2,Meteora+DLMM - Labels are case sensitive (
SolFi, notsolfi). Full list of DEXes here using the/program-id-to-labelendpoint. - On
/orderonlyexcludeDexesis honoured, notdexes. Use/buildto restrict routing to specific DEXes.
Response
Quote with optional assembled transaction
"ultra" or "manual" based on parameters used
Price impact in percentage points (e.g. -0.1 = -0.1%). Divide by 100 to convert to a decimal fraction.
Minimum output amount after slippage
Deprecated: decimal price impact ratio. Use priceImpact divided by 100 instead.
Show child attributes
Show child attributes
Total fee rate charged for the swap in basis points. This includes the Jupiter platform fee plus any additional charges, such as gasless support cost recoup.
Show child attributes
Show child attributes
Includes priority fees and tips (Jito, Nozomi)
Estimated rent fee
Deprecated: use router instead
aggregator, rfq, aggregator+rfq, dflow, okx Which router won the quote
metis, jupiterz, dflow, okx - Base64-encoded transaction. Null if taker is not provided.
- Empty string if taker is provided but transaction could not be built (check errorCode).
True when signature and priority fees are paid by a wallet other than the taker. Set by three independent paths:
- Automatic Jupiter sponsorship:
signatureFeePayer = gasTzr94Pmp4Gf8vknQnqxeYxdgwFjbgdJa4msYRpnB - JupiterZ market maker:
signatureFeePayeris the MM address (varies per quote); Jupiter's gas wallet can pay the rent to create the taker's output token account when referral fees are not set - Integrator payer:
signatureFeePayeris yourpayerparameter For a deterministic opt-out, checksignatureFeePayer == takeron every response.
Unique request ID. Pass this to /execute.
Response time in milliseconds
Quote ID for RFQ swaps
Market maker address for RFQ swaps
Quote expiration timestamp for RFQ swaps
Present when taker is defined and transaction is the empty string. The router quoted a price but could not build a transaction. Match on router + errorCode to identify the error.
Aggregator routers (router is metis, dflow, okx):
- 1: Taker does not hold enough of the input mint. Message:
Insufficient funds - 2: Insufficient SOL for gas. Not currently returned
- 3: Swap is too small to qualify for gasless support. Message:
Minimum $<amount> for gasless
JupiterZ router (router is jupiterz):
- 1: Taker's balance cannot fund the swap. Message:
Insufficient balance to fund the swap - 2: A required associated token account does not exist. Message:
Missing associated token account - 3: The quote could not be built into a transaction. Message:
Quote could not be built into a transaction
Human-readable description of the error, present when taker is defined and transaction is the empty string. The response still carries valid pricing when this field is set.
For display only. Keep your logic on router + errorCode, because the text is parameterised. The <amount> in the gasless message is worked out per request from the swap's USD value and the route's rent and priority fee cost, so errorCode 3 returns Minimum $5 for gasless on one swap and Minimum $10 for gasless on another.
Duplicate of errorMessage for backwards compatibility
Was this page helpful?
