WSS · Real-TimeRead the Tennis WebSocket docs

Tennis WebSocket API: real-time points and live odds.

Connect once to `wss://api.citoapi.com/api/v1/tennis/live/ws` and subscribe to `all`, `match:{matchId}`, or `odds:{matchId}`. Receive `POINT_UPDATE`, `MATCH_FINISHED`, `tennis.odds.snapshot`, and `tennis.odds.updated` frames with zero per-frame quota fees.

  • Rooms: all, match:{id}, odds:{id}
  • 0 per-frame charges (1 req / 15s open)
  • Server headers + browser subprotocol auth
GET /tennis/matches/live?limit=1200 OK
$ curl "https://api.citoapi.com/api/v1/tennis/matches/live?limit=1" \ -H "x-api-key: $CITO_API_KEY"
{  "type": "POINT_UPDATE",  "room": "match:m_2026_4893994",  "match_id": "m_2026_4893994",  "data": {    "current_set": 2,    "game_score": "30:15",    "server": 1,    "sets": [      {        "set_number": 1,        "player1_games": 6,        "player2_games": 4,        "is_completed": true      },      {        "set_number": 2,        "player1_games": 3,        "player2_games": 2,        "is_completed": false      }    ]  }}

Seamless Integration with our MCP Server

Connect Claude, Cursor, or ChatGPT with the Cito MCP server so agents call real match IDs, point timelines, rankings, and Challenger/ITF results instead of guessing them.

MCPInstall the Cito MCP server
Claude
Cursor
OpenAI
Python
Cito API
Next.js
Discord
Slack
GitHub

One socket for points and market ticks

Replace high-frequency REST polling loops with multiplexed room subscriptions and automatic 15-second heartbeats. WebSockets push the live board from the same tennis API that powers REST results, Elo, and historical match logs.

Three room patterns

Subscribe to all live matches, target match:{matchId} for score/point diffs, or odds:{matchId} for live market prices.

Snapshot on subscribe

Include "snapshot": true in your subscribe command to hydrate current state immediately alongside live updates.

Browser-safe subprotocol

Send x-api-key / Authorization: Bearer from servers, or ["cito.v1", "cito.key.<KEY>"] from browsers.

Zero per-frame billing

Meters 1 request on connect plus 1 request per 15s open — identical to SSE, no matter how many points or odds ticks fire.

15s heartbeat, no idle close

Receives a ping frame every 15 seconds with no idle timeout while matches are open.

Unified match IDs

Every frame carries canonical match_id values ready to join with /tennis/matches/{id}, Elo, and H2H.

What rooms, actions, and events does the Tennis WebSocket use?

After connecting to wss://api.citoapi.com/api/v1/tennis/live/ws, the server sends a ready frame. Send a JSON subscribe payload naming any mix of all, match:{matchId}, or odds:{matchId} rooms, then handle point, match-finish, odds, ping, and error frames.

Frame / RoomDirectionMeaning
`{"action":"subscribe","rooms":["all"],"snapshot":true}`Client -> ServerSubscribe to `all`, `match:{matchId}`, and/or `odds:{matchId}` rooms
`ready` / `subscribed`Server -> ClientHandshake acknowledgement and confirmed room list
`POINT_UPDATE`Server -> ClientLive set, game, server, and point-score update for subscribed match rooms
`MATCH_FINISHED`Server -> ClientMatch left the live board; fetch `/tennis/matches/{matchId}` for finalised box score
`tennis.odds.snapshot` / `tennis.odds.updated`Server -> ClientInitial odds state and real-time market tick updates on `odds:{matchId}`
`ping` (every 15s)Server -> ClientKeep-alive heartbeat; there is no idle close
`error`Server -> ClientStructured error frame (ignore unknown frame types and fields for forward compatibility)

How do I connect from Python, Node.js/TypeScript, and the browser?

Server clients should send the x-api-key or Authorization: Bearer header during the upgrade handshake. Browser clients cannot set custom WebSocket headers, so pass ["cito.v1", "cito.key." + key] as the subprotocol array.

