Casplay Sports APIData API · v2
ENTR
iframeData API
← All docs

Casplay Data Feed API

Pre-match and live fixtures, the full odds catalogue, live state, a push stream and per-selection results — for operators that run their own betting engine.

Margins, limits, bet acceptance and payouts are on your side; we provide the data and the result of every selection. No iframe and no wallet callbacks are involved — this is a data-only product (for the iframe sportsbook see the iframe integration guide).

Two channels: (1) REST https://spor.casplay.net/v2/feed — snapshots: fixtures, one event, results. (2) Push stream wss://spor.casplay.net/v2/feed/stream — every change as it happens. Both use the same Bearer SPORTS_API_TOKEN.

Glossary

TermMeaning
EventA match (or an outright/special event). Stable string id.
MarketOne bet type of an event, e.g. full-time result, total goals 2.5. Identified by its key + params.
SelectionOne outcome of a market (e.g. “Over 2.5”) with its odd. Results are given per selection.
settletrue on a market = we publish its result; false = no result from us.
schemaVersion of the response format. Changes only on a breaking change; new fields can appear at any time.

Quick start

  • Get access. Your reseller (or Casplay) enables the data feed for your account — the status is shown in your panel under Integration. Until then every call returns 403 feed_disabled.
  • Copy your token. Panel → Integration → SPORTS_API_TOKEN. Keep it on your server only.
  • Add your server IP. Same tab → Allowed IPs. With an empty list every call is refused.
  • Load the fixtures with GET /fixtures and the events you show with GET /event/{id}.
  • Open the push stream and apply the changes to your state.
  • Settle your bets from bet_settlement or GET /results.

How live odds update

Odds are event-driven, not a clock tick. A price is sent only when it actually moves — a quiet market can hold the same odds for several seconds, and that is correct, not a fault and not a block. No message = the odds are unchanged and still valid. Don't wait for a per-second update; there isn't one.

You see…What it means
no odds_change for a few secondsthe price has not moved — keep showing the odds you already have
odds_changethe price (or frozen) changed — apply the new market rows
a selection with frozen: truethat one selection is suspended for a moment (goal, VAR, late money) — it reopens on its own; not a system block
alive every 10 sthe stream is alive — a heartbeat, no data; miss three in a row and reconnect
Use the push stream; don't poll every second. The stream delivers each change within about half a second of us receiving it. Polling /fixtures or /event/{id} on a 1-second loop only adds latency and burns your rate limit — and still returns nothing new while the price holds. If you truly cannot keep a socket open, poll live events every 2–5 s (see Recommended flow), never faster.
The gap between two changes is set by the sport and the moment, not by us: expect several updates per second during action and tens of seconds of calm otherwise. A steady 2–3 s rhythm almost always means you are polling on a timer — switch to the stream to get changes the instant they happen.

Authentication & access

Every REST call and the WebSocket handshake

Authorization: Bearer {SPORTS_API_TOKEN}
Accept-Encoding: gzip
RuleDetails
Base URLhttps://spor.casplay.net/v2/feed · stream wss://spor.casplay.net/v2/feed/stream
Allowed IPsRequests are accepted only from the IPs in your panel's IP whitelist.
ActivationThe data feed is enabled per account by your reseller (or Casplay); until then 403 feed_disabled.
Limits1200 REST requests per minute per account (429 rate_limited above) · 300 Bet Builder requests per minute · at most 5 stream connections per account.
CompressionSend Accept-Encoding: gzip — the full fixture list is ~1.2 MB raw, ~160 KB gzipped.
Language?lang= one of en tr de fr es pt ar ur he hi zh ko fa (default en). Team, league, category, market, outcome, sport and period names are all in that language.
Leaked a token? Use “Regenerate tokens” in the panel — the old token stops working immediately for new requests; reconnect your stream with the new one.

Responses & errors

Every success: { ok: true, schema, ts, lang, data }. ts = server time (ms). Ignore fields you don't know — new ones may be added at any time.

Every error uses a real HTTP status and this body:

{ "ok": false, "error": { "code": "ip_not_allowed", "message": "IP not allowed: 203.0.113.7" } }
HTTPcodeMeaning
401unauthorizedmissing or wrong token
403ip_not_allowedcaller IP is not in the whitelist (or the whitelist is empty)
403feed_disableddata feed not enabled for this account
403account_inactive · subscription_expired · credit_exceededaccount closed
404not_foundunknown event, result or endpoint
405method_not_allowedwrong method (GET everywhere; POST only for /betbuilder/price)
429rate_limited · too_many_connectionsslow down
500internalretry later

IDs & keys

  • All IDs are strings and stable: event, competitor, tournament, category.
  • Market key m{marketType}_p{period}[_s{subPeriod}][_r{resultKind}] — e.g. m2_p0 full-time 1X2, m5_p0_r4 total corners, m5_p1_s85 total goals until minute 85. A market with lines (totals, handicaps) appears once per line; the line is in params.
  • Selection identity = event id + market key + params + outcome type + values. Store this tuple with every bet — results use exactly the same tuple.
resultKindUnit
1main unit (goals / points / sets / maps)
4corners
8cards
16red cards
2fouls
14shots
66shots on target
67offsides

Event fields

FieldValues
stageprematch · live · finished
statusnot_started started paused finished retired abandoned interrupted cancelled postponed
tradingopen · suspended (whole event suspended) · closed (started, finished or no longer updated). Do not accept bets unless open.
phaselive: current phase in the requested language, e.g. 1st half, Half-time, Q3, Set 2, Penalty shoot-out
scorematch total in the sport's main unit (goals, points, sets, maps, runs)
periodsper-period scores — see Periods
scoreWithExtrafootball: total including extra time and penalties, when different from score
gameScoretennis live: points in the current game, e.g. "40-15"
statsgoals corners cards red_cards fouls shots shots_on_target offsides sets games points maps rounds runs wickets — each {home, away}; unknown codes appear as rk<n>
clocklive: seconds minute running countdown (sports whose clock runs down)
servingtennis / volleyball / table tennis / badminton live: home · away
betBuildertrue = same-match combinations are available — see Bet Builder
logo · flag · iconimage URLs on our domain: team logo (competitors[].logo), country/category flag (category.flag), sport icon (/sports → icon) — see Images
odd · frozendecimal odds; frozen: true = that selection is suspended right now
orderposition of the market on the page — a number that is the same in every language. Sort markets by order; within one key the lines already arrive sorted by params (0.5, 1.5, 2.5 …) and the outcomes in a fixed order (1X2: type 0, 1, 3). Never sort or match by name — names change with lang.
settletrue = the market is covered by our results (/results, bet_settlement). false = no result from us; settle from your own source or don't offer it.
complete/event/{id}: false on the first request for a pre-match event — main markets only; the full catalogue follows within seconds (request again or use the stream).

Periods

SportPeriod labels
Football (F)1H 2H ET1 ET2 (goals)
Basketball (B)Q1 Q2 Q3 Q4 OT 1H 2H (points; OT = everything after Q4)
Ice hockey (H)P1 P2 P3 OT (goals)
Tennis (T)S1 S2 … games per set (score = sets)
Volleyball, table tennis, badminton, beach volleyballS1 S2 … points per set (score = sets)
Esports (CS)M1 M2 … rounds per map (score = maps)
Other sportsproviderPeriods: raw provider periods (period: 1 = match total; other codes not guaranteed)

List sports

GEThttps://spor.casplay.net/v2/feed/sports

Sports with open events. Codes: F football, B basketball, T tennis, H ice hockey, CS esports, TT table tennis, VB volleyball, HB handball, CK cricket, BB baseball…

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/sports?lang=en"

Response · 200

{
  "ok": true, "schema": 1, "ts": 1792148629547, "lang": "en",
  "data": [ { "id": "F", "name": "Football", "icon": "https://spor.casplay.net/v2/img/sport/f", "live": 32, "prematch": 555 }, "…" ]
}

List tournaments

GEThttps://spor.casplay.net/v2/feed/tournaments

Every league / tournament that currently has open events, with its country and event counts. Optional filters: sport (code), category (id). Use the id as tournament in /fixtures.

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/tournaments?sport=F&lang=en"

Response · 200

{
  "ok": true, "schema": 1, "ts": 1792148629547, "lang": "en",
  "data": [ { "id": "17", "name": "Premier League", "sport": "F",
              "category": { "id": "1", "name": "England", "country": "GB", "flag": "https://spor.casplay.net/v2/img/flag/gb" },
              "live": 2, "prematch": 18 }, "…" ]
}

