Skip to content

Default API Reference

Endpoints

Get Exchange Announcements

Synchronous API Call

kalshi_py.api.default.get_exchange_announcements.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetExchangeAnnouncementsResponse]

Get Exchange Announcements

Endpoint for getting all exchange-wide announcements.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetExchangeAnnouncementsResponse]

ModelGetExchangeAnnouncementsResponse

Source code in kalshi_py/api/default/get_exchange_announcements.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetExchangeAnnouncementsResponse]:
    """Get Exchange Announcements

      Endpoint for getting all exchange-wide announcements.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetExchangeAnnouncementsResponse
    """

    return sync_detailed(
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.default.get_exchange_announcements.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetExchangeAnnouncementsResponse] async

Get Exchange Announcements

Endpoint for getting all exchange-wide announcements.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetExchangeAnnouncementsResponse]

ModelGetExchangeAnnouncementsResponse

Source code in kalshi_py/api/default/get_exchange_announcements.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetExchangeAnnouncementsResponse]:
    """Get Exchange Announcements

      Endpoint for getting all exchange-wide announcements.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetExchangeAnnouncementsResponse
    """

    return (
        await asyncio_detailed(
            client=client,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.default.get_exchange_announcements.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetExchangeAnnouncementsResponse]

Get Exchange Announcements

Endpoint for getting all exchange-wide announcements.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetExchangeAnnouncementsResponse]

Response[ModelGetExchangeAnnouncementsResponse]

Source code in kalshi_py/api/default/get_exchange_announcements.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetExchangeAnnouncementsResponse]:
    """Get Exchange Announcements

      Endpoint for getting all exchange-wide announcements.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetExchangeAnnouncementsResponse]
    """

    kwargs = _get_kwargs()

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.default.get_exchange_announcements.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetExchangeAnnouncementsResponse] async

Get Exchange Announcements

Endpoint for getting all exchange-wide announcements.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetExchangeAnnouncementsResponse]

Response[ModelGetExchangeAnnouncementsResponse]

Source code in kalshi_py/api/default/get_exchange_announcements.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetExchangeAnnouncementsResponse]:
    """Get Exchange Announcements

      Endpoint for getting all exchange-wide announcements.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetExchangeAnnouncementsResponse]
    """

    kwargs = _get_kwargs()

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

Get Exchange Schedule

Synchronous API Call

kalshi_py.api.default.get_exchange_schedule.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetExchangeScheduleResponse]

Get Exchange Schedule

Endpoint for getting the exchange schedule.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetExchangeScheduleResponse]

ModelGetExchangeScheduleResponse

Source code in kalshi_py/api/default/get_exchange_schedule.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetExchangeScheduleResponse]:
    """Get Exchange Schedule

      Endpoint for getting the exchange schedule.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetExchangeScheduleResponse
    """

    return sync_detailed(
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.default.get_exchange_schedule.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetExchangeScheduleResponse] async

Get Exchange Schedule

Endpoint for getting the exchange schedule.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetExchangeScheduleResponse]

ModelGetExchangeScheduleResponse

Source code in kalshi_py/api/default/get_exchange_schedule.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetExchangeScheduleResponse]:
    """Get Exchange Schedule

      Endpoint for getting the exchange schedule.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetExchangeScheduleResponse
    """

    return (
        await asyncio_detailed(
            client=client,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.default.get_exchange_schedule.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetExchangeScheduleResponse]

Get Exchange Schedule

Endpoint for getting the exchange schedule.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetExchangeScheduleResponse]

Response[ModelGetExchangeScheduleResponse]

Source code in kalshi_py/api/default/get_exchange_schedule.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetExchangeScheduleResponse]:
    """Get Exchange Schedule

      Endpoint for getting the exchange schedule.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetExchangeScheduleResponse]
    """

    kwargs = _get_kwargs()

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.default.get_exchange_schedule.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetExchangeScheduleResponse] async

Get Exchange Schedule

Endpoint for getting the exchange schedule.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetExchangeScheduleResponse]

Response[ModelGetExchangeScheduleResponse]

Source code in kalshi_py/api/default/get_exchange_schedule.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetExchangeScheduleResponse]:
    """Get Exchange Schedule

      Endpoint for getting the exchange schedule.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetExchangeScheduleResponse]
    """

    kwargs = _get_kwargs()

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

Get Exchange Status

Synchronous API Call

kalshi_py.api.default.get_exchange_status.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelExchangeStatus]

Get Exchange Status

Endpoint for getting the exchange status.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelExchangeStatus]

ModelExchangeStatus

Source code in kalshi_py/api/default/get_exchange_status.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelExchangeStatus]:
    """Get Exchange Status

      Endpoint for getting the exchange status.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelExchangeStatus
    """

    return sync_detailed(
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.default.get_exchange_status.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelExchangeStatus] async

Get Exchange Status

Endpoint for getting the exchange status.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelExchangeStatus]

ModelExchangeStatus

Source code in kalshi_py/api/default/get_exchange_status.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelExchangeStatus]:
    """Get Exchange Status

      Endpoint for getting the exchange status.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelExchangeStatus
    """

    return (
        await asyncio_detailed(
            client=client,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.default.get_exchange_status.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelExchangeStatus]

Get Exchange Status

Endpoint for getting the exchange status.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelExchangeStatus]

Response[ModelExchangeStatus]

Source code in kalshi_py/api/default/get_exchange_status.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelExchangeStatus]:
    """Get Exchange Status

      Endpoint for getting the exchange status.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelExchangeStatus]
    """

    kwargs = _get_kwargs()

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.default.get_exchange_status.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelExchangeStatus] async

Get Exchange Status

Endpoint for getting the exchange status.

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelExchangeStatus]

Response[ModelExchangeStatus]

Source code in kalshi_py/api/default/get_exchange_status.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelExchangeStatus]:
    """Get Exchange Status

      Endpoint for getting the exchange status.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelExchangeStatus]
    """

    kwargs = _get_kwargs()

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

Get User Data Timestamp

Synchronous API Call

kalshi_py.api.default.get_user_data_timestamp.sync(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetUserDataTimestampResponse]

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

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetUserDataTimestampResponse]

ModelGetUserDataTimestampResponse

Source code in kalshi_py/api/default/get_user_data_timestamp.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetUserDataTimestampResponse]:
    """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

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetUserDataTimestampResponse
    """

    return sync_detailed(
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.default.get_user_data_timestamp.asyncio(*, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetUserDataTimestampResponse] async

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

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[ModelGetUserDataTimestampResponse]

ModelGetUserDataTimestampResponse

Source code in kalshi_py/api/default/get_user_data_timestamp.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetUserDataTimestampResponse]:
    """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

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        ModelGetUserDataTimestampResponse
    """

    return (
        await asyncio_detailed(
            client=client,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.default.get_user_data_timestamp.sync_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetUserDataTimestampResponse]

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

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetUserDataTimestampResponse]

Response[ModelGetUserDataTimestampResponse]

Source code in kalshi_py/api/default/get_user_data_timestamp.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetUserDataTimestampResponse]:
    """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

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetUserDataTimestampResponse]
    """

    kwargs = _get_kwargs()

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.default.get_user_data_timestamp.asyncio_detailed(*, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetUserDataTimestampResponse] async

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

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[ModelGetUserDataTimestampResponse]

Response[ModelGetUserDataTimestampResponse]

Source code in kalshi_py/api/default/get_user_data_timestamp.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetUserDataTimestampResponse]:
    """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

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[ModelGetUserDataTimestampResponse]
    """

    kwargs = _get_kwargs()

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)