Step 1: Learn the concepts
You need no key and no install. Give the assistant the full API reference, then ask questions. The reference is one file:https://magicmarkets.com/llms-full.txt. Paste this into Claude, ChatGPT, Gemini or any other assistant:
- What is a betslip, and why do I need one before an order?
- What does a decimal price of 2.50 mean? How does it relate to a price in cents?
- What is the difference between a
forand anagainstbet type? - What is the tick schedule, and what happens if my price is not on it?
- What happens to my open orders if my program crashes?
- Why should every order carry a
request_uuid?
Step 2: Write a first script
This script only reads. It checks your key, lists upcoming football matches, and shows the best price for each outcome of one match. You need:- An API key. Sign in at magicmarkets.com, go to Settings, then API, and click Add API Key. API access needs a minimum deposit of 10 USDT. See Authentication.
- Python 3. Check with
python3 --version.
1
Put the key in an environment variable
Run this in the terminal where you will run the script. Replace The variable lasts until you close that terminal.
your-key with your key.2
Ask the assistant for the script
first_look.py
3
Run it
for,h: 1.64 for up to 2.13 USDT. A price of 1.64 on for,h means a 1 USDT position on the home team returns 1.64 USDT if the home team wins.Change it one step at a time
Ask for one change, run the script, then ask for the next. Good next prompts:- “Show only matches that start in the next 24 hours, sorted by start time.”
- “Next to each price, print the price in cents: 100 divided by the decimal price.”
- “Print home, draw and away for all five matches as one table.”
- “Save the prices to a CSV file every 60 seconds for one hour. Stay well inside the rate limits in llms-full.txt.”
Step 3: Connect an Agent to live markets
The Model Context Protocol (MCP) lets an assistant call MagicMarkets directly, so you can ask about live markets in plain language. You choose between two servers:
For learning, the local server is the safer choice, because it cannot trade unless you switch trading on. The hosted server is quicker to set up.
- Claude, hosted
- Local, read-only
In Claude on the web or desktop, open Settings, then Connectors, and add a custom connector with this URL:Claude asks you to sign in with your MagicMarkets account.In Claude Code:
- “List the football matches that start in the next three hours, with the best home, draw and away prices.”
- “Show the full book for the first match, both sides, and explain what the depth tells me.”
- “What is my balance, and how much is in open stakes?”
- “Snap a price of 2.345 to the tick schedule and explain the result.”
- “Check this bet type for me and explain when it wins:
for,ah,h,-2.”
When you are ready to trade
There is no separate test environment. Every order is real and uses real USDT, so move slowly:- Read Safety first: idempotent orders, heartbeats, and how limits are honoured.
- Follow Place an order in Python with the smallest amount the market accepts.
- Prefer tools that ask before they commit. The CLI asks for confirmation before each order, and the Claude skill examples run as a dry run unless you add
--live. - Ask the assistant to explain any code that places or closes orders before you run it.
Tips for better answers
- Name the source. “Using llms-full.txt” keeps the assistant on the current API and away from guesses.
- Say what it must not do. “Read only” and “never place an order” are worth repeating in every new chat.
- Ask for one change at a time, and run the code between changes.
- Ask it to explain. “Explain each line” teaches you the API as you go.
- For Claude Code, install the Claude skill. It gives Claude the guide, the references and tested examples.

