Skip to content
Topic

Building on SX Bet

Developer reference for building on SX Bet — the open API, the WebSocket feed, the MCP server, and reference projects that turn live exchange data into bots, dashboards, and arbitrage tools.

About Building on SX Bet

What you can build on SX Bet

SX Bet exposes a free REST API and a real-time WebSocket feed. Markets, fixtures, leagues, live scores and the public trade feed need no API key and no signup. Prices (order-book snapshots and best odds), your own orders and trades, and placing orders use a free API key from your SX Bet account, and every order is an EIP-712 signed payload from the user's wallet.

That combination supports four common project shapes: odds aggregators that pull live exchange prices, dashboards that visualise order-book depth and volume, trading bots that post or take liquidity, and MCP servers that wrap the API for AI agents. Several of those projects are already live and open-source.

How the API surface is laid out

REST sits at api.sx.bet (mainnet) and api.toronto.sx.bet (testnet). Every market is binary — two outcomes per market, even when the real-world event has three (1X2 soccer is implemented as two binary markets). Prices are quoted as scaled integer probabilities (percentageOdds); divide by 1020 to get the implied probability as a decimal.

The WebSocket feed uses Centrifugo at wss://realtime.sx.bet/connection/websocket, with channels keyed by market hash for sub-second order-book updates. Rate limits are set per API key and per route (posting orders allows 5,500 requests a minute), with public market data limited per IP. Generous relative to sportsbook APIs that typically gate developer access entirely.

How to start

The fastest first call is GET https://api.sx.bet/markets/active. No API key, no signup. From there, docs.sx.bet/llms-full.txt is the LLM-ingestible reference, and there's an MCP server at https://docs.sx.bet/mcp for one-shot building with Claude Code. Install it with claude mcp add --transport http sx-bet https://docs.sx.bet/mcp.

Frequently asked questions

Do I need an API key to read odds from SX Bet?
Yes, for prices. Markets, fixtures, leagues, live scores and the public trade feed are keyless. Order-book snapshots and best odds (the prices), your own orders, trades and positions, placing orders, and the WebSocket token all need an API key, which you generate for free from your account page on sx.bet and send as the x-sx-api-key header. Keys created since October 2026 can call only the routes for the scopes you pick, so a bot that only reads prices can hold a key that can't trade.
How do I place an order on SX Bet via API?
Sign an EIP-712 payload with the user's wallet (MetaMask, Rabby, or a generated key) and POST it to /orders-v3 with your API key. Each order is one maker betting one outcome at one price. The field isMakerBettingOutcomeOne selects the outcome you're betting; the taker fills the opposite side. Orders settle on-chain in USDC.
What are the SX Bet API rate limits?
Authenticated limits are per API key and per route: POST /orders-v3 allows 5,500 requests a minute, GET /orders-v3 1,200, and trades, fills and positions 300 each. Public market-data endpoints aren't metered against your key; they're limited per IP. The full table is at docs.sx.bet/developers/rate-limits (verified September 2026).
Is SX Bet's API free for commercial use?
Yes. The public API has no commercial gate and no usage-based pricing; market listings need no key, and the API key for prices and trading is free. This is a deliberate differentiator versus sportsbook APIs that typically require commercial licensing.
What's the difference between mainnet and testnet?
Mainnet runs at api.sx.bet and settles real USDC. Testnet runs at api.toronto.sx.bet for development. Endpoint shapes and response formats are identical; only the underlying chain and funds differ.
Can I run a market-making bot on SX Bet?
Yes. Maker orders are EIP-712 signed once and rest on the book until filled or cancelled. The reference market-making bot is open-source on GitHub and demonstrates the full post/cancel cycle, plus rebate accounting.
Where's the best reference for the API spec?
docs.sx.bet/llms-full.txt is the full LLM-ingestible spec — the single best file to feed an AI agent. docs.sx.bet has the human-readable docs. The MCP server at docs.sx.bet/mcp gives Claude Code agents direct, indexed access to the docs without any setup beyond mcp add.