List fixtures

GEThttps://spor.casplay.net/v2/feed/fixtures

Open events (pre-match + live), sorted by start time. Finished events are in /results.

ParameterRequiredDescription
sportnosport code, e.g. F
stagenoprematch or live
tournament · categorynotournament / category id
from · tonostart-time window (ISO times)
oddsno1 = include main-market odds (1X2 · Over/Under · BTTS) on each fixture, in the same markets[] shape as /event/{id}. Use this to rebuild your book in one call after a reconnect; full market depth stays at /event/{id}.
langnoname language (default en)

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/fixtures?sport=F&stage=prematch&odds=1&lang=en"

Response · 200

{
  "ok": true, "schema": 1, "ts": 1792094101023, "lang": "en",
  "data": [{
    "id": "18898080", "sport": "F",
    "category": { "id": "b7d9493d…", "name": "Guatemala", "country": "GTM", "flag": "https://spor.casplay.net/v2/img/flag/gtm" },
    "tournament": { "id": "e83fc447…", "name": "National League" },
    "name": "Xelaju MC - CD Malacateco",
    "competitors": [ { "id": "18058", "name": "Xelaju MC", "side": "home", "logo": "https://spor.casplay.net/v2/img/team/18058" },
                     { "id": "78117", "name": "CD Malacateco", "side": "away", "logo": "https://spor.casplay.net/v2/img/team/78117" } ],
    "startTime": "2026-10-15T19:00:00.000Z",
    "stage": "live", "status": "started", "trading": "open",
    "betBuilder": true, "marketCount": 78,
    "score": { "home": 2, "away": 1 },
    "periods": [ { "period": "1H", "home": 1, "away": 1 }, { "period": "2H", "home": 1, "away": 0 } ],
    "stats": { "goals": { "home": 2, "away": 1 }, "corners": { "home": 5, "away": 3 } },
    "clock": { "seconds": 5581, "minute": 93, "running": true, "countdown": false }
  }]
}

Get event

GEThttps://spor.casplay.net/v2/feed/event/{id}

One event with every market and price. Selections with no price are left out. For pre-match events see complete in Event fields.

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/event/18680637?lang=en"

Response · 200

{
  "ok": true, "schema": 1, "ts": 1792094390486, "lang": "en",
  "data": {
    "id": "18680637", "sport": "F", "stage": "prematch", "trading": "open", "…": "same fields as fixtures",
    "markets": [
      { "key": "m2_p0", "marketType": 2, "period": 0, "resultKind": 1, "params": [],
        "name": "Full-time result", "settle": true,
        "outcomes": [ { "type": 0, "values": [], "name": "Hearts", "odd": 1.44, "frozen": false },
                      { "type": 1, "values": [], "name": "Draw", "odd": 4, "frozen": false },
                      { "type": 3, "values": [], "name": "FC Nordsjaelland", "odd": 7.5, "frozen": true } ] },
      { "key": "m5_p0", "marketType": 5, "period": 0, "resultKind": 1, "params": ["2.5"],
        "name": "Total goals", "settle": true,
        "outcomes": [ { "type": 4, "values": [], "name": "Over 2.5", "odd": 1.7, "frozen": false },
                      { "type": 5, "values": [], "name": "Under 2.5", "odd": 2.05, "frozen": false } ] },
      { "key": "m5_p1_s85", "marketType": 5, "period": 1, "subPeriod": 85, "resultKind": 1, "params": ["2.5"],
        "name": "Total goals until minute 85", "settle": true, "outcomes": [ "…" ] }
    ]
  }
}

Name dictionary

GEThttps://spor.casplay.net/v2/feed/dictionary

Raw name templates for all market and outcome types, for building your own labels. cond = sport:resultKind:period:param1:param2 conditions (= equal, ! not, >, <, empty = any); the first matching variant applies.

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/dictionary?lang=en"

Results

GEThttps://spor.casplay.net/v2/feed/results
GEThttps://spor.casplay.net/v2/feed/results/{id}

Finished events with the result of every selection of every settle: true market, computed by the same settlement engine we use for our own bets. The list covers the last 48 hours — poll at least daily.

