WebSockets
Get live match and board changes pushed to your app instead of polling.
Starts on
Builder and up
Credits per call
1 to connect
Endpoint
WS /v7/live/wsMCP tool
get_live_wsBy plan
Builder: 2 connections, 5 matches. Pro: 10 and 25, plus the whole board. Quant: 20 and 50.
Limits
Connect from your app, not through MCP: get_live_ws returns the URL, auth and subscribe messages. Use ?ticket= from POST /v7/ws-ticket when a client cannot set headers.
Connect
import WebSocket from "ws";
const ws = new WebSocket("wss://kashrock.up.railway.app/v7/live/ws", {
headers: { "x-api-key": process.env.KASHROCK_API_KEY },
});
ws.on("open", () => {
ws.send(JSON.stringify({ op: "subscribe", sport: "cs2", game_id: "kr_cs2_..." }));
});
ws.on("message", (raw) => {
const msg = JSON.parse(raw);
if (msg.op === "update") console.log(msg.type, msg.data);
});Sandbox and Hobby keys are refused at the handshake. Browsers that cannot set headers use a ticket.
Messages you send
| Send | Does |
|---|---|
{"op":"subscribe","sport":"cs2","game_id":"<kr_match_id>"} | Follow one match |
{"op":"subscribe","sport":"cs2","game_id":"*"} | Every live match in the title (Pro and up) |
{"op":"subscribe","sport":"cs2","board":"lines"} | Pushed changes to the lines board (props for props) |
{"op":"unsubscribe","sport":"cs2","game_id":"<kr_match_id>"} | Stop following |
{"op":"ping"} | Keep-alive; answered with pong |
Messages you get
op | Carries |
|---|---|
hello | Your plan and socket limits |
snapshot | The full state for one match, or the full board on a board subscribe |
update | A change: type is frame, boxscore, meta, odds, lines or props. Board updates carry only what moved, plus removed[] |
event | Kill and death batches, always an array |
games_list | The live board when you subscribed to game_id: "*" |
status | stats_available and reason when a match's stats stop or come back |
Socket connects, subscribes and pushes do not count against your requests-a-minute limit. Limits by plan:
| Plan | Price | Credits | Rate limit | API keys | Live data | History | WebSocket |
|---|---|---|---|---|---|---|---|
| Sandbox | $0/mo | 1,500 credits a day | 10 req/min | 1 | No live data | None | None |
| Hobby | $29.99/mo | 1.5M credits a month | 30 req/min | 1 | 15s delay | Last 90 days | None |
| Builder | $99/mo | 5M credits a month | 100 req/min | 3 | Real time | Full archive | 2 connections, 5 matches |
| Pro | $199/mo | 10M credits a month | 250 req/min | 5 | Real time | Full archive | 10 connections, 25 matches, whole board |
| Quant | $299/mo or $2,990/yr | 20M credits a month | 500 req/min | 10 | Real time | Full archive | 20 connections, 50 matches, whole board |
The REST equivalents are on Live data.
