All URIs are relative to https://api.elections.kalshi.com/trade-api/v2
MethodHTTP requestDescription
get_exchange_announcementsGET /exchange/announcementsGet Exchange Announcements
get_exchange_scheduleGET /exchange/scheduleGet Exchange Schedule
get_exchange_statusGET /exchange/statusGet Exchange Status
get_user_data_timestampGET /exchange/user_data_timestampGet User Data Timestamp

get_exchange_announcements

GetExchangeAnnouncementsResponse get_exchange_announcements()
Get Exchange Announcements Get all exchange-wide announcements

Example

import kalshi_python
from kalshi_python.models.get_exchange_announcements_response import GetExchangeAnnouncementsResponse
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"
)


# Initialize the Kalshi client
client = kalshi_python.KalshiClient(configuration)

try:
    # Get Exchange Announcements
    api_response = client.get_exchange_announcements()
    print("The response of ExchangeApi->get_exchange_announcements:\n")
    pprint(api_response)
except Exception as e:
    print("Exception when calling ExchangeApi->get_exchange_announcements: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetExchangeAnnouncementsResponse

HTTP response details

Status codeDescription
200Announcements retrieved successfully
500Internal server error
[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_exchange_schedule

GetExchangeScheduleResponse get_exchange_schedule()
Get Exchange Schedule Get the exchange schedule

Example

import kalshi_python
from kalshi_python.models.get_exchange_schedule_response import GetExchangeScheduleResponse
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"
)


# Initialize the Kalshi client
client = kalshi_python.KalshiClient(configuration)

try:
    # Get Exchange Schedule
    api_response = client.get_exchange_schedule()
    print("The response of ExchangeApi->get_exchange_schedule:\n")
    pprint(api_response)
except Exception as e:
    print("Exception when calling ExchangeApi->get_exchange_schedule: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetExchangeScheduleResponse

HTTP response details

Status codeDescription
200Schedule retrieved successfully
500Internal server error
[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_exchange_status

ExchangeStatus get_exchange_status()
Get Exchange Status Get the exchange status

Example

import kalshi_python
from kalshi_python.models.exchange_status import ExchangeStatus
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"
)


# Initialize the Kalshi client
client = kalshi_python.KalshiClient(configuration)

try:
    # Get Exchange Status
    api_response = client.get_exchange_status()
    print("The response of ExchangeApi->get_exchange_status:\n")
    pprint(api_response)
except Exception as e:
    print("Exception when calling ExchangeApi->get_exchange_status: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ExchangeStatus

HTTP response details

Status codeDescription
200Status retrieved successfully
500Internal server error
[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_user_data_timestamp

GetUserDataTimestampResponse get_user_data_timestamp()
Get User Data Timestamp There is typically a short delay before exchange events are reflected in the API endpoints. Whenever possible, combine API responses to PUT/POST/DELETE requests with websocket data to obtain the most accurate view of the exchange state. This endpoint provides an approximate indication of when the data from the following endpoints was last validated: GetBalance, GetOrder(s), GetFills, GetPositions

Example

import kalshi_python
from kalshi_python.models.get_user_data_timestamp_response import GetUserDataTimestampResponse
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)

try:
    # Get User Data Timestamp
    api_response = client.get_user_data_timestamp()
    print("The response of ExchangeApi->get_user_data_timestamp:\n")
    pprint(api_response)
except Exception as e:
    print("Exception when calling ExchangeApi->get_user_data_timestamp: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetUserDataTimestampResponse

HTTP response details

Status codeDescription
200Timestamp retrieved successfully
401Unauthorized - authentication required
500Internal server error
[Back to top] [Back to API list] [Back to Model list] [Back to README]