curl --request POST \
--url https://www.oceanx.trade/api/v1/route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputMint": "<string>",
"outputMint": "<string>",
"amount": "1000000000",
"uiAmount": 123,
"inputDecimals": 9,
"slippageBps": 50,
"dexes": "<string>",
"pools": "<string>",
"maxHops": 2,
"onlyDirectRoutes": true
}
'import requests
url = "https://www.oceanx.trade/api/v1/route"
payload = {
"inputMint": "<string>",
"outputMint": "<string>",
"amount": "1000000000",
"uiAmount": 123,
"inputDecimals": 9,
"slippageBps": 50,
"dexes": "<string>",
"pools": "<string>",
"maxHops": 2,
"onlyDirectRoutes": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputMint: '<string>',
outputMint: '<string>',
amount: '1000000000',
uiAmount: 123,
inputDecimals: 9,
slippageBps: 50,
dexes: '<string>',
pools: '<string>',
maxHops: 2,
onlyDirectRoutes: true
})
};
fetch('https://www.oceanx.trade/api/v1/route', 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://www.oceanx.trade/api/v1/route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputMint' => '<string>',
'outputMint' => '<string>',
'amount' => '1000000000',
'uiAmount' => 123,
'inputDecimals' => 9,
'slippageBps' => 50,
'dexes' => '<string>',
'pools' => '<string>',
'maxHops' => 2,
'onlyDirectRoutes' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.oceanx.trade/api/v1/route"
payload := strings.NewReader("{\n \"inputMint\": \"<string>\",\n \"outputMint\": \"<string>\",\n \"amount\": \"1000000000\",\n \"uiAmount\": 123,\n \"inputDecimals\": 9,\n \"slippageBps\": 50,\n \"dexes\": \"<string>\",\n \"pools\": \"<string>\",\n \"maxHops\": 2,\n \"onlyDirectRoutes\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.oceanx.trade/api/v1/route")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputMint\": \"<string>\",\n \"outputMint\": \"<string>\",\n \"amount\": \"1000000000\",\n \"uiAmount\": 123,\n \"inputDecimals\": 9,\n \"slippageBps\": 50,\n \"dexes\": \"<string>\",\n \"pools\": \"<string>\",\n \"maxHops\": 2,\n \"onlyDirectRoutes\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.oceanx.trade/api/v1/route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputMint\": \"<string>\",\n \"outputMint\": \"<string>\",\n \"amount\": \"1000000000\",\n \"uiAmount\": 123,\n \"inputDecimals\": 9,\n \"slippageBps\": 50,\n \"dexes\": \"<string>\",\n \"pools\": \"<string>\",\n \"maxHops\": 2,\n \"onlyDirectRoutes\": true\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}Route quote
Returns the existing Raptor route quote without building, signing, submitting, or reading a wallet. Requires md.read and costs one request from the quote bucket. /build and /execute are deliberately not public in this release and remain separately gated.
curl --request POST \
--url https://www.oceanx.trade/api/v1/route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputMint": "<string>",
"outputMint": "<string>",
"amount": "1000000000",
"uiAmount": 123,
"inputDecimals": 9,
"slippageBps": 50,
"dexes": "<string>",
"pools": "<string>",
"maxHops": 2,
"onlyDirectRoutes": true
}
'import requests
url = "https://www.oceanx.trade/api/v1/route"
payload = {
"inputMint": "<string>",
"outputMint": "<string>",
"amount": "1000000000",
"uiAmount": 123,
"inputDecimals": 9,
"slippageBps": 50,
"dexes": "<string>",
"pools": "<string>",
"maxHops": 2,
"onlyDirectRoutes": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inputMint: '<string>',
outputMint: '<string>',
amount: '1000000000',
uiAmount: 123,
inputDecimals: 9,
slippageBps: 50,
dexes: '<string>',
pools: '<string>',
maxHops: 2,
onlyDirectRoutes: true
})
};
fetch('https://www.oceanx.trade/api/v1/route', 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://www.oceanx.trade/api/v1/route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inputMint' => '<string>',
'outputMint' => '<string>',
'amount' => '1000000000',
'uiAmount' => 123,
'inputDecimals' => 9,
'slippageBps' => 50,
'dexes' => '<string>',
'pools' => '<string>',
'maxHops' => 2,
'onlyDirectRoutes' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.oceanx.trade/api/v1/route"
payload := strings.NewReader("{\n \"inputMint\": \"<string>\",\n \"outputMint\": \"<string>\",\n \"amount\": \"1000000000\",\n \"uiAmount\": 123,\n \"inputDecimals\": 9,\n \"slippageBps\": 50,\n \"dexes\": \"<string>\",\n \"pools\": \"<string>\",\n \"maxHops\": 2,\n \"onlyDirectRoutes\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.oceanx.trade/api/v1/route")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inputMint\": \"<string>\",\n \"outputMint\": \"<string>\",\n \"amount\": \"1000000000\",\n \"uiAmount\": 123,\n \"inputDecimals\": 9,\n \"slippageBps\": 50,\n \"dexes\": \"<string>\",\n \"pools\": \"<string>\",\n \"maxHops\": 2,\n \"onlyDirectRoutes\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.oceanx.trade/api/v1/route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inputMint\": \"<string>\",\n \"outputMint\": \"<string>\",\n \"amount\": \"1000000000\",\n \"uiAmount\": 123,\n \"inputDecimals\": 9,\n \"slippageBps\": 50,\n \"dexes\": \"<string>\",\n \"pools\": \"<string>\",\n \"maxHops\": 2,\n \"onlyDirectRoutes\": true\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}Authorizations
An OceanX API key, created in the app under Settings → Developer API. Send it as Authorization: Bearer ox_live_…. These endpoints require the md.read scope, which is on every key by default.
Body
Base58 Solana mint address.
^[1-9A-HJ-NP-Za-km-z]{32,44}$Base58 Solana mint address.
^[1-9A-HJ-NP-Za-km-z]{32,44}$Atomic (base-unit) amount as a decimal integer string. A string, not a number, because a large 9-decimal balance exceeds Number.MAX_SAFE_INTEGER and would be corrupted by JSON float parsing.
^\d+$"1000000000"
0 <= x <= 181 <= x <= 10002562561 <= x <= 4Response
Raptor quote response.
The response is of type object.
