curl --request GET \
--url https://www.oceanx.trade/api/v1/spot/quote/stream \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.oceanx.trade/api/v1/spot/quote/stream"
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/stream', 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/stream",
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/stream"
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/stream")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.oceanx.trade/api/v1/spot/quote/stream")
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<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>"
}
}Quote stream
Re-quotes one pair on an interval and streams each result as Server-Sent Events. Costs ONE PER TICK against the 300/min quote budget.
SERVER-SIDE ONLY: authentication is the Authorization header, and the browser EventSource API cannot set headers — which is correct, because your key is a secret. Consume this from your backend and relay it over your own transport.
Events: open (echoed config) → quote → close. Also error (the stream CONTINUES) and throttled (budget spent; ticks resume when the window rolls). : hb comment lines every 20s keep intermediaries from idling the connection out.
curl --request GET \
--url https://www.oceanx.trade/api/v1/spot/quote/stream \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.oceanx.trade/api/v1/spot/quote/stream"
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/stream', 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/stream",
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/stream"
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/stream")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.oceanx.trade/api/v1/spot/quote/stream")
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<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}$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 <= 1000Re-quote cadence.
250 <= x <= 60000Connection lifespan. We always close with a close event.
1 <= x <= 240Emit only when the proceeds or the chosen route actually move.
Response
An SSE stream.
SSE frames; see the description.
