Installation

Requires Python 3.11+. The SDK depends on httpx and pydantic.

Initialize the Client

Or set the RULEBOOK_API_KEY environment variable and omit the parameter:
You can also override the base URL via the RULEBOOK_BASE_URL environment variable:

List Exchanges

Response type: ExchangeListResponse

Get Exchange Details

Response type: ExchangeDetailResponse

List Fee Schedule Results

Response type: PaginatedResponse[FeeScheduleResult] Filter parameters:

Get a Single Fee Schedule Result

Response type: FeeScheduleResultResponse

Get Available Filters

Discover valid filter values before querying results:
Optionally narrow filter values to specific exchanges:
Response type: FeeScheduleResultFiltersResponse

Get Results by Version

Retrieve all fee schedule results from a specific extraction version:
Response type: PaginatedResponse[FeeScheduleResult]

Pagination

Fee schedule results are paginated. Use page_number and page_size to iterate:

Async Client

The async client has an identical API surface — every method is await-able.

Context Manager

Both clients support context managers for automatic cleanup:

Next Steps

Error Handling

Handle API errors with typed exceptions

Advanced Usage

Timeouts, retries, raw responses, and per-request overrides