cURL
curl --request GET \
--url 'https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook"
headers = {"X-API-KEY": "<api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.json())const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook', options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinstats.app/v1/prediction/markets/{slug}/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"timestamp": "2025-06-19T12:00:00.000Z",
"data": {
"slug": "<string>",
"conditionId": "<string>",
"outcomes": [
"<string>"
],
"tickSize": 123,
"minOrderSize": 123,
"lastTradePrice": 123,
"negRisk": true,
"books": {
"yes": {
"outcome": "<string>",
"bestBid": 123,
"bestAsk": 123,
"spread": 123,
"midpoint": 123,
"bidLevels": 123,
"askLevels": 123,
"bidDepth": 123,
"askDepth": 123,
"truncated": true,
"bids": [
{
"price": 123,
"size": 123
}
],
"asks": [
{
"price": 123,
"size": 123
}
]
},
"no": {
"outcome": "<string>",
"bestBid": 123,
"bestAsk": 123,
"spread": 123,
"midpoint": 123,
"bidLevels": 123,
"askLevels": 123,
"bidDepth": 123,
"askDepth": 123,
"truncated": true,
"bids": [
{
"price": 123,
"size": 123
}
],
"asks": [
{
"price": 123,
"size": 123
}
]
}
},
"bookTimestamp": "2023-11-07T05:31:56Z",
"fetchedAt": "2023-11-07T05:31:56Z"
},
"cached": true
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}Prediction · Markets
Market Orderbook
Full CLOB order-book depth for both outcomes
GET
/
v1
/
prediction
/
markets
/
{slug}
/
orderbook
cURL
curl --request GET \
--url 'https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook' \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook"
headers = {"X-API-KEY": "<api-key>"}
response = requests.request("GET", url, headers=headers)
print(response.json())const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook', options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinstats.app/v1/prediction/markets/<slug>/orderbook")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinstats.app/v1/prediction/markets/{slug}/orderbook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"timestamp": "2025-06-19T12:00:00.000Z",
"data": {
"slug": "<string>",
"conditionId": "<string>",
"outcomes": [
"<string>"
],
"tickSize": 123,
"minOrderSize": 123,
"lastTradePrice": 123,
"negRisk": true,
"books": {
"yes": {
"outcome": "<string>",
"bestBid": 123,
"bestAsk": 123,
"spread": 123,
"midpoint": 123,
"bidLevels": 123,
"askLevels": 123,
"bidDepth": 123,
"askDepth": 123,
"truncated": true,
"bids": [
{
"price": 123,
"size": 123
}
],
"asks": [
{
"price": 123,
"size": 123
}
]
},
"no": {
"outcome": "<string>",
"bestBid": 123,
"bestAsk": 123,
"spread": 123,
"midpoint": 123,
"bidLevels": 123,
"askLevels": 123,
"bidDepth": 123,
"askDepth": 123,
"truncated": true,
"bids": [
{
"price": 123,
"size": 123
}
],
"asks": [
{
"price": 123,
"size": 123
}
]
}
},
"bookTimestamp": "2023-11-07T05:31:56Z",
"fetchedAt": "2023-11-07T05:31:56Z"
},
"cached": true
}{
"statusCode": 400,
"message": "Bad Request",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 401,
"message": "Unauthorized",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 403,
"message": "Forbidden",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 404,
"message": "Not Found",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 409,
"message": "Transactions not synced",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"requestId": "11111111-2222-3333-4444-555555555555",
"path": "<requested-endpoint>"
}{
"statusCode": 503,
"message": "Service Unavailable. Please Contact Support"
}2 credits per request
You will get
You will get
- The live order book straight from the CLOB (never stored): best bid/ask, spread, midpoint, and best-first bid/ask levels per outcome.
- Both outcome books in one call (mirrored for binary markets); use
outcometo fetch just one, anddepthto cap levels per side. - Summary fields (
bidLevels,bidDepth, …) always describe the whole book; a one-sided book is normal near resolution.
Authorizations
API key required to access the endpoints. Generate one from your dashboard at https://openapi.coinstats.app and pass it in the X-API-KEY request header. Never expose your key in client-side code.
Path Parameters
Query Parameters
Max levels returned per side (default: all).
Required range:
1 <= x <= 500Return a single outcome's book instead of both.
Available options:
yes, no Was this page helpful?
⌘I