Get orderbook (v1, deprecated)
curl --request POST \
--url https://api.4casters.io/exchange/getOrderbook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leagueRequested": "NBA"
}
'import requests
url = "https://api.4casters.io/exchange/getOrderbook"
payload = { "leagueRequested": "NBA" }
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({leagueRequested: 'NBA'})
};
fetch('https://api.4casters.io/exchange/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.4casters.io/exchange/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([
'leagueRequested' => 'NBA'
]),
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.4casters.io/exchange/getOrderbook"
payload := strings.NewReader("{\n \"leagueRequested\": \"NBA\"\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.4casters.io/exchange/getOrderbook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leagueRequested\": \"NBA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/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 \"leagueRequested\": \"NBA\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"market": "<string>",
"games": [
{
"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 orderbook (v1, deprecated)
deprecated
Legacy nested-orderbook endpoint kept for backwards compatibility
POST
/
exchange
/
getOrderbook
Get orderbook (v1, deprecated)
curl --request POST \
--url https://api.4casters.io/exchange/getOrderbook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leagueRequested": "NBA"
}
'import requests
url = "https://api.4casters.io/exchange/getOrderbook"
payload = { "leagueRequested": "NBA" }
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({leagueRequested: 'NBA'})
};
fetch('https://api.4casters.io/exchange/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.4casters.io/exchange/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([
'leagueRequested' => 'NBA'
]),
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.4casters.io/exchange/getOrderbook"
payload := strings.NewReader("{\n \"leagueRequested\": \"NBA\"\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.4casters.io/exchange/getOrderbook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leagueRequested\": \"NBA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.4casters.io/exchange/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 \"leagueRequested\": \"NBA\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"market": "<string>",
"games": [
{
"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
}
]
}
}Deprecated. Use
GET /exchange/v2/getOrderbook for the simpler, recommended flat format.This endpoint is kept for backwards compatibility with older clients.Request
POST /exchange/getOrderbook
string
required
League code (case-insensitive).
curl -X POST https://api.4casters.io/exchange/getOrderbook \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"leagueRequested": "NBA"}'
Response
string
Always
null in this endpoint.array
Array of games with nested-orderbook fields. See Get single orderbook for the per-game shape —
awayMoneylines / homeMoneylines arrays plus awaySpreads / homeSpreads / over / under objects keyed by spread or total number.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.
Body
application/json
League code (case-insensitive).
Response
Nested-orderbook response
Show child attributes
Show child attributes
Was this page helpful?
⌘I