How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.
The pages in this section are generated from the OpenAPI 3.1 spec that MagicMarkets publishes at https://magicmarkets.com/v2/openapi.yaml. Each endpoint page shows the request, every response shape, and an interactive playground.
Base URL
https://magicmarkets.com/v2/
Every path also works behind the /magic-api prefix.
Authentication
Send your API key in the X-Api-Key header on every request. See Authentication.
GET, POST /v2/betslips/; GET, DELETE /v2/betslips/{betslip_id}/; POST /v2/betslips/{betslip_id}/refresh/
Orders
GET, POST /v2/orders/; GET /v2/orders/{order_id}/; GET /v2/orders/updates/; GET /v2/orders/tracked/{uuid}/; POST /v2/orders/{order_id}/close/; POST /v2/orders/close_many/; POST /v2/orders/close_all/; GET /v2/orders/position/
Account
GET /v2/balance/; GET /v2/xrates/
Heartbeats
GET, POST /v2/heartbeats/; GET, DELETE /v2/heartbeats/{heartbeat_id}/; POST /v2/heartbeats/{heartbeat_id}/refresh/
The playground sends real requests to the production API with the key you enter. POST /v2/orders/ places a real order with real USDT. POST /v2/orders/close_all/ with an empty body closes every open order on the account.
Versions
The spec carries info.version, currently 0.1.0. The changelog records dated changes to the API, the tools and these docs.
{"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":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"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/api-reference/introduction","slug":"/developers/api-reference/introduction","pageMetadata":{"title":"API reference","description":"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.","icon":"book-open-text","href":"/developers/api-reference/introduction"},"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: \"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.\"\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 pages in this section are generated from the OpenAPI 3.1 spec that MagicMarkets publishes at `,_jsx(_components.code,{children:`https://magicmarkets.com/v2/openapi.yaml`}),`. Each endpoint page shows the request, every response shape, and an interactive playground.`]}),`\n`,_jsx(Heading,{level:`2`,id:`base-url`,children:`Base URL`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://magicmarkets.com/v2/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Every path also works behind the `,_jsx(_components.code,{children:`/magic-api`}),` prefix.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[`Send your API key in the `,_jsx(_components.code,{children:`X-Api-Key`}),` header on every request. See `,_jsx(_components.a,{href:`/developers/authentication`,children:`Authentication`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`envelope`,children:`Envelope`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#F44747`,\"--shiki-dark\":`#F44747`},children:`...`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003ccode>\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#F44747`,\"--shiki-dark\":`#F44747`},children:`\u003cdetails>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Check `,_jsx(_components.code,{children:`status`}),` before reading `,_jsx(_components.code,{children:`data`}),`. Branch on `,_jsx(_components.code,{children:`code`}),`. See `,_jsx(_components.a,{href:`/developers/errors-and-rate-limits`,children:`Errors and rate limits`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint-groups`,children:`Endpoint groups`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Group`}),_jsx(_components.th,{children:`Endpoints`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Betslips`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`POST /v2/betslips/`}),`; `,_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`DELETE /v2/betslips/{betslip_id}/`}),`; `,_jsx(_components.code,{children:`POST /v2/betslips/{betslip_id}/refresh/`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Orders`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`POST /v2/orders/`}),`; `,_jsx(_components.code,{children:`GET /v2/orders/{order_id}/`}),`; `,_jsx(_components.code,{children:`GET /v2/orders/updates/`}),`; `,_jsx(_components.code,{children:`GET /v2/orders/tracked/{uuid}/`}),`; `,_jsx(_components.code,{children:`POST /v2/orders/{order_id}/close/`}),`; `,_jsx(_components.code,{children:`POST /v2/orders/close_many/`}),`; `,_jsx(_components.code,{children:`POST /v2/orders/close_all/`}),`; `,_jsx(_components.code,{children:`GET /v2/orders/position/`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Account`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET /v2/balance/`}),`; `,_jsx(_components.code,{children:`GET /v2/xrates/`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Heartbeats`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`POST /v2/heartbeats/`}),`; `,_jsx(_components.code,{children:`GET`}),`, `,_jsx(_components.code,{children:`DELETE /v2/heartbeats/{heartbeat_id}/`}),`; `,_jsx(_components.code,{children:`POST /v2/heartbeats/{heartbeat_id}/refresh/`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Market data`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET /v2/events/`}),`; `,_jsx(_components.code,{children:`GET /v2/offers/`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Reference`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v2/sports/{sport}/bet_types/{bet_type}/`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Streaming`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET /v2/stream`}),` (WebSocket upgrade). See `,_jsx(_components.a,{href:`/developers/websocket-stream`,children:`WebSocket stream`})]})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The playground sends real requests to the production API with the key you enter. `,_jsx(_components.code,{children:`POST /v2/orders/`}),` places a real order with real USDT. `,_jsx(_components.code,{children:`POST /v2/orders/close_all/`}),` with an empty body closes every open order on the account.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`versions`,children:`Versions`}),`\n`,_jsxs(_components.p,{children:[`The spec carries `,_jsx(_components.code,{children:`info.version`}),`, currently `,_jsx(_components.code,{children:`0.1.0`}),`. The `,_jsx(_components.a,{href:`/developers/changelog`,children:`changelog`}),` records dated changes to the API, the tools and these docs.`]})]})}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":"API reference","description":"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.","icon":"book-open-text","href":"/developers/api-reference/introduction"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Base URL","slug":"base-url","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Envelope","slug":"envelope","depth":2,"children":[]},{"title":"Endpoint groups","slug":"endpoint-groups","depth":2,"children":[]},{"title":"Versions","slug":"versions","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"magic-markets","siteName":"MagicMarkets","title":"API reference - MagicMarkets","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-09T13:51:42.815Z","originalFileLocation":"developers/api-reference/introduction.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=\"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.\">\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=\"API reference - MagicMarkets\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"MagicMarkets Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.magicmarkets.com/developers/api-reference/introduction\">\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=API+reference\u0026amp;title=API+reference\u0026amp;description=How+to+read+the+endpoint+pages%2C+the+base+URL%2C+authentication%2C+the+response+envelope%2C+and+a+note+on+the+playground.\u0026amp;theme=d5a33f2ac9b45dd8d861cdae\u0026amp;signature=2ace96e22a64ca5d7fa1e017bb415094d6826332711315e7051316074b9b3e2d\">\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=\"API reference - MagicMarkets\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://magic-markets.mintlify.site/_mintlify/api/og/v2?division=API+reference\u0026amp;title=API+reference\u0026amp;description=How+to+read+the+endpoint+pages%2C+the+base+URL%2C+authentication%2C+the+response+envelope%2C+and+a+note+on+the+playground.\u0026amp;theme=d5a33f2ac9b45dd8d861cdae\u0026amp;signature=2ace96e22a64ca5d7fa1e017bb415094d6826332711315e7051316074b9b3e2d\">\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/api-reference/introduction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developers/api-reference/introduction.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/api-reference/introduction#webpage\",\"url\":\"https://docs.magicmarkets.com/developers/api-reference/introduction\",\"name\":\"API reference\",\"description\":\"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.\",\"dateModified\":\"2026-10-09T13:51:42.815Z\",\"isPartOf\":{\"@id\":\"https://docs.magicmarkets.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.magicmarkets.com/developers/api-reference/introduction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.magicmarkets.com/developers/api-reference/introduction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"MagicMarkets\",\"item\":\"https://docs.magicmarkets.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API reference\",\"item\":\"https://docs.magicmarkets.com/developers/api-reference/introduction\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.magicmarkets.com/developers/api-reference/introduction#article\",\"headline\":\"API reference\",\"name\":\"API reference\",\"description\":\"How to read the endpoint pages, the base URL, authentication, the response envelope, and a note on the playground.\",\"url\":\"https://docs.magicmarkets.com/developers/api-reference/introduction\",\"mainEntityOfPage\":{\"@id\":\"https://docs.magicmarkets.com/developers/api-reference/introduction#webpage\"},\"dateModified\":\"2026-10-09T13:51:42.815Z\",\"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/api-reference/introduction.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","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","description":"Returns all open betslip IDs for the authenticated customer.","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":"API reference - MagicMarkets","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":[],"chunks":[]}