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"])
        replies = ws.subscribe(channels=["orderbook_delta", "trades"], market_ids=[66])
        sid = replies[0]["sid"]
        # Re-emit snapshots without changing the market set / sid seq:
        ws.update_subscription(sid=sid, action="get_snapshot", 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.2.0.tar.gz (18.1 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.2.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file omnibook-1.2.0.tar.gz.

File metadata

  • Download URL: omnibook-1.2.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for omnibook-1.2.0.tar.gz
Algorithm Hash digest
SHA256 78fac84bb9e5abc1354fda9e9b10a978de9f33d8b06a99d9141b64dadf3711ff
MD5 f28997b37387833856cacd6f2bb8438f
BLAKE2b-256 42a2ec0589bda4f1da87db9b9d34715e4b878547a787d5683fcb634349b32349

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnibook-1.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: omnibook-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e2a1a6294bb3cf5e7a413fa9d36e12d1383e4ada8762e16765e01ce9fea0b9
MD5 1139da49db2cdb2d991f6c5c04cd2926
BLAKE2b-256 b690eeb44e57e6ed8dfd7e2036b38f445307b619c25b54c129d2dfeb73f7f883

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnibook-1.2.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

This release

1.2.0 This release

2 files

1.1.0

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