curl --request GET \
--url https://www.oceanx.trade/api/v1/spot/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.oceanx.trade/api/v1/spot/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.oceanx.trade/api/v1/spot/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://www.oceanx.trade/api/v1/spot/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 => [
"Authorization: Bearer <token>"
],
]);
$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://www.oceanx.trade/api/v1/spot/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.oceanx.trade/api/v1/spot/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.oceanx.trade/api/v1/spot/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "1000000000",
"outAmount": "1000000000",
"minOutAmount": "1000000000",
"slippageBps": 500,
"impactMeasurable": true,
"clamped": true,
"route": [
{
"dex": "Raydium CLMM",
"inputMint": "<string>",
"outputMint": "<string>",
"pool": "<string>",
"percent": 123,
"amountIn": "<string>",
"amountOut": "<string>",
"priceImpactPct": 123
}
],
"venues": [
"<string>"
],
"engine": "raptor",
"priceImpactPct": 1.5,
"contextSlot": 123,
"engineTimeMs": 123,
"swapUsdValue": 123,
"requestId": "<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>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}{
"error": {
"code": "no_route",
"message": "<string>"
}
}Spot quote
One normalized quote for one size, off OceanX’s own router. Costs 1 against the 300/min quote budget.
Read priceImpactPct as a PERCENT, check impactMeasurable before showing it, and check clamped before treating outAmount as proceeds. Native deployments return oceanx_native_cache, net sell proceeds, and buy principal excluding the additional 100-bps SOL fee. Native coverage currently requires one SOL leg and one direct pool; unsupported route types return 501 and cold/stale state returns 503, with no provider fallback. Null impact is unqualified and must not be displayed as zero.
curl --request GET \
--url https://www.oceanx.trade/api/v1/spot/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.oceanx.trade/api/v1/spot/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.oceanx.trade/api/v1/spot/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://www.oceanx.trade/api/v1/spot/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 => [
"Authorization: Bearer <token>"
],
]);
$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://www.oceanx.trade/api/v1/spot/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.oceanx.trade/api/v1/spot/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.oceanx.trade/api/v1/spot/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"inputMint": "<string>",
"outputMint": "<string>",
"inAmount": "1000000000",
"outAmount": "1000000000",
"minOutAmount": "1000000000",
"slippageBps": 500,
"impactMeasurable": true,
"clamped": true,
"route": [
{
"dex": "Raydium CLMM",
"inputMint": "<string>",
"outputMint": "<string>",
"pool": "<string>",
"percent": 123,
"amountIn": "<string>",
"amountOut": "<string>",
"priceImpactPct": 123
}
],
"venues": [
"<string>"
],
"engine": "raptor",
"priceImpactPct": 1.5,
"contextSlot": 123,
"engineTimeMs": 123,
"swapUsdValue": 123,
"requestId": "<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>"
}
}{
"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.
Query Parameters
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}$Required unless you pass uiAmount + inputDecimals.
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"
Human units. Requires inputDecimals.
0 <= x <= 18Adds outUiAmount and minOutUiAmount to the response.
0 <= x <= 181 <= x <= 1000Comma-separated venue labels to restrict routing to.
Comma-separated pool addresses to restrict routing to.
1 <= x <= 4Legacy default is false. Native deployments use only direct routes when omitted; explicit false is unsupported.
Response
A quote.
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"
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"
Worst-case output after slippageBps, as enforced on-chain.
^\d+$"1000000000"
1 <= x <= 1000False when impact sits inside the engine's noise floor (~0.1%), where the figure is a cached mid rather than a measurement. Render '—' rather than the number.
True when this is the router's out-of-liquidity floor price rather than an executable fill. Returned with HTTP 200. NEVER present a clamped quote as proceeds.
Show child attributes
Show child attributes
Server-selected engine: raptor before the gated rollout; oceanx_native_cache when activated. Callers cannot choose a provider.
"raptor"
Price impact in PERCENT (1.5 = 1.5%). NOTE: Jupiter's equivalent field is fractional (0.015), so code ported from Jupiter is off by 100x — in the direction that makes an untradeable position look fine.
1.5
Router compute time in milliseconds, typically 1–2.
Upstream USD notional when available; null on many pairs. Don't depend on it.
Quote id. Include it if you report a bad route to us.
