Skip to main content
GET
/
exchange
/
v2
/
getOrderbook
Get orderbook (v2)
curl --request GET \
  --url https://api.4casters.io/exchange/v2/getOrderbook \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "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": [
          {
            "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>"
          }
        ],
        "awaySpreads": [
          {
            "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>"
          }
        ],
        "over": [
          {
            "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>"
          }
        ],
        "under": [
          {
            "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>"
          }
        ],
        "homeMoneylines1x2": [
          {
            "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>"
          }
        ],
        "awayMoneylines1x2": [
          {
            "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>"
          }
        ],
        "draw1x2": [
          {
            "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>"
          }
        ],
        "openInterest": 123,
        "matchedVolume": 123
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.4casters.io/llms.txt

Use this file to discover all available pages before exploring further.

Returns the orderbook for a league or single game in flat form: each market is an array of orders rather than an object keyed by spread / total. This is the recommended orderbook endpoint. Pair it with the WebSocket Streaming price feed for real-time updates.

Request

GET /exchange/v2/getOrderbook
league
string
League code, e.g. NBA (case-insensitive). Required when gameID is not provided.
sport
string
Sport name, e.g. basketball (case-insensitive). Optional filter when league is set.
gameID
string
Single game id. When provided, league and sport are ignored.
curl "https://api.4casters.io/exchange/v2/getOrderbook?league=NBA" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

data.games
array
Each game is the standard Game shape with the following additional per-market arrays:
Each order in those arrays has the following shape:

Example (trimmed)

{
  "data": {
    "games": [
      {
        "id": "67aaba04c32f13ae2e8aa070",
        "league": "NBA",
        "sport": "basketball",
        "start": "2025-02-12T00:10:00.000Z",
        "ended": false,
        "live": false,
        "featured": false,
        "eventName": "TORONTO RAPTORS VS PHILADELPHIA 76ERS",
        "isSpecials": false,
        "periodName": "Full Time",
        "participants": [/* away, home */],
        "awayMoneylines": [
          {
            "id": "67ab79fc786aa2c2cfe7524f",
            "type": "moneyline",
            "sumUntaken": 1151.04,
            "odds": 330,
            "bet": 3798.43,
            "gameID": "67aaba04c32f13ae2e8aa070",
            "takenRatio": 0,
            "participantID": "61a3917a8afa5950306490fd",
            "expiry": "2025-02-12T00:10:06.000Z",
            "createdAt": "2025-02-11T16:25:32.354Z",
            "gameStartExpiry": true
          }
        ],
        "homeMoneylines": [/* ... */],
        "awaySpreads":    [/* ... */],
        "homeSpreads":    [/* ... */],
        "over":           [/* ... */],
        "under":          [/* ... */],
        "openInterest": 12450.30,
        "matchedVolume": 27916.55
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

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

league
string

League code, e.g. NBA (case-insensitive).

sport
string

Sport name, e.g. basketball (case-insensitive). Optional filter when league is set.

gameID
string

Single game id. When provided, league and sport are ignored.

Response

Orderbook for one or more games

data
object