Skip to main content
The MagicMarkets API lets a program do what the web app does: discover events, read live prices, quote and place orders, close them, and read positions and balance. MagicMarkets puts orders from other traders and liquidity aggregated from more than 25 sportsbooks, sports exchanges and prediction markets into one order book. Trading carries zero commission, and one API key authenticates every call. The API is open to every individual account. Create an API key and start trading. There is no application, fee or onboarding. If you run a price aggregator, a comparison site or another platform that wants to display MagicMarkets prices, or you need higher limits, see Partners.
The first line needs a recent Go toolchain. The second lists football events that have live prices now. Create an API key first. API access needs a minimum deposit of 10 USDT.
Read prices from offers. Use betslips only to place orders. Offers, from GET /v2/offers/ or the WebSocket, carry the prices you need to scan markets. Open a betslip when you are ready to place an order, and close it with DELETE /v2/betslips/{betslip_id}/ once the order is placed. The order stays open after its betslip closes.

Three ways in

CLI

The fastest start. One open-source binary for the whole API: markets, offers, betslips, orders, heartbeats and position. MIT licence.

REST and WebSocket

Any language. REST for event discovery, a price snapshot, betslips, orders, positions, balance and heartbeats. One WebSocket for live offers, your quotes and order updates.

MCP server

For agents. The CLI runs a local MCP server that is read-only until you turn trading on. A hosted server runs at magicmarkets.com/mcp.
Reference pages: REST endpoints and WebSocket stream.

The shape of an integration

Placing an order takes two steps: create a betslip, then place an order against it. A full integration looks like this:
  1. Read prices and pick a selection. List events with GET /v2/events/ and read an event’s offers with GET /v2/offers/, or take both from the WebSocket. An offer’s sport, event_id and bet_type go into a betslip unchanged.
  2. Create a betslip. You describe what you want to trade: the sport, the event, the bet type. The response carries no prices, because quotes are gathered asynchronously.
  3. Read your executable price. It arrives as a pmm message on the WebSocket, or you poll the betslip. Prices usually land within a couple of seconds. The betslip is short-lived.
  4. Place an order against that betslip, with your price and stake.
  5. Watch the order on the socket, or poll it.
A betslip is the first step to place an order on one selection. It is not an order, and nothing is at risk until you place against it. See Concepts.

Safe by default

Automated trading fails in known ways, so the platform and tooling guard against them:
  • Heartbeats act as a dead-man’s switch. If your code goes quiet, resting orders close themselves.
  • Order placement is idempotent when you send a request_uuid. A retry with the same UUID returns the existing order and cannot place a second one.
  • Your limit is honoured. An order fills only at your price or better. See Prices and ticks.
  • The API cannot move funds. No deposit, withdrawal or key management endpoint exists. A leaked key can trade, not withdraw.
  • The local MCP server starts read-only. Trading needs MAGICMARKETS_ALLOW_TRADING=1. The hosted MCP server has no read-only mode: see MCP server.
See Safety.

Written for humans and agents

The API publishes its own machine-readable reference at magicmarkets.com/llms.txt, magicmarkets.com/llms-full.txt and the OpenAPI spec. This site adds .md versions of every page. llms-full.txt holds the full API reference in one Markdown file, so one URL gives an agent the whole contract. See Machine-readable docs.

Start

Quickstart

Authentication

Place an order in Python