ParameterRequiredDescription
sincenoISO time, filters on updatedAt — poll with the latest updatedAt you have seen and you receive new results and later corrections. Default: last 24 h; at most 48 h back (older values are treated as 48 h).
sportnosport code
marketsno0 = scores only
langnoname language

Result values

resultPayout of a stake S at odds O
wonS × O
lost0
voidS (refund)
half_wonS/2 × O + S/2 (Asian lines)
half_lostS/2 (Asian lines)
pendingnot final yet — official confirmation pending; do not settle
  • confirmed: true = no selection is pending any more; the record will not change.
  • Some markets (football halves, corners/cards, minute ranges, non-football period markets, cricket) wait for the official result — usually minutes, at most 48 h. If no official result arrives in 48 h the pending selections become void and noResult: true.
  • cancelled: true = the match was officially cancelled; its selections are void.

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/results?since=2026-10-15T21:00:00Z&lang=en"

Response · 200

{
  "ok": true, "schema": 1, "ts": 1792098114821, "lang": "en",
  "data": [{
    "id": "19022083", "sport": "B", "name": "KR Reykjavik - UMFN Njardvik", "stage": "finished", "status": "finished",
    "finishedAt": "2026-10-15T21:01:12.000Z", "updatedAt": "2026-10-15T21:01:45.000Z", "confirmed": true,
    "score": { "home": 84, "away": 73 },
    "periods": [ { "period": "Q1", "home": 18, "away": 24 }, { "period": "Q2", "home": 17, "away": 17 }, "…" ],
    "markets": [
      { "key": "m145_p0", "marketType": 145, "period": 0, "resultKind": 1, "params": [],
        "outcomes": [ { "type": 0, "values": [], "result": "won" }, { "type": 3, "values": [], "result": "lost" } ] },
      { "key": "m800_p0", "marketType": 800, "period": 0, "resultKind": 1, "params": ["-10.75"],
        "outcomes": [ { "type": 86, "values": [], "result": "half_won" }, { "type": 87, "values": [], "result": "half_lost" } ] }
    ]
  }]
}

Bet Builder markets

GEThttps://spor.casplay.net/v2/feed/betbuilder/{id}

Markets that can be combined within one event (same-match combinations), with names and current single prices: { eventId, available, markets:[…] } — same market row format as /event/{id}. Available when the event has betBuilder: true.

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/betbuilder/18012490?lang=en"

Bet Builder price

POSThttps://spor.casplay.net/v2/feed/betbuilder/price

Correlated price for 2–12 selections of the same event.

Request

POST https://spor.casplay.net/v2/feed/betbuilder/price
Authorization: Bearer {SPORTS_API_TOKEN}
Content-Type: application/json

{ "eventId": "18012490",
  "selections": [ { "key": "m2_p0", "params": [],      "type": 0, "values": [] },
                  { "key": "m5_p0", "params": ["2.5"], "type": 4, "values": [] } ] }

Response · 200

{ "ok": true, "data": { "eventId": "18012490", "available": true, "odd": 3.85, "notAvailable": [] } }
Prices move — request the price again right before accepting the bet.
Settlement: a Bet Builder bet wins only if every selection is won; settle each selection from /results. Selections on settle: false markets have no result from us — don't offer them in combinations you settle with our data.

Match tracker

GEThttps://spor.casplay.net/v2/feed/event/{id}/tracker

Animated live match tracker (pitch/court radar with live stats, lineups and timeline). Embed url in an <iframe>. Mostly football, basketball, tennis and other major sports while live; available: false when there is none. Request it when the user opens the event — the URL does not change during the match.

ParameterRequiredDescription
langnotracker language
themenodark (default) or light

Request

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/event/18936236/tracker?lang=en&theme=dark"

Response · 200

{ "ok": true, "data": { "eventId": "18936236", "available": true, "type": "radar", "url": "https://…" } }

Push stream — connect

WSwss://spor.casplay.net/v2/feed/stream

Same Authorization header and IP rules as REST. Every message carries an increasing seq and server time ts.

ParameterRequiredDescription
langnoname language
liveno1 (default) = all live events · 0 = none
prematchno1 = all pre-match events (default 0)
sportsnoonly these sports, e.g. F,B
eventsnoonly these events, e.g. id1,id2 (you can also subscribe later)
session · sincenoresume after a disconnect — see Reconnect

Subscribing to a pre-match event also loads its full market catalogue.

