import kalshi_python
from kalshi_python.models.get_series_response import GetSeriesResponse
from kalshi_python.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.elections.kalshi.com/trade-api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = kalshi_python.Configuration(
host = "https://api.elections.kalshi.com/trade-api/v2"
)
# Read private key from file
with open('path/to/private_key.pem', 'r') as f:
private_key = f.read()
# Configure API key authentication
configuration.api_key_id = "your-api-key-id"
configuration.private_key_pem = private_key
# Initialize the Kalshi client
client = kalshi_python.KalshiClient(configuration)
status = 'status_example' # str | Filter by series status (optional)
try:
# Get Series
api_response = client.get_series(status=status)
print("The response of SeriesApi->get_series:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SeriesApi->get_series: %s\n" % e)