Installation
Quick Start
Async Support
Trading
Place an Order
List Orders
Cancel an Order
Complex Orders
Complex orders let you place iceberg slices, pegged orders, smart-taker orders, and take-profit / stop-loss triggers. Pass exactly one oficeberg_order_params,
peg_order_params, smart_taker_order_params, or conditional_order_params along
with subaccount_id and either river_id or generic_asset_id. The endpoint returns
202 with the order in PENDING status — it’s activated asynchronously.
Iceberg
Peg
Smart Taker
Take-profit attached to a parent order
Standalone stop
- Prices and
limit_priceare 0–1 (Kalshi-style probability), not dollars. - For TP/SL you must supply
parent_river_order_id(orparent_complex_order_idto chain). For standalone STOP, omit parents and setstop_order_price. TriggerOrder.priceis required whenorder_type="LIMIT", omit for"MARKET".
Portfolio
Get Positions
Get Fills
Market Data
Search Markets
When using a free-text
q=, always pair it with date filters
(expiration_date_start, start_datetime_after/before) and status="active" —
otherwise results include long-expired markets and the ranking is dominated by
historical noise. See the Quick Start above for the recommended shape.Parameters
Search query.
Filter by exchange name (
KALSHI, POLYMARKET).Filter by canonical category. Pass a list to filter to multiple:
Sports,
Crypto, Politics, Finance, Entertainment, Science & Tech, Weather,
World Affairs, Health, Social, Other.Filter by subcategory (e.g.
Basketball, Football).Filter by instrument status. Defaults to active markets.
Start of expiration date range (inclusive).
End of expiration date range (exclusive).
Filter to markets with
start_datetime >= this.Filter to markets with
start_datetime < this.Filter by
event_ticker (exact match).Sort mode for event-based pagination:
trending, volume, newest,
ending-soon, start-time.Maximum number of results (1–1000).
Offset for pagination.
Paginate by events instead of markets. Up to 200 by default; values above that
require
start_datetime_after or start_datetime_before.Event offset for event-based pagination.
Orderbook
Price History
Realtime (WebSockets)
The async client exposes three live data feeds atclient.realtime. Each returns a
Subscription you use as an async context manager and async iterator. Disconnects are
handled transparently — the client reconnects and re-sends the active subscription set,
so iteration just resumes.
The underlying wire protocol is documented under
WS API Reference.
Orderbook stream
Order status stream
Order updates are pinned to one subaccount at handshake — there is no subscribe/unsubscribe frame.Trade tape
Notes
- All three subscriptions reconnect transparently on disconnect; the iterator simply pauses and resumes.
- In Jupyter, drop
asyncio.run(...)and use top-levelawaitdirectly in a cell. Subscriptionworks as a context manager — exiting theasync withblock closes the socket cleanly.Message.typeis always set; endpoint-specific fields (data,river_id,orders,code,message) are accessed as attributes or viamsg.model_extra.
Subaccounts
Error Handling
The SDK raises typed exceptions for API errors:Configuration
GitHub
View the source code and contribute on GitHub.

