Python SDK for Bet Code APIs
managebetcodespip install managebetcodesOn this page
How to install the Python SDK
pip install managebetcodesInstall with pip install managebetcodes: the managebetcodes package on PyPI runs on Python 3.9 and later with typed models for convert, view, split, merge, book, search, resolve, tracking, history, books, and capabilities.
How to create a Python client and convert a code
Create a client with Client(api_key="mbc_live_your_key") and call client.convert(code="7B9A2F", source="sportybet", target="1xng") to convert a SportyBet code to 1xBet NG. The client sends X-API-Key, adds an Idempotency-Key on each POST (or uses the caller's), and supports a configurable base URL and timeout.
from managebetcodes import Client
client = Client(api_key="mbc_live_your_key")
result = client.convert(code="7B9A2F", source="sportybet", target="1xng")
print(result["target"]["code"])Which methods the Python SDK provides
The Manage Bet Codes Python SDK covers every Public API v1 surface: client.convert, view, view_image, split, merge, book, events.search, events.markets, resolve, markets.list, books.list, and capabilities. Each method maps to the same /v1 route and billing as the raw REST call.
client.convert(...)client.convert_to_all(...)client.convert_bulk(...)client.view(...)client.view_image(...)client.split(...)client.merge(...)client.book(...)client.events.search(...)client.events.markets(...)client.resolve(...)client.markets.list(...)client.books.list(...)client.capabilities()
How the Python SDK retries, paginates, and verifies webhooks
The Manage Bet Codes Python SDK retries 429, 502, 503, and 504 with Retry-After backoff, raises typed errors for auth, quota, rate limit, validation, and API faults, paginates history, jobs, books, and search, downloads images as bytes, verifies X-MBC-Signature webhooks, and supports a configurable base URL and timeout.
- Retry on 429, 502, 503, and 504. Honor
Retry-After. - Typed errors for auth, quota, rate limit, validation, and API failures.
- Pagination for history, jobs, books, and search.
- Image download as bytes.
- Webhook signature verification for
X-MBC-Signature. - Configurable base URL and timeout.
Which HTTP request the Python SDK sends
The Manage Bet Codes Python client.convert(code="7B9A2F", source="sportybet", target="1xng") sends POST /v1/convert with {"code": "7B9A2F", "from": "sportybet", "to": "1xng"} and the X-API-Key header. Read convert for the full response and errors for the error envelope.
POST /v1/convert
{"code": "7B9A2F", "from": "sportybet", "to": "1xng"}