Messages

typeWhen
hellofirst message: sessionId, your options and resumed
odds_changeprices or suspensions changed — full market rows (all lines of the changed market keys), same format as /event/{id}. The rows of a key replace everything you hold for that key (a line that is no longer listed is closed). removed (optional array of keys) = markets no longer offered at all — delete them
event_statusscore, periods, phase, status or trading changed — same object as in /fixtures
fixture_changechange: "new" new event · change: "removed" event withdrawn from the feed (no update for 2 minutes)
bet_settlementa result was computed or updated — same object as in /results
aliveheartbeat every 10 s; if you miss three, reconnect
subscribed · unsubscribed · optionsconfirmation of your op message (the event ids actually added/removed, or the options now in effect)
resync_requiredthe session could not be resumed — see Reconnect
erroraccess_revoked: feed access was withdrawn (feed disabled, account closed, IP removed) — the connection is closed with code 4003 · bad_json / unknown_op: your message could not be read (the connection stays open)
// server → client
{ "type": "hello", "schema": 1, "ts": 1792098097803, "sessionId": "3f9c…", "resumed": false, "seq": 0, "lang": "en", "live": true, "prematch": false, "sports": null, "eventIds": [] }
{ "type": "odds_change", "seq": 1, "ts": 1792098098265, "eventId": "18968312",
  "markets": [ { "key": "m1_p0", "params": [], "name": "Winner", "settle": true,
                 "outcomes": [ { "type": 0, "values": [], "name": "Cloud9", "odd": 1.38, "frozen": false }, "…" ] } ] }
{ "type": "odds_change", "seq": 9, "ts": 1792098098301, "eventId": "19044714", "markets": [], "removed": [ "m2_p0", "m5_p1" ] }
{ "type": "event_status", "seq": 24, "ts": 1792098098767, "event": { "id": "19044714", "stage": "live", "score": { "home": 1, "away": 5 }, "…": "same as /fixtures" } }
{ "type": "fixture_change", "seq": 143, "ts": 1792098104785, "change": "new", "event": { "…": "same as /fixtures" } }
{ "type": "fixture_change", "seq": 150, "ts": 1792098109785, "change": "removed", "eventId": "19061250" }
{ "type": "bet_settlement", "seq": 217, "ts": 1792098114821, "result": { "…": "same as /results" } }
{ "type": "alive", "seq": 140, "ts": 1792098103731 }

// client → server
{ "op": "subscribe",   "eventIds": ["18680637", "18882446"] }
{ "op": "unsubscribe", "eventIds": ["18680637"] }
{ "op": "options", "live": true, "prematch": false, "sports": ["F", "B"] }

Reconnect & close codes

  • Keep sessionId from hello and the last seq you processed.
  • Reconnect with ?session=<sessionId>&since=<seq>. The session keeps collecting messages for 5 minutes after a disconnect and replays them in order (replay: true).
  • If you receive resync_required (unknown session or too long offline) refresh your state with /fixtures, /event/{id} and /results?since=.

The server sends a WebSocket ping every 10 s — standard clients answer it automatically.

Close codeMeaning
4003access revoked (see the error message)
4000the same session was opened by another connection
1008you read too slowly (messages piled up)
1001no answer for 75 s, or server restart — reconnect with session + since
1009your message is too large

End-to-end example

One working integration, smallest detail included. {SPORTS_API_TOKEN} is your panel token; the server IP you call from must be in your IP whitelist.

1 · Load the book once (REST)

Pull every live event with its main-market odds in a single call. --compressed sends Accept-Encoding: gzip (~1.2 MB raw → ~160 KB gzipped):

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/fixtures?stage=live&odds=1&lang=en"

And the full market depth of one event:

curl -H "Authorization: Bearer {SPORTS_API_TOKEN}" --compressed "https://spor.casplay.net/v2/feed/event/18680637?lang=en"

2 · Read a market

Every market — in /event/{id} and in each odds_change — has this shape:

{ "key": "m2_p0", "name": "Full-time result", "settle": true, "params": [],
  "outcomes": [ { "type": 0, "name": "Hearts", "odd": 1.44, "frozen": false },
                { "type": 1, "name": "Draw",   "odd": 4,    "frozen": false },
                { "type": 3, "name": "FC Nordsjaelland", "odd": 7.5, "frozen": true } ] }
  • Store each selection as a tuple: event id + key + params + outcome type + values — here 18680637 · m2_p0 · [] · 0 · []. Results and bet_settlement use the exact same tuple, so you match on it.
  • Line markets (totals, handicaps) carry the line in params: m5_p0 with params: ["2.5"] → Over = type 4, Under = type 5.
  • Accept a bet only when the event is trading: "open" and that outcome is frozen: false.

3 · Stay live with the stream — no polling

Copy-paste client: it connects, applies every change, and resumes after a drop without missing a message.

// Minimal Node.js stream client  (npm i ws · Node 18+).  Server-to-server only.
import WebSocket from 'ws';

const BASE  = 'wss://spor.casplay.net/v2/feed/stream';
const TOKEN = process.env.SPORTS_API_TOKEN;   // keep on the server, never in a browser

let sessionId = null;        // from the first "hello"
let lastSeq   = 0;           // highest seq you have applied
const book    = new Map();   // eventId -> { markets }  : your in-memory odds

function connect() {
  // First time: ?live=1 . After a drop: resume with session + since so nothing is missed.
  const q = sessionId
    ? '?session=' + sessionId + '&since=' + lastSeq
    : '?live=1&lang=en';
  const ws = new WebSocket(BASE + q, { headers: { Authorization: 'Bearer ' + TOKEN } });

  ws.on('message', (data) => {
    const m = JSON.parse(data);                     // one JSON object per message
    if (typeof m.seq === 'number') lastSeq = Math.max(lastSeq, m.seq);
    switch (m.type) {
      case 'hello':           sessionId = m.sessionId; break;            // store it to resume
      case 'odds_change':     applyOdds(m.eventId, m.markets, m.removed); break;   // full rows of changed keys
      case 'event_status':    applyStatus(m.event); break;              // score / phase / trading
      case 'fixture_change':  m.change === 'new' ? addEvent(m.event) : removeEvent(m.eventId); break;
      case 'bet_settlement':  settle(m.result); break;                  // same shape as /results
      case 'alive':           break;                                    // heartbeat only - no data
      case 'resync_required': bootstrapFromRest(); break;               // reload /fixtures + /results
      case 'error':           console.error('stream', m.code, m.message); break;
    }
  });

  // The server pings every 10 s; the ws library answers the pong automatically.
  ws.on('close',  (code) => { console.log('closed', code, '- reconnecting'); setTimeout(connect, 1000); });
  ws.on('error',  () => {});   // a 'close' event always follows
}

function applyOdds(eventId, markets, removed) {
  const ev = book.get(eventId) || { markets: {} };
  // The message carries ALL current lines of every changed key, and "removed" lists keys
  // that are no longer offered -> first drop every row you hold for those keys, then add
  // the new rows. Otherwise closed lines / withdrawn markets stay on screen with old odds.
  const changed = new Set([...markets.map((mk) => mk.key), ...(removed || [])]);
  for (const id of Object.keys(ev.markets)) if (changed.has(ev.markets[id].key)) delete ev.markets[id];
  // A market with lines (totals, handicaps) shares one key but differs by params,
  // so the identity is key + params - not key alone (never the position in the list).
  for (const mk of markets) ev.markets[mk.key + '|' + (mk.params || []).join(',')] = mk;
  book.set(eventId, ev);
}

connect();
In a browser you cannot set the Authorization header on a WebSocket — run the stream on your server and push to the browser yourself.

4 · Settle

When a result arrives — bet_settlement on the stream, or GET /results?since= polled once a minute — look up each stored selection tuple and pay out:

resultPayout of stake S at odds O
wonS × O
voidS (refund)
half_wonS/2 × O + S/2
half_lostS/2
lost0
pendingwait — not final yet

A combo (incl. Bet Builder) wins only if every selection is won. Only settle: true markets get a result from us.

Images

Team logos, country/category flags and sport icons are served from our domain. No token needed — use the URLs directly in <img src>. Long browser cache (7 days).

GEThttps://spor.casplay.net/v2/img/team/{competitorId}
GEThttps://spor.casplay.net/v2/img/flag/{country}
GEThttps://spor.casplay.net/v2/img/sport/{sportId}
ImageSource field
team / player logo (WebP)competitors[].logo
country or category flagcategory.flag (category.country, lower case)
sport icon/sports → icon (lower-case sport code)
Not every team or category has an image: a missing one returns 404 — show your own placeholder (onerror).

