Get single orderbook
curl --request GET \
--url https://api.4casters.io/exchange/getSingleOrderbook \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/getSingleOrderbook"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/exchange/getSingleOrderbook', 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.4casters.io/exchange/getSingleOrderbook",
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://api.4casters.io/exchange/getSingleOrderbook"
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://api.4casters.io/exchange/getSingleOrderbook")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/getSingleOrderbook")
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{
"data": {
"game": {
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"homeMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"awayMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"homeSpreads": {},
"awaySpreads": {},
"over": {},
"under": {},
"homeMoneylines1x2": {},
"awayMoneylines1x2": {},
"draw1x2": {},
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"openInterest": 123,
"matchedVolume": 123
},
"orderSummary": [
{}
],
"childGames": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"homeMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"awayMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"homeSpreads": {},
"awaySpreads": {},
"over": {},
"under": {},
"homeMoneylines1x2": {},
"awayMoneylines1x2": {},
"draw1x2": {},
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"openInterest": 123,
"matchedVolume": 123
}
],
"propGames": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"homeMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"awayMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"homeSpreads": {},
"awaySpreads": {},
"over": {},
"under": {},
"homeMoneylines1x2": {},
"awayMoneylines1x2": {},
"draw1x2": {},
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"openInterest": 123,
"matchedVolume": 123
}
]
}
}Markets
Get single orderbook
Read the nested orderbook for one game, plus child markets
GET
/
exchange
/
getSingleOrderbook
Get single orderbook
curl --request GET \
--url https://api.4casters.io/exchange/getSingleOrderbook \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.4casters.io/exchange/getSingleOrderbook"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.4casters.io/exchange/getSingleOrderbook', 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.4casters.io/exchange/getSingleOrderbook",
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://api.4casters.io/exchange/getSingleOrderbook"
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://api.4casters.io/exchange/getSingleOrderbook")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/getSingleOrderbook")
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{
"data": {
"game": {
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"homeMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"awayMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"homeSpreads": {},
"awaySpreads": {},
"over": {},
"under": {},
"homeMoneylines1x2": {},
"awayMoneylines1x2": {},
"draw1x2": {},
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"openInterest": 123,
"matchedVolume": 123
},
"orderSummary": [
{}
],
"childGames": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"homeMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"awayMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"homeSpreads": {},
"awaySpreads": {},
"over": {},
"under": {},
"homeMoneylines1x2": {},
"awayMoneylines1x2": {},
"draw1x2": {},
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"openInterest": 123,
"matchedVolume": 123
}
],
"propGames": [
{
"id": "<string>",
"parentGameID": "<string>",
"cheapDataUID": "<string>",
"league": "<string>",
"sport": "<string>",
"start": "2023-11-07T05:31:56Z",
"ended": true,
"live": true,
"featured": true,
"eventName": "<string>",
"tournamentName": "<string>",
"periodName": "<string>",
"isSpecials": true,
"participants": [
{
"id": "<string>",
"longName": "<string>",
"shortName": "<string>",
"mainPitcher": "<string>",
"rotationNumber": "<string>",
"futuresSide": "<string>",
"score": 123
}
],
"homeMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"awayMoneylines": [
{
"id": "<string>",
"createdBy": "<string>",
"sumUntaken": 123,
"odds": 123,
"bet": 123,
"gameID": "<string>",
"takenRatio": 123,
"expiry": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"mockOrder": true,
"gameStartExpiry": true,
"isPostArb": true,
"participantID": "<string>",
"spread": 123,
"total": 123,
"market": "<string>"
}
],
"homeSpreads": {},
"awaySpreads": {},
"over": {},
"under": {},
"homeMoneylines1x2": {},
"awayMoneylines1x2": {},
"draw1x2": {},
"mainHomeSpread": "<unknown>",
"mainAwaySpread": "<unknown>",
"mainTotal": "<unknown>",
"openInterest": 123,
"matchedVolume": 123
}
]
}
}Returns the nested orderbook for a single game — spreads and totals are objects keyed by spread / total number rather than flattened arrays. Also returns any child games (props, alternate periods) and an
Each individual order has the standard order shape:
orderSummary of the caller’s own resting orders for the league.
For the simpler flat shape, prefer Get orderbook.
Request
GET /exchange/getSingleOrderbook
string
required
Game id.
curl "https://api.4casters.io/exchange/getSingleOrderbook?gameID=65b67450503180295ade9216" \
-H "Authorization: Bearer YOUR_TOKEN"
Response
object
Game object with nested-orderbook fields. The standard
Game fields apply (see Get games), plus:Show Per-game orderbook fields
Show Per-game orderbook fields
array
Resting away-side moneyline orders. Sorted best-price first.
array
Resting home-side moneyline orders.
object
Object keyed by spread number (e.g.
"-3.5"). Each value is an array of orders.object
Object keyed by spread number.
object
Object keyed by total number (e.g.
"220.5"). Each value is an array of orders.object
object
Soccer only. Object with
homeYes / homeNo arrays.object
Soccer only. Object with
awayYes / awayNo arrays.object
Soccer only. Object with
drawYes / drawNo arrays.string
The currently-displayed main home spread (the consensus line).
number
string
number
number
array
The caller’s own resting orders across the entire league (not just this game). Useful for rendering “your offers” badges in a UI.
array
Child games (alternate periods, etc.) of the requested game. Same shape as
data.game.array
Prop games tied to the requested game.
Errors
| Status | Meaning |
|---|---|
400 | gameID missing. |
Authorizations
Pass your auth token in the Authorization header. The Bearer prefix is optional; the server also accepts a signed auth cookie or a token field in the request body.
Query Parameters
Game id.
Response
Single-game orderbook
Show child attributes
Show child attributes
Was this page helpful?
⌘I