order
curl --request GET \
--url https://api.jup.ag/ultra/v1/order \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/ultra/v1/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/ultra/v1/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/ultra/v1/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/ultra/v1/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/ultra/v1/order")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/ultra/v1/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": "ExactIn",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "17057460",
"inUsdValue": 17.13,
"outUsdValue": 17.06,
"priceImpact": 0.0001,
"swapUsdValue": 17.06,
"otherAmountThreshold": "17040402",
"swapMode": "ExactIn",
"slippageBps": 1,
"priceImpactPct": "0.0001",
"routePlan": [
{
"swapInfo": {
"ammKey": "HXpGFJGCEEFdV31tDmjDBaJMEB1fKLiAoKoWr3Fnonid",
"label": "Meteora DLMM",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "17057460"
},
"percent": 100,
"bps": 10000,
"usdValue": 17.06
}
],
"feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"feeBps": 5,
"platformFee": {
"amount": "8529",
"feeBps": 5
},
"signatureFeeLamports": 5000,
"signatureFeePayer": null,
"prioritizationFeeLamports": 254600,
"prioritizationFeePayer": null,
"rentFeeLamports": 0,
"rentFeePayer": null,
"swapType": "aggregator",
"router": "metis",
"transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...",
"gasless": false,
"requestId": "b5e5f3a7-8c4d-4e2f-9a1b-3c6d8e0f2a4b",
"totalTime": 320,
"taker": "BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV"
}{
"error": "Failed to get quotes"
}{
"error": "<string>"
}Get Order (Ultra API)
Request for a base64-encoded unsigned swap transaction to be used in POST /ultra/v1/execute
GET
/
order
order
curl --request GET \
--url https://api.jup.ag/ultra/v1/order \
--header 'x-api-key: <api-key>'import requests
url = "https://api.jup.ag/ultra/v1/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/ultra/v1/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/ultra/v1/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/ultra/v1/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/ultra/v1/order")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jup.ag/ultra/v1/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": "ExactIn",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "17057460",
"inUsdValue": 17.13,
"outUsdValue": 17.06,
"priceImpact": 0.0001,
"swapUsdValue": 17.06,
"otherAmountThreshold": "17040402",
"swapMode": "ExactIn",
"slippageBps": 1,
"priceImpactPct": "0.0001",
"routePlan": [
{
"swapInfo": {
"ammKey": "HXpGFJGCEEFdV31tDmjDBaJMEB1fKLiAoKoWr3Fnonid",
"label": "Meteora DLMM",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "100000000",
"outAmount": "17057460"
},
"percent": 100,
"bps": 10000,
"usdValue": 17.06
}
],
"feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"feeBps": 5,
"platformFee": {
"amount": "8529",
"feeBps": 5
},
"signatureFeeLamports": 5000,
"signatureFeePayer": null,
"prioritizationFeeLamports": 254600,
"prioritizationFeePayer": null,
"rentFeeLamports": 0,
"rentFeePayer": null,
"swapType": "aggregator",
"router": "metis",
"transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAEN...",
"gasless": false,
"requestId": "b5e5f3a7-8c4d-4e2f-9a1b-3c6d8e0f2a4b",
"totalTime": 320,
"taker": "BQ72nSv9f3PRyRKCBnHLVrerrv37CYTHm5h3s9VSGQDV"
}{
"error": "Failed to get quotes"
}{
"error": "<string>"
}Ultra 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
- The public key of the account that will receive the output tokens
- If not provided, the output tokens will be sent to the taker like default
- It expects an account (NOT a token account)
- If the output is non-SOL tokens, it only transfers to ATAs (not token accounts)
- If the destination token account is not initialized, an additional create ATA instruction will be added to the transaction
- If the output is SOL, it will transfer native SOL directly to the receiver account
- It does not support destination WSOL token account
- The public key of an account that will be used to cover 'gas-related' fees on behalf of the taker
- Gas related fees such as signature fees, priority fees and rent. Note that enabling this may result in different routing decisions.
- Refer to Integrator Payer for more details
- Optional. If used, requires
payer - Ignored, if
payeris not provided - The public key of an account to set as the close authority of ATAs created during the swap transaction. Only applies to non-wSOL ATAs that persist beyond the execution of the transaction.
- If
closeAuthorityis not provided, we will default totaker - If
closeAuthorityis provided and is different fromtaker, we will add the instruction to set the newcloseAuthority
- Refer to Integrator Fees for more details
- Refer to Integrator Fees for more details
Required range:
50 <= x <= 255- Full list of DEXes here, for example:
excludeDexes=Raydium,Orca+V2,Meteora+DLMM - Important: This only excludes DEXes on the Metis router, does not apply to other routers
- For example:
- Exclude Raydium:
excludeRouters=<all-except-metis>andexcludeDexes=Raydium - Only include Meteora DLMM:
excludeRouters=<all-except-metis>andexcludeDexes=<all-except-MeteoraDLMM>
- Exclude Raydium:
Response
Successful response
- The fee includes either Ultra default fee or your integrator fee, depending on if referral and/or payer params are passed in
- If
referralAccount,referralFee(andpayerif passed in) are passed in, the fee will be the integrator fee only - If no additional referral params are passed in, the fee will be the Ultra default fee only and can include additional fees for gasless support mechanism
- This field will be present if
takeris defined andtransactionis an empty string - This field can still return despite having a valid order/quote
- This is meant for display purposes only and it is discouraged to match these error messages as they could be parameterized
Available options:
Insufficient funds, Top up `${solAmount}` SOL for gas, Minimum `${swapAmount}` for gasless Was this page helpful?
