curl --request POST \
--url https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook \
--header 'Authorization: Bearer <token>' \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--data '
{
"market": {
"marketId": "<string>"
},
"tickSize": 123,
"sizeInUsd": true,
"levels": 123,
"limit": 123,
"offset": 123,
"totalOrderCount": 123
}
'import requests
url = "https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook"
payload = {
"market": { "marketId": "<string>" },
"tickSize": 123,
"sizeInUsd": True,
"levels": 123,
"limit": 123,
"offset": 123,
"totalOrderCount": 123
}
headers = {
"Connect-Protocol-Version": "<connect-protocol-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
market: {marketId: '<string>'},
tickSize: 123,
sizeInUsd: true,
levels: 123,
limit: 123,
offset: 123,
totalOrderCount: 123
})
};
fetch('https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook', 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.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook",
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([
'market' => [
'marketId' => '<string>'
],
'tickSize' => 123,
'sizeInUsd' => true,
'levels' => 123,
'limit' => 123,
'offset' => 123,
'totalOrderCount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connect-Protocol-Version: <connect-protocol-version>",
"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://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook"
payload := strings.NewReader("{\n \"market\": {\n \"marketId\": \"<string>\"\n },\n \"tickSize\": 123,\n \"sizeInUsd\": true,\n \"levels\": 123,\n \"limit\": 123,\n \"offset\": 123,\n \"totalOrderCount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
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://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market\": {\n \"marketId\": \"<string>\"\n },\n \"tickSize\": 123,\n \"sizeInUsd\": true,\n \"levels\": 123,\n \"limit\": 123,\n \"offset\": 123,\n \"totalOrderCount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": {\n \"marketId\": \"<string>\"\n },\n \"tickSize\": 123,\n \"sizeInUsd\": true,\n \"levels\": 123,\n \"limit\": 123,\n \"offset\": 123,\n \"totalOrderCount\": 123\n}"
response = http.request(request)
puts response.read_body{
"orderBook": {
"marketId": "1",
"timestamp": "2026-07-11T14:32:07Z",
"pageSize": 50,
"offset": 0,
"totalOrderCount": 214,
"levels": 10,
"tickSize": 10,
"sizeInUsd": true,
"book": {
"bids": [
{
"price": 65400,
"size": 120000,
"orderCount": 6,
"cumulativeTotal": 120000
},
{
"price": 65390,
"size": 85000,
"orderCount": 4,
"cumulativeTotal": 205000
}
],
"asks": [
{
"price": 65430,
"size": 95000,
"orderCount": 5,
"cumulativeTotal": 95000
},
{
"price": 65440,
"size": 60000,
"orderCount": 3,
"cumulativeTotal": 155000
}
]
}
}
}GetOrderBook
Returns a simulated aggregated order-book depth for one market: bid and ask
price levels, each bucketed by tickSize and sorted toward the best
price. Resolved by market_id or market_symbol.
curl --request POST \
--url https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook \
--header 'Authorization: Bearer <token>' \
--header 'Connect-Protocol-Version: <connect-protocol-version>' \
--header 'Content-Type: application/json' \
--data '
{
"market": {
"marketId": "<string>"
},
"tickSize": 123,
"sizeInUsd": true,
"levels": 123,
"limit": 123,
"offset": 123,
"totalOrderCount": 123
}
'import requests
url = "https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook"
payload = {
"market": { "marketId": "<string>" },
"tickSize": 123,
"sizeInUsd": True,
"levels": 123,
"limit": 123,
"offset": 123,
"totalOrderCount": 123
}
headers = {
"Connect-Protocol-Version": "<connect-protocol-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Connect-Protocol-Version': '<connect-protocol-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
market: {marketId: '<string>'},
tickSize: 123,
sizeInUsd: true,
levels: 123,
limit: 123,
offset: 123,
totalOrderCount: 123
})
};
fetch('https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook', 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.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook",
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([
'market' => [
'marketId' => '<string>'
],
'tickSize' => 123,
'sizeInUsd' => true,
'levels' => 123,
'limit' => 123,
'offset' => 123,
'totalOrderCount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Connect-Protocol-Version: <connect-protocol-version>",
"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://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook"
payload := strings.NewReader("{\n \"market\": {\n \"marketId\": \"<string>\"\n },\n \"tickSize\": 123,\n \"sizeInUsd\": true,\n \"levels\": 123,\n \"limit\": 123,\n \"offset\": 123,\n \"totalOrderCount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Connect-Protocol-Version", "<connect-protocol-version>")
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://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook")
.header("Connect-Protocol-Version", "<connect-protocol-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market\": {\n \"marketId\": \"<string>\"\n },\n \"tickSize\": 123,\n \"sizeInUsd\": true,\n \"levels\": 123,\n \"limit\": 123,\n \"offset\": 123,\n \"totalOrderCount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Connect-Protocol-Version"] = '<connect-protocol-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"market\": {\n \"marketId\": \"<string>\"\n },\n \"tickSize\": 123,\n \"sizeInUsd\": true,\n \"levels\": 123,\n \"limit\": 123,\n \"offset\": 123,\n \"totalOrderCount\": 123\n}"
response = http.request(request)
puts response.read_body{
"orderBook": {
"marketId": "1",
"timestamp": "2026-07-11T14:32:07Z",
"pageSize": 50,
"offset": 0,
"totalOrderCount": 214,
"levels": 10,
"tickSize": 10,
"sizeInUsd": true,
"book": {
"bids": [
{
"price": 65400,
"size": 120000,
"orderCount": 6,
"cumulativeTotal": 120000
},
{
"price": 65390,
"size": 85000,
"orderCount": 4,
"cumulativeTotal": 205000
}
],
"asks": [
{
"price": 65430,
"size": 95000,
"orderCount": 5,
"cumulativeTotal": 95000
},
{
"price": 65440,
"size": 60000,
"orderCount": 3,
"cumulativeTotal": 155000
}
]
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Define the version of the Connect protocol. If omitted, use 1.
1 Define the timeout, in ms
Body
Market to fetch the order book for, by market_id or market_symbol.
- market_id
- market_symbol
Show child attributes
Show child attributes
Price bucket size to group orders into levels. 0 disables
bucketing. Otherwise must be a power-of-ten multiple of the
market's minimum tick size (1 / 10^tickDecimals, from that
market's config) — e.g. 0.01, 0.1, 1, 10. A value below
the market's minimum tick is clamped up to that
minimum rather than rejected. Any other value (not a
power-of-ten step, or negative) returns INVALID_ARGUMENT.
Whether to express level sizes in USD notional (true) or the underlying asset's units (false).
Maximum number of price levels to return per side. 0 or omitted returns all levels.
Maximum number of underlying orders to aggregate before building levels. Defaults to 50.
Number of underlying orders to skip before aggregating.
Accepted but currently ignored.
Response
Success
Aggregated order book for the requested market.
Show child attributes
Show child attributes