xo-orderbook-client-rs
use xo_orderbook_client::orderbook::{Client, Config};
let client = Client::new("https://orderbooks.xo.market", Config::default())?;
// Single page:
let page = client.markets(None).await?;
println!("{} markets, next_cursor={}", page.count, page.next_cursor);
// Walk every page via the SDK's stream helper:
use futures::StreamExt as _;
let mut stream = client.stream_data(|cursor| client.markets(cursor));
while let Some(market) = stream.next().await {
let market = market?;
// ...
}
curl --request GET \
--url https://orderbooks.xo.market/marketsimport requests
url = "https://orderbooks.xo.market/markets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://orderbooks.xo.market/markets', 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://orderbooks.xo.market/markets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://orderbooks.xo.market/markets"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://orderbooks.xo.market/markets")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/markets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"limit": 100,
"count": 100,
"next_cursor": "MTAw",
"data": [
{
"condition_id": "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb",
"tokens": [
{
"token_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"outcome": "Yes",
"price": "0.5"
},
{
"token_id": "13730057904096984444199595880113152612639388204530324084054099203558669491245",
"outcome": "No",
"price": "0.5"
}
],
"minimum_tick_size": 0.001,
"neg_risk": false,
"active": true
},
{
"condition_id": "0x4964fda3ba21713ea3ddd5c53e0061a695de4c9d5bd9743a8c8869b403f45d19",
"tokens": [
{
"token_id": "104917912328586649182698603539137223011377182890747775468687635509771644211885",
"outcome": "Yes",
"price": "0.2"
},
{
"token_id": "54918778642903045521984667581133172019764154413366649039063773052788130028709",
"outcome": "No",
"price": "0.2"
}
],
"minimum_tick_size": 0.001,
"neg_risk": false,
"active": false
}
]
}Markets
List markets
Paginated list of markets. Walk pages by passing next_cursor
back as a query param until the response returns
next_cursor: "LTE=" (end-of-stream sentinel; NOT null).
GET
/
markets
xo-orderbook-client-rs
use xo_orderbook_client::orderbook::{Client, Config};
let client = Client::new("https://orderbooks.xo.market", Config::default())?;
// Single page:
let page = client.markets(None).await?;
println!("{} markets, next_cursor={}", page.count, page.next_cursor);
// Walk every page via the SDK's stream helper:
use futures::StreamExt as _;
let mut stream = client.stream_data(|cursor| client.markets(cursor));
while let Some(market) = stream.next().await {
let market = market?;
// ...
}
curl --request GET \
--url https://orderbooks.xo.market/marketsimport requests
url = "https://orderbooks.xo.market/markets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://orderbooks.xo.market/markets', 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://orderbooks.xo.market/markets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://orderbooks.xo.market/markets"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://orderbooks.xo.market/markets")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/markets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"limit": 100,
"count": 100,
"next_cursor": "MTAw",
"data": [
{
"condition_id": "0x39a12d52b63969654926e095ddd96f5c459112714da03edca769aa58173c78fb",
"tokens": [
{
"token_id": "26516164265702901957933644848127860370782874751279270726689263951695181556943",
"outcome": "Yes",
"price": "0.5"
},
{
"token_id": "13730057904096984444199595880113152612639388204530324084054099203558669491245",
"outcome": "No",
"price": "0.5"
}
],
"minimum_tick_size": 0.001,
"neg_risk": false,
"active": true
},
{
"condition_id": "0x4964fda3ba21713ea3ddd5c53e0061a695de4c9d5bd9743a8c8869b403f45d19",
"tokens": [
{
"token_id": "104917912328586649182698603539137223011377182890747775468687635509771644211885",
"outcome": "Yes",
"price": "0.2"
},
{
"token_id": "54918778642903045521984667581133172019764154413366649039063773052788130028709",
"outcome": "No",
"price": "0.2"
}
],
"minimum_tick_size": 0.001,
"neg_risk": false,
"active": false
}
]
}Response
200 - application/json
OK
Show child attributes
Show child attributes
Base64-encoded offset cursor. Pass back as next_cursor on the
next request. The literal string "LTE=" is the canonical
CLOB end-of-stream sentinel — when the gateway returns it,
there are no more pages. Empty string is also accepted by
SDKs for first-page requests. NOT nullable — always a string.
Number of items in this page (may equal limit mid-stream, smaller on the final page).
Page size requested (default 100, max 500).