Skip to main content

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

  1. Sign in at omnibook.xyz.
  2. Deposit USDC (bot keys cannot withdraw).
  3. 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

omnibook-1.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnibook-1.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for omnibook-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e83a5dff55888918a25451fa76bb8706d541319d9c0c3399f89babd7b35241c0
MD5 55df31121482a0b999bf8e00f43517c4
BLAKE2b-256 ad550965be96d1f1ea39dccdefbda4c180f40ba859dd0b08fa076efe8c948e10

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnibook-1.1.0.tar.gz:

Publisher: publish.yml on OmniBook-HQ/python-sdk-v1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for omnibook-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac94988dd75ca95a82e289a690342987c0260877e4bf0c4a467e1ee112b0d565
MD5 53fb48faf3f460e97db7fb289beaf176
BLAKE2b-256 af8b6a709f4ed9be4b1e151699e34e1523ca7bea28b5ec04fadd13995beeb9b0

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.2.0

2 files

This release

1.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page