Omnibook Python SDK
Official Python client for the Omnibook prediction market exchange. Sign up, create an API key, install this package, and trade.
pip install omnibook
from omnibook import Client
client = Client(api_key="<alphanumeric-api-key>", api_secret="<64-char-hex-secret>")
status = client.get_exchange_status()
rounds = client.get_rounds(limit=5)
order = client.place_order(
client_order_id="42",
market_id=66,
side="buy",
outcome="yes",
type="limit",
tick=47,
qty=10,
tif="gtc",
post_only=True,
)
Prerequisites
- Sign in at omnibook.xyz.
- Deposit USDC (bot keys cannot withdraw).
- Create a key under Settings → API keys. Copy the API key and secret (the secret is shown once).
Docs: docs.omnibook.xyz/sdk/python
Environments
| Env | REST | WebSocket |
|---|---|---|
| Production (default) | https://api.omnibook.xyz |
wss://api.omnibook.xyz/v1/ws |
| Local | http://127.0.0.1:9104 |
ws://127.0.0.1:9105/v1/ws |
client = Client(
api_key="...",
api_secret="...",
base_url="http://127.0.0.1:9104",
ws_url="ws://127.0.0.1:9105/v1/ws",
)
Sync and async
from omnibook import Client, AsyncClient
# Sync
with Client(api_key=..., api_secret=...) as client:
print(client.get_balance())
# Async
async with AsyncClient(api_key=..., api_secret=...) as client:
print(await client.get_balance())
WebSocket
from omnibook import Client
with Client(api_key=..., api_secret=...) as client:
with client.websocket() as ws:
ws.subscribe(channels=["rounds", "oracle", "user"])
ws.subscribe(channels=["orderbook_delta", "trades"], market_ids=[66])
for msg in ws:
print(msg)
Auth note
Every request is HMAC-SHA256 signed. Settings hands you a 64-character hex
secret (32 raw bytes). Pass that string (or a legacy base64 secret) to
api_secret — the SDK hex-/base64-decodes it to the raw HMAC key for you.
Tests
pip install -e ".[dev]"
pytest # unit tests (mocked)
OMNIBOOK_RUN_INTEGRATION=1 \
OMNIBOOK_API_KEY=... \
OMNIBOOK_API_SECRET=... \
pytest -m integration # live venue
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omnibook-1.1.0.tar.gz.
File metadata
- Download URL: omnibook-1.1.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e83a5dff55888918a25451fa76bb8706d541319d9c0c3399f89babd7b35241c0
|
|
| MD5 |
55df31121482a0b999bf8e00f43517c4
|
|
| BLAKE2b-256 |
ad550965be96d1f1ea39dccdefbda4c180f40ba859dd0b08fa076efe8c948e10
|
Provenance
The following attestation bundles were made for omnibook-1.1.0.tar.gz:
Publisher:
publish.yml on OmniBook-HQ/python-sdk-v1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omnibook-1.1.0.tar.gz -
Subject digest:
e83a5dff55888918a25451fa76bb8706d541319d9c0c3399f89babd7b35241c0 - Sigstore transparency entry: 2299202764
- Sigstore integration time:
-
Permalink:
OmniBook-HQ/python-sdk-v1@63102c1691334ca12fc3e099e16e439ed9b02ba1 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/OmniBook-HQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63102c1691334ca12fc3e099e16e439ed9b02ba1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file omnibook-1.1.0-py3-none-any.whl.
File metadata
- Download URL: omnibook-1.1.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac94988dd75ca95a82e289a690342987c0260877e4bf0c4a467e1ee112b0d565
|
|
| MD5 |
53fb48faf3f460e97db7fb289beaf176
|
|
| BLAKE2b-256 |
af8b6a709f4ed9be4b1e151699e34e1523ca7bea28b5ec04fadd13995beeb9b0
|
Provenance
The following attestation bundles were made for omnibook-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on OmniBook-HQ/python-sdk-v1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omnibook-1.1.0-py3-none-any.whl -
Subject digest:
ac94988dd75ca95a82e289a690342987c0260877e4bf0c4a467e1ee112b0d565 - Sigstore transparency entry: 2299202816
- Sigstore integration time:
-
Permalink:
OmniBook-HQ/python-sdk-v1@63102c1691334ca12fc3e099e16e439ed9b02ba1 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/OmniBook-HQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@63102c1691334ca12fc3e099e16e439ed9b02ba1 -
Trigger Event:
workflow_dispatch
-
Statement type: