GetOrderBook
curl --request POST \
--url https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"market": {
"marketId": "<string>"
},
"tickSize": 123,
"sizeInUsd": true,
"levels": 123,
"limit": 123,
"offset": 123,
"totalOrderCount": 123,
"chainId": "<string>"
}
'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,
"chainId": "<string>"
}
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({
market: {marketId: '<string>'},
tickSize: 123,
sizeInUsd: true,
levels: 123,
limit: 123,
offset: 123,
totalOrderCount: 123,
chainId: '<string>'
})
};
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,
'chainId' => '<string>'
]),
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://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 \"chainId\": \"<string>\"\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://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook")
.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 \"chainId\": \"<string>\"\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["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 \"chainId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"orderBook": {
"marketId": "12942289985198375563",
"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
}
]
}
}
}{
"code": "not_found",
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk=",
"debug": {}
}
]
}Orderbook
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.
POST
/
orderbook_service.v1.OrderBookService
/
GetOrderBook
GetOrderBook
curl --request POST \
--url https://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"market": {
"marketId": "<string>"
},
"tickSize": 123,
"sizeInUsd": true,
"levels": 123,
"limit": 123,
"offset": 123,
"totalOrderCount": 123,
"chainId": "<string>"
}
'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,
"chainId": "<string>"
}
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({
market: {marketId: '<string>'},
tickSize: 123,
sizeInUsd: true,
levels: 123,
limit: 123,
offset: 123,
totalOrderCount: 123,
chainId: '<string>'
})
};
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,
'chainId' => '<string>'
]),
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://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 \"chainId\": \"<string>\"\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://api.fairground.fi/orderbook_service.v1.OrderBookService/GetOrderBook")
.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 \"chainId\": \"<string>\"\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["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 \"chainId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"orderBook": {
"marketId": "12942289985198375563",
"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
}
]
}
}
}{
"code": "not_found",
"message": "<string>",
"details": [
{
"type": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk=",
"debug": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Define the version of the Connect protocol Define the version of the Connect protocol. If omitted, use 1.
Available options:
1 Define the timeout, in ms
Example:
1000
Body
application/json
- market
- market
Show child attributes
Show child attributes
Number of results returned
Starting position
Optional chain identifier for the market. During testnet, Fairground runs on Arbitrum Sepolia (421614).
Response
Success
Show child attributes
Show child attributes