Examples#
Example:
try:
m = client.get_market("NOT-A-REAL-TICKER")
except kd.KalshiAPIError as e:
print(e.status_code, e.code, e.message)
kd.KalshiAPIErrorRaised when Kalshi returns an HTTP error.
max_retries times. Inherits from KalshiError.| Attribute | Type | Description |
|---|---|---|
status_code | int | HTTP status code |
code | Kalshi’s error code | |
message | str | Kalshi’s error message |
details | Extra details from Kalshi, if any | |
url | str | The URL that was requested |
KalshiClient.get_marketKalshiErrorstakepd.kalshi_data.Example:
try:
m = client.get_market("NOT-A-REAL-TICKER")
except kd.KalshiAPIError as e:
print(e.status_code, e.code, e.message)
This method is also covered, alongside the rest of the module, in the overview guide.