Python (websockets): subscribe to all matches and specific odds rooms
import asyncio, json, os, websockets

URL = "wss://api.citoapi.com/api/v1/tennis/live/ws"
HEADERS = {"x-api-key": os.environ["CITO_API_KEY"]}

async def main():
    async with websockets.connect(URL, additional_headers=HEADERS) as ws:
        await ws.send(json.dumps({
            "action": "subscribe",
            "rooms": ["all", "odds:m_2026_4893994"],
            "snapshot": True,
        }))
        async for raw in ws:
            frame = json.loads(raw)
            ftype = frame.get("type")
            if ftype in ("POINT_UPDATE", "MATCH_FINISHED", "tennis.odds.snapshot", "tennis.odds.updated"):
                print(ftype, frame.get("match_id"), frame.get("data"))

asyncio.run(main())
TypeScript (Node ws) + Browser subprotocol snippet
import WebSocket from "ws";

// Node.js / server-side: authenticate via x-api-key or Authorization: Bearer
const ws = new WebSocket("wss://api.citoapi.com/api/v1/tennis/live/ws", {
  headers: { "x-api-key": process.env.CITO_API_KEY! },
});

ws.on("open", () => {
  ws.send(JSON.stringify({ action: "subscribe", rooms: ["all"], snapshot: true }));
});

ws.on("message", (raw) => {
  const frame = JSON.parse(raw.toString());
  if (frame.type === "POINT_UPDATE") console.log("Point:", frame);
  if (frame.type === "MATCH_FINISHED") console.log("Finished:", frame.match_id);
});

// Browser WebSocket (subprotocol auth — never hardcode a production key in public client bundles):
// const browserWs = new WebSocket("wss://api.citoapi.com/api/v1/tennis/live/ws", ["cito.v1", "cito.key." + token]);
CLI (wscat): quick connection test
npx wscat -c "wss://api.citoapi.com/api/v1/tennis/live/ws" -H "x-api-key: YOUR_API_KEY"
# After "ready", send:
# {"action":"subscribe","rooms":["all"],"snapshot":true}

Which plans unlock WebSockets, and how does quota metering work?

WebSockets are a live-push tier feature with real-time delivery (0s artificial delay) and flat time-based metering. Free and Starter users can use the SSE stream (/tennis/live/stream) with a 60-second delay before upgrading.

QuestionVerified behavior
Which tiers get WSS access?Included on Scale ($100/mo) and Business CSV ($299/mo), or available as a +$15/mo add-on on Pro ($59/mo). Free and Starter receive HTTP `403 WEBSOCKETS_REQUIRED` on upgrade.
Alternative for Free / StarterUse `GET /api/v1/tennis/live/stream` (SSE) or `GET /api/v1/tennis/matches/live` with a 60-second delay.
Quota metering1 request on WebSocket upgrade + 1 request per 15 seconds while the socket remains open. Pushed `POINT_UPDATE` and `tennis.odds.updated` frames cost 0 extra credits.
Forward compatibilityAlways ignore unknown frame types and extra JSON fields so new live attributes never break your parser.

Endpoints you can ship with

Compare live REST endpoints alongside wss://api.citoapi.com/api/v1/tennis/live/ws.

Live scores

Every match in progress with the set scores, the game score, who is serving, and live match stats. Open one match for its full state.

View docs
  • GET/api/v1/tennis/matches/live

    Matches in progress: sets, game score, server, and live stats.

  • GET/api/v1/tennis/matches/live/{match_id}

    One live match: every set, the current game, and both players' stats.

  • GET/api/v1/tennis/matches/{match_id}/status

    Scheduled, in progress, or finished, with the result once decided.

  • GET/api/v1/tennis/schedule

    The day's order of play across tours.

  • GET/api/v1/tennis/matches/upcoming

    Scheduled matches, soonest first.

FAQs

Auth, rooms, metering, and plan tiers

Can't find what you're looking for? Contact our customer support team

Read the WebSocket reference

Push every point and tick into live scoreboards

Test the live board free, then stream real-time points and odds over one socket.