A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.
The magicmarkets-magic-api skill packages what Claude needs to build against the API: the working guide, the REST and streaming references, task-shaped recipes, and runnable examples. It tells Claude to fetch the live llms-full.txt and OpenAPI spec as the source of truth rather than trusting memory.Source: github.com/magicmarkets/magic-api
If you cloned the skill before 29 September 2026, the old URL redirects, so git pull still works.
What is inside
Path
Contents
SKILL.md
The working guide: auth, REST market data, the trading flow, the wire format, ticks, errors, rate limits, common mistakes
references/rest.md
REST endpoints, including GET /v2/events/ and GET /v2/offers/, betslip and order shapes, heartbeats, errors and limits
references/streaming.md
The full WebSocket protocol, including handshake errors and dropped connections
references/recipes.md
Task-shaped patterns: discovery, placing, a live book, market making, bulk close, multi-event streaming, a REST price snapshot
examples/
Runnable Python scripts
The examples
The examples read your key from MAGIC_API_KEY.
cd ~/.claude/skills/magicmarkets-magic-api/examplespip install -r requirements.txtexport MAGIC_API_KEY="your-key"python 01-discover.py
Script
What it does
01-discover.py
List everything currently priced, via GET /v2/events/ or the stream’s sync snapshot
02-price-book.py
Maintain a correct live price book from offer, remove_offer and clear_events
03-market-making.py
The full betslip, quote, order flow under heartbeat protection
04-bulk-close.py
Inspect and bulk-close open orders, across every page of the order list
05-rest-offers.py
Read prices over REST with GET /v2/offers/, up to 20 events per call
06-multi-stream.py
Many events on one socket, with reconnect and re-registration
03 and 04 are dry-run by default. They print what they would do and exit, and the dry run only reads. Pass --live to place or close for real, which commits real USDT. 04 --all --live calls close_all with no filter, which closes every open order on the account.
The repository also has offline tests and read-only live tests, which check the skill against the published OpenAPI spec. See the README for how to run them.
Skill and MCP server together
The skill teaches Claude the protocol. The MCP server gives Claude tools to call it. Use both: the skill for building integrations, the MCP server for asking questions about live markets.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"MagicMarkets","description":"Documentation for MagicMarkets, the prediction market for serious sports trading. How the exchange works, how to trade, the API and tools, and how to partner with us.","colors":{"primary":"#FF5408","light":"#FF7A3D","dark":"#E04A05"},"logo":{"light":"https://mintcdn.com/magic-markets/K78j_U0qF2SW_a58/logo/light.png?fit=max\u0026auto=format\u0026n=K78j_U0qF2SW_a58\u0026q=85\u0026s=5b5cb25cb63b63071c2752557cd24445","dark":"https://mintcdn.com/magic-markets/K78j_U0qF2SW_a58/logo/dark.png?fit=max\u0026auto=format\u0026n=K78j_U0qF2SW_a58\u0026q=85\u0026s=d7e25192fadef156a938a1c8a9416d88","href":"https://magicmarkets.com/?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=logo"},"favicon":"https://mintcdn.com/magic-markets/QBQ2-VP0J9KbF66T/favicon.png?fit=max\u0026auto=format\u0026n=QBQ2-VP0J9KbF66T\u0026q=85\u0026s=d9fa5b0f6e5206c163b15e0f9df46218","api":{"playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required","languages":["bash","python","javascript","go"]}},"appearance":{"default":"system"},"navbar":{"links":[{"href":"/traders/support","label":"Support"}],"primary":{"type":"button","label":"Start trading","href":"https://magicmarkets.com/?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=navbar_cta"}},"footer":{"socials":{"x":"https://x.com/0xmagicmaker","github":"https://github.com/magicmarkets"},"links":[{"header":"MagicMarkets","items":[{"label":"About","href":"https://magicmarkets.com/about?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=footer_about"},{"label":"Learn","href":"https://magicmarkets.com/learn?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=footer_learn"},{"label":"Settlement rules","href":"https://magicmarkets.com/settlement-rules?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=footer_settlement_rules"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://magicmarkets.com/terms-of-service?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=footer_terms_of_service"},{"label":"Privacy Policy","href":"https://magicmarkets.com/privacy-policy?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=footer_privacy_policy"},{"label":"Responsible Gambling","href":"https://magicmarkets.com/responsible-gambling?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=footer_responsible_gambling"}]}]},"search":{"prompt":"Search the MagicMarkets docs"},"seo":{"metatags":{"og:site_name":"MagicMarkets Docs"},"indexing":"navigable"},"fonts":{"family":"Inter"},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"dark","latex":false},"integrations":{"posthog":{"apiKey":"phc_t4WuNMLPb3NxvtYeeh43fZ8Jb46AC4y9cybBts7LbVjY","apiHost":"https://us.i.posthog.com","sessionRecording":false}},"contextual":{"options":["copy","view","chatgpt","claude","mcp","cursor","vscode"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Open MagicMarkets","icon":"external-link","href":"https://magicmarkets.com/?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=sidebar_open"},{"anchor":"GitHub","icon":"github","href":"https://github.com/magicmarkets"},{"anchor":"OpenAPI spec","icon":"file-json","href":"https://magicmarkets.com/v2/openapi.yaml"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"magic-markets","hasAudioNarration":false,"actualSubdomain":"magic-markets","customDomains":["docs.magicmarkets.com"],"gitSource":{"type":"github","owner":"magicmarkets","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6affbefd1f32c51eaa745451","clientVersion":"0.0.4336","searchFilterCounts":[{"language":"default","tag":"Developers","count":45},{"language":"default","tag":"Endpoints","count":24},{"language":"default","tag":"Trading","count":20},{"language":"default","tag":"Partners","count":12},{"language":"default","tag":"Platform","count":10},{"language":"default","tag":"Orders","count":9},{"language":"default","tag":"Start here","count":8},{"language":"default","tag":"Concepts","count":5},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"The exchange","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"developers/tools/claude-skill","slug":"/developers/tools/claude-skill","pageMetadata":{"title":"Claude skill","description":"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.","icon":"sparkles","href":"/developers/tools/claude-skill"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`magicmarkets-magic-api`}),` skill packages what Claude needs to build against the API: the working guide, the REST and streaming references, task-shaped recipes, and runnable examples. It tells Claude to fetch the live `,_jsx(_components.code,{children:`llms-full.txt`}),` and OpenAPI spec as the source of truth rather than trusting memory.`]}),`\n`,_jsxs(_components.p,{children:[`Source: `,_jsx(_components.a,{href:`https://github.com/magicmarkets/magic-api`,children:`github.com/magicmarkets/magic-api`})]}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -p`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ~/.claude/skills`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` clone`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://github.com/magicmarkets/magic-api.git`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ~/.claude/skills/magicmarkets-magic-api`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Claude Code loads the skill automatically. Mention MagicMarkets, betslips, orders or the price stream and it activates.`}),`\n`,_jsx(_components.p,{children:`To update an existing install:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`git`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -C`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ~/.claude/skills/magicmarkets-magic-api`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` pull`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`If you cloned the skill before 29 September 2026, the old URL redirects, so `,_jsx(_components.code,{children:`git pull`}),` still works.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-is-inside`,children:`What is inside`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Path`}),_jsx(_components.th,{children:`Contents`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`SKILL.md`})}),_jsx(_components.td,{children:`The working guide: auth, REST market data, the trading flow, the wire format, ticks, errors, rate limits, common mistakes`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`references/rest.md`})}),_jsxs(_components.td,{children:[`REST endpoints, including `,_jsx(_components.code,{children:`GET /v2/events/`}),` and `,_jsx(_components.code,{children:`GET /v2/offers/`}),`, betslip and order shapes, heartbeats, errors and limits`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`references/streaming.md`})}),_jsx(_components.td,{children:`The full WebSocket protocol, including handshake errors and dropped connections`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`references/recipes.md`})}),_jsx(_components.td,{children:`Task-shaped patterns: discovery, placing, a live book, market making, bulk close, multi-event streaming, a REST price snapshot`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`examples/`})}),_jsx(_components.td,{children:`Runnable Python scripts`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`the-examples`,children:`The examples`}),`\n`,_jsxs(_components.p,{children:[`The examples read your key from `,_jsx(_components.code,{children:`MAGIC_API_KEY`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` ~/.claude/skills/magicmarkets-magic-api/examples`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`pip`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` requirements.txt`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` MAGIC_API_KEY`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"your-key\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`python`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 01-discover.py`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Script`}),_jsx(_components.th,{children:`What it does`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`01-discover.py`})}),_jsxs(_components.td,{children:[`List everything currently priced, via `,_jsx(_components.code,{children:`GET /v2/events/`}),` or the stream’s sync snapshot`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`02-price-book.py`})}),_jsxs(_components.td,{children:[`Maintain a correct live price book from `,_jsx(_components.code,{children:`offer`}),`, `,_jsx(_components.code,{children:`remove_offer`}),` and `,_jsx(_components.code,{children:`clear_events`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`03-market-making.py`})}),_jsx(_components.td,{children:`The full betslip, quote, order flow under heartbeat protection`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`04-bulk-close.py`})}),_jsx(_components.td,{children:`Inspect and bulk-close open orders, across every page of the order list`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`05-rest-offers.py`})}),_jsxs(_components.td,{children:[`Read prices over REST with `,_jsx(_components.code,{children:`GET /v2/offers/`}),`, up to 20 events per call`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`06-multi-stream.py`})}),_jsx(_components.td,{children:`Many events on one socket, with reconnect and re-registration`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`03`}),` and `,_jsx(_components.code,{children:`04`}),` are dry-run by default. They print what they would do and exit, and the dry run only reads. Pass `,_jsx(_components.code,{children:`--live`}),` to place or close for real, which commits real USDT. `,_jsx(_components.code,{children:`04 --all --live`}),` calls `,_jsx(_components.code,{children:`close_all`}),` with no filter, which closes every open order on the account.`]})}),`\n`,_jsx(_components.p,{children:`The repository also has offline tests and read-only live tests, which check the skill against the published OpenAPI spec. See the README for how to run them.`}),`\n`,_jsx(Heading,{level:`2`,id:`skill-and-mcp-server-together`,children:`Skill and MCP server together`}),`\n`,_jsxs(_components.p,{children:[`The skill teaches Claude the protocol. The `,_jsx(_components.a,{href:`/developers/tools/mcp`,children:`MCP server`}),` gives Claude tools to call it. Use both: the skill for building integrations, the MCP server for asking questions about live markets.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Claude skill","description":"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.","icon":"sparkles","href":"/developers/tools/claude-skill"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"What is inside","slug":"what-is-inside","depth":2,"children":[]},{"title":"The examples","slug":"the-examples","depth":2,"children":[]},{"title":"Skill and MCP server together","slug":"skill-and-mcp-server-together","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"magic-markets","siteName":"MagicMarkets","title":"Claude skill - MagicMarkets","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-29T06:46:13.317Z","originalFileLocation":"developers/tools/claude-skill.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.\">\u003cmeta data-mint-head name=\"application-name\" content=\"MagicMarkets\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Claude skill - MagicMarkets\">\u003cmeta data-mint-head property=\"og:description\" content=\"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MagicMarkets Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.magicmarkets.com/developers/tools/claude-skill\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://magic-markets.mintlify.site/_mintlify/api/og/v2?division=Tools\u0026amp;title=Claude+skill\u0026amp;description=A+drop-in+skill+that+teaches+Claude+the+MagicMarkets+API%2C+with+references+and+runnable+Python+examples.\u0026amp;theme=d5a33f2ac9b45dd8d861cdae\u0026amp;signature=88186cf001c24ab0f0c7205d18b686aa524e6c72c073320306f3b19b12eef6bd\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Claude skill - MagicMarkets\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://magic-markets.mintlify.site/_mintlify/api/og/v2?division=Tools\u0026amp;title=Claude+skill\u0026amp;description=A+drop-in+skill+that+teaches+Claude+the+MagicMarkets+API%2C+with+references+and+runnable+Python+examples.\u0026amp;theme=d5a33f2ac9b45dd8d861cdae\u0026amp;signature=88186cf001c24ab0f0c7205d18b686aa524e6c72c073320306f3b19b12eef6bd\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/magic-markets/G6_JKSGE2qJaMApl/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"MagicMarkets\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF5408\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.magicmarkets.com/developers/tools/claude-skill\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developers/tools/claude-skill.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.magicmarkets.com/#organization\",\"name\":\"MagicMarkets\",\"url\":\"https://docs.magicmarkets.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/magic-markets/K78j_U0qF2SW_a58/logo/light.png?fit=max\u0026auto=format\u0026n=K78j_U0qF2SW_a58\u0026q=85\u0026s=5b5cb25cb63b63071c2752557cd24445\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.magicmarkets.com#website\",\"name\":\"MagicMarkets\",\"url\":\"https://docs.magicmarkets.com\",\"publisher\":{\"@id\":\"https://docs.magicmarkets.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.magicmarkets.com/developers/tools/claude-skill#webpage\",\"url\":\"https://docs.magicmarkets.com/developers/tools/claude-skill\",\"name\":\"Claude skill\",\"description\":\"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.\",\"dateModified\":\"2026-09-29T06:46:13.317Z\",\"isPartOf\":{\"@id\":\"https://docs.magicmarkets.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.magicmarkets.com/developers/tools/claude-skill#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.magicmarkets.com/developers/tools/claude-skill#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tools\",\"item\":\"https://docs.magicmarkets.com/developers/tools/mcp\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Claude skill\",\"item\":\"https://docs.magicmarkets.com/developers/tools/claude-skill\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.magicmarkets.com/developers/tools/claude-skill#article\",\"headline\":\"Claude skill\",\"name\":\"Claude skill\",\"description\":\"A drop-in skill that teaches Claude the MagicMarkets API, with references and runnable Python examples.\",\"url\":\"https://docs.magicmarkets.com/developers/tools/claude-skill\",\"mainEntityOfPage\":{\"@id\":\"https://docs.magicmarkets.com/developers/tools/claude-skill#webpage\"},\"dateModified\":\"2026-09-29T06:46:13.317Z\",\"publisher\":{\"@id\":\"https://docs.magicmarkets.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.magicmarkets.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"MagicMarkets\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"MagicMarkets\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/developers/tools/claude-skill.md","siteName":"MagicMarkets","nav":{"global":{"anchors":[{"anchor":"Open MagicMarkets","icon":"external-link","href":"https://magicmarkets.com/?utm_source=docs\u0026utm_medium=owned\u0026utm_campaign=docs\u0026utm_content=sidebar_open"},{"anchor":"GitHub","icon":"github","href":"https://github.com/magicmarkets"},{"anchor":"OpenAPI spec","icon":"file-json","href":"https://magicmarkets.com/v2/openapi.yaml"}]},"tabs":[{"tab":"Platform","icon":"layers","pages":[{"title":"Platform","href":""}]},{"tab":"Trading","icon":"user-round","pages":[{"title":"Trading","href":"/traders/getting-started/create-account"}]},{"tab":"Developers","icon":"square-terminal","groups":[{"group":"Start here","pages":[{"title":"Developer overview","icon":"code","href":"/developers/overview"},{"title":"Quickstart","icon":"rocket","href":"/developers/quickstart"},{"title":"Getting started with an Agent","icon":"graduation-cap","href":"/developers/learn-with-ai"},{"title":"CLI","icon":"square-terminal","href":"/developers/tools/cli"},{"title":"Authentication","icon":"key","href":"/developers/authentication"}]},{"group":"Concepts","pages":[{"title":"Concepts","icon":"lightbulb","href":"/developers/concepts"},{"title":"Sports and bet types","icon":"list-tree","href":"/developers/sports-and-bet-types"},{"title":"Prices and ticks","icon":"ruler","href":"/developers/prices-and-ticks"},{"title":"Errors and rate limits","icon":"triangle-alert","href":"/developers/errors-and-rate-limits"},{"title":"Safety","icon":"shield-check","href":"/developers/safety"}]},{"group":"Streaming","pages":[{"title":"WebSocket stream","icon":"radio","href":"/developers/websocket-stream"}]},{"group":"Guides","pages":[{"title":"Place an order","icon":"code","href":"/developers/guides/place-an-order"},{"title":"Maintain a live price book","icon":"book-open","href":"/developers/guides/price-book"},{"title":"Market making with heartbeat protection","icon":"repeat","href":"/developers/guides/market-making"},{"title":"Bulk close","icon":"square-x","href":"/developers/guides/bulk-close"},{"title":"Stream many events","icon":"waves","href":"/developers/guides/multi-event-streaming"}]},{"group":"Tools","pages":[{"title":"MCP server","description":"Let Claude and other agents read and trade MagicMarkets markets, through the local server in the CLI or the hosted server at magicmarkets.com/mcp.","icon":"bot","href":"/developers/tools/mcp"},{"title":"Claude skill","icon":"sparkles","href":"/developers/tools/claude-skill"},{"title":"Machine-readable docs","description":"llms.txt, llms-full.txt, the OpenAPI spec, Markdown versions of every page, and the docs MCP server. Point an agent at one URL.","icon":"file-code","href":"/developers/tools/machine-readable-docs"}]},{"group":"API reference","pages":[{"title":"API reference","icon":"book-open-text","href":"/developers/api-reference/introduction"}]},{"group":"Endpoints","pages":[{"group":"Betslips","pages":[{"title":"List betslips","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/betslips/","href":"/developers/api-reference/betslips/list-betslips"},{"title":"Create betslip","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/betslips/","href":"/developers/api-reference/betslips/create-betslip"},{"title":"Get betslip","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/betslips/{betslip_id}/","href":"/developers/api-reference/betslips/get-betslip"},{"title":"Close betslip","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json delete /v2/betslips/{betslip_id}/","href":"/developers/api-reference/betslips/close-betslip"},{"title":"Refresh betslip","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/betslips/{betslip_id}/refresh/","href":"/developers/api-reference/betslips/refresh-betslip"}]},{"group":"Orders","pages":[{"title":"List orders","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/orders/","href":"/developers/api-reference/orders/list-orders"},{"title":"Create order","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/orders/","href":"/developers/api-reference/orders/create-order"},{"title":"Order updates","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/orders/updates/","href":"/developers/api-reference/orders/order-updates"},{"title":"Get order","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/orders/{order_id}/","href":"/developers/api-reference/orders/get-order"},{"title":"Get order by UUID","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/orders/tracked/{uuid}/","href":"/developers/api-reference/orders/get-order-by-uuid"},{"title":"Close an order","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/orders/{order_id}/close/","href":"/developers/api-reference/orders/close-an-order"},{"title":"Close multiple orders","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/orders/close_many/","href":"/developers/api-reference/orders/close-multiple-orders"},{"title":"Close all open orders","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/orders/close_all/","href":"/developers/api-reference/orders/close-all-open-orders"},{"title":"Calculate position","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/orders/position/","href":"/developers/api-reference/orders/calculate-position"}]},{"group":"Account","pages":[{"title":"Account balance","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/balance/","href":"/developers/api-reference/account/account-balance"}]},{"group":"Heartbeats","pages":[{"title":"List heartbeats","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/heartbeats/","href":"/developers/api-reference/heartbeats/list-heartbeats"},{"title":"Create heartbeat","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/heartbeats/","href":"/developers/api-reference/heartbeats/create-heartbeat"},{"title":"Get heartbeat","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/heartbeats/{heartbeat_id}/","href":"/developers/api-reference/heartbeats/get-heartbeat"},{"title":"Cancel heartbeat","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json delete /v2/heartbeats/{heartbeat_id}/","href":"/developers/api-reference/heartbeats/cancel-heartbeat"},{"title":"Refresh heartbeat","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json post /v2/heartbeats/{heartbeat_id}/refresh/","href":"/developers/api-reference/heartbeats/refresh-heartbeat"}]},{"group":"Reference","pages":[{"title":"Exchange rates","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/xrates/","href":"/developers/api-reference/reference/exchange-rates"},{"title":"Bet type info","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/sports/{sport}/bet_types/{bet_type}/","href":"/developers/api-reference/reference/bet-type-info"}]},{"group":"Market data","pages":[{"title":"List events","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/events/","href":"/developers/api-reference/market-data/list-events"},{"title":"List offers for an event","deprecated":null,"version":null,"openapi":"/openapi/magicmarkets-v2.json get /v2/offers/","href":"/developers/api-reference/market-data/list-offers-for-an-event"}]}]},{"group":"Updates","pages":[{"title":"Changelog","icon":"list","href":"/developers/changelog"}]}]},{"tab":"Partners","icon":"handshake","pages":[{"title":"Partners","href":"/partners/overview"}]}]},"basePath":"","title":"Claude skill - MagicMarkets","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":[],"chunks":[]}