Recommended flow

  • Start: /fixtures (and /event/{id} for events you show).
  • Open the stream; apply odds_change, event_status, fixture_change to your state. Subscribe pre-match events you display (op: subscribe) or use prematch=1.
  • Accept a bet only if the event is trading: open and the selection is not frozen.
  • Settle from bet_settlement (or poll /results?since= every minute) once the selection's result is not pending.
Without the stream: /fixtures?stage=live every 10 s, /event/{id} every 2–5 s for live events you display.

Coverage

AreaCoverage
Eventsevery pre-match and live event in the feed, including special/outright events
Resultsabout 88% of all selections have a result from us (live sample, Oct 2026) — football and basketball ~100% (football incl. 1st-half corners; corner race / N-th corner only in leagues whose official corner timeline is reliably complete — check settle per event), tennis ~95%, ice hockey ~88%, volleyball ~76%, table tennis ~70%, esports ~60%, cricket ~40–60%
No resultmarkets with settle: false are mainly in-play statistics the source does not publish: race-to-N in tennis/table tennis/volleyball/hockey, cricket ball-by-ball and player markets, esports kill/objective markets (first blood, Baron, dragons…)
Goalscorerfootball — anytime / 2+ / 3+ goals, goal or assist, first / last / second scorer — pre-match and live — settle: true when we track the match's goal list; the result arrives about 20–30 minutes after the final whistle. Goals are matched to the player through the official lineup and cross-checked against the official score; a player who did not play, or who cannot be verified in the lineup, is void. Own goals do not count for any player; first/last/second scorer is void in a match with an own goal. Half-time scorer markets have settle: false.
Betradar IDsnot available from the source

Common mistakes

SymptomCause & fix
“Odds only update every 2–3 s”You are polling on a timer. Use the stream — it pushes each change in ~0.5 s. See How live odds update.
“Odds stopped / frozen”No odds_change just means the price has not moved. Use alive (every 10 s) for liveness; a single frozen: true outcome is a momentary suspension, not a block.
Every call returns 403Your IP whitelist is empty, or your server IP is not in it — add it in the panel (Integration → Allowed IPs). Or the feed is not enabled yet (feed_disabled).
Huge / slow responsesSend Accept-Encoding: gzip (curl --compressed). Bootstrap /fixtures once, then stream — don't re-pull it in a loop.
Odds appear under the wrong column (1 / X / 2)You place outcomes by their position in the outcomes array. An outcome without a price is not listed (e.g. at 0–2 the away win may be withdrawn, leaving only home and draw), so positions shift. Always place by type (1X2: 0 = home, 1 = draw, 3 = away) and show a lock for a missing type.
Closed lines / old odds stay on screenOn odds_change replace all rows you hold for each changed key with the rows in the message, and delete the keys listed in removed. Never merge by list position.
Results don’t match my betsYou keyed the bet differently from the result. Store and match the full selection tuple: event id + key + params + type + values.
Missed messages after a reconnectReconnect with ?session=&since=<lastSeq> (5-minute replay). On resync_required, reload /fixtures + /results?since=.
429 too_many_connectionsMax 5 stream connections per account, 1200 REST req/min. One stream is enough — subscribe to the events you need.
Browser WebSocket won’t authenticateThe handshake needs the Authorization header, which a browser can't set on a socket. Run the stream server-side.
Expecting Betradar IDsThe source does not provide them — match on our stable ids and the selection tuple instead.

Error reporting & liability

If you notice an error you believe is caused by our system (wrong odds, wrong or missing results, incorrect market data, etc.), simply report it to us.

  • Reporting window: within 24 hours of the error occurring. Include the relevant event IDs, market and outcome details and a short description.
  • Compensation: for errors reported within this window and confirmed by our review to be caused by us, your net loss is credited to your account according to your plan: as GGR credit on the GGR plan, or as subscription time on the subscription plan. No cash refunds are made.
  • Net loss is the amount remaining after deducting what can be recovered from the players who benefited from the error. Where an error has been knowingly and repeatedly exploited, we expect you to recover the related payouts from those players.
  • We accept no liability for losses arising from errors not reported in time (within 24 hours).