Skip to content

Market API Reference

Endpoints

Get Event

Synchronous API Call

kalshi_py.api.market.get_event.sync(event_ticker: str, *, client: Union[AuthenticatedClient, Client], with_nested_markets: Union[Unset, bool] = UNSET) -> Optional[ModelGetEventResponse]

Get Event

Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required
with_nested_markets Union[Unset, bool]

If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.

UNSET

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[ModelGetEventResponse]

ModelGetEventResponse

Source code in kalshi_py/api/market/get_event.py
def sync(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    with_nested_markets: Union[Unset, bool] = UNSET,
) -> Optional[ModelGetEventResponse]:
    """Get Event

      Endpoint for getting data about an event by its ticker.  An event represents a real-world
    occurrence that can be traded on, such as an election, sports game, or economic indicator release.
    Events contain one or more markets where users can place trades on different outcomes.

    Args:
        event_ticker (str): Event ticker
        with_nested_markets (Union[Unset, bool]): If true, markets are included within the event
            object. If false (default), markets are returned as a separate top-level field in the
            response.

    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:
        ModelGetEventResponse
    """

    return sync_detailed(
        event_ticker=event_ticker,
        client=client,
        with_nested_markets=with_nested_markets,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_event.asyncio(event_ticker: str, *, client: Union[AuthenticatedClient, Client], with_nested_markets: Union[Unset, bool] = UNSET) -> Optional[ModelGetEventResponse] async

Get Event

Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required
with_nested_markets Union[Unset, bool]

If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.

UNSET

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[ModelGetEventResponse]

ModelGetEventResponse

Source code in kalshi_py/api/market/get_event.py
async def asyncio(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    with_nested_markets: Union[Unset, bool] = UNSET,
) -> Optional[ModelGetEventResponse]:
    """Get Event

      Endpoint for getting data about an event by its ticker.  An event represents a real-world
    occurrence that can be traded on, such as an election, sports game, or economic indicator release.
    Events contain one or more markets where users can place trades on different outcomes.

    Args:
        event_ticker (str): Event ticker
        with_nested_markets (Union[Unset, bool]): If true, markets are included within the event
            object. If false (default), markets are returned as a separate top-level field in the
            response.

    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:
        ModelGetEventResponse
    """

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

Synchronous Detailed Response

kalshi_py.api.market.get_event.sync_detailed(event_ticker: str, *, client: Union[AuthenticatedClient, Client], with_nested_markets: Union[Unset, bool] = UNSET) -> Response[ModelGetEventResponse]

Get Event

Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required
with_nested_markets Union[Unset, bool]

If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.

UNSET

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[ModelGetEventResponse]

Response[ModelGetEventResponse]

Source code in kalshi_py/api/market/get_event.py
def sync_detailed(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    with_nested_markets: Union[Unset, bool] = UNSET,
) -> Response[ModelGetEventResponse]:
    """Get Event

      Endpoint for getting data about an event by its ticker.  An event represents a real-world
    occurrence that can be traded on, such as an election, sports game, or economic indicator release.
    Events contain one or more markets where users can place trades on different outcomes.

    Args:
        event_ticker (str): Event ticker
        with_nested_markets (Union[Unset, bool]): If true, markets are included within the event
            object. If false (default), markets are returned as a separate top-level field in the
            response.

    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[ModelGetEventResponse]
    """

    kwargs = _get_kwargs(
        event_ticker=event_ticker,
        with_nested_markets=with_nested_markets,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_event.asyncio_detailed(event_ticker: str, *, client: Union[AuthenticatedClient, Client], with_nested_markets: Union[Unset, bool] = UNSET) -> Response[ModelGetEventResponse] async

Get Event

Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required
with_nested_markets Union[Unset, bool]

If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.

UNSET

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[ModelGetEventResponse]

Response[ModelGetEventResponse]

Source code in kalshi_py/api/market/get_event.py
async def asyncio_detailed(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    with_nested_markets: Union[Unset, bool] = UNSET,
) -> Response[ModelGetEventResponse]:
    """Get Event

      Endpoint for getting data about an event by its ticker.  An event represents a real-world
    occurrence that can be traded on, such as an election, sports game, or economic indicator release.
    Events contain one or more markets where users can place trades on different outcomes.

    Args:
        event_ticker (str): Event ticker
        with_nested_markets (Union[Unset, bool]): If true, markets are included within the event
            object. If false (default), markets are returned as a separate top-level field in the
            response.

    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[ModelGetEventResponse]
    """

    kwargs = _get_kwargs(
        event_ticker=event_ticker,
        with_nested_markets=with_nested_markets,
    )

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

    return _build_response(client=client, response=response)

Get Event Metadata

Synchronous API Call

kalshi_py.api.market.get_event_metadata.sync(event_ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetEventMetadataResponse]

Get Event Metadata

Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required

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[ModelGetEventMetadataResponse]

ModelGetEventMetadataResponse

Source code in kalshi_py/api/market/get_event_metadata.py
def sync(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetEventMetadataResponse]:
    """Get Event Metadata

      Endpoint for getting metadata about an event by its ticker.  Returns only the metadata information
    for an event.

    Args:
        event_ticker (str): Event ticker

    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:
        ModelGetEventMetadataResponse
    """

    return sync_detailed(
        event_ticker=event_ticker,
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_event_metadata.asyncio(event_ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetEventMetadataResponse] async

Get Event Metadata

Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required

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[ModelGetEventMetadataResponse]

ModelGetEventMetadataResponse

Source code in kalshi_py/api/market/get_event_metadata.py
async def asyncio(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetEventMetadataResponse]:
    """Get Event Metadata

      Endpoint for getting metadata about an event by its ticker.  Returns only the metadata information
    for an event.

    Args:
        event_ticker (str): Event ticker

    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:
        ModelGetEventMetadataResponse
    """

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

Synchronous Detailed Response

kalshi_py.api.market.get_event_metadata.sync_detailed(event_ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetEventMetadataResponse]

Get Event Metadata

Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required

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[ModelGetEventMetadataResponse]

Response[ModelGetEventMetadataResponse]

Source code in kalshi_py/api/market/get_event_metadata.py
def sync_detailed(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetEventMetadataResponse]:
    """Get Event Metadata

      Endpoint for getting metadata about an event by its ticker.  Returns only the metadata information
    for an event.

    Args:
        event_ticker (str): Event ticker

    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[ModelGetEventMetadataResponse]
    """

    kwargs = _get_kwargs(
        event_ticker=event_ticker,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_event_metadata.asyncio_detailed(event_ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetEventMetadataResponse] async

Get Event Metadata

Endpoint for getting metadata about an event by its ticker. Returns only the metadata information for an event.

Parameters:

Name Type Description Default
event_ticker str

Event ticker

required

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[ModelGetEventMetadataResponse]

Response[ModelGetEventMetadataResponse]

Source code in kalshi_py/api/market/get_event_metadata.py
async def asyncio_detailed(
    event_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetEventMetadataResponse]:
    """Get Event Metadata

      Endpoint for getting metadata about an event by its ticker.  Returns only the metadata information
    for an event.

    Args:
        event_ticker (str): Event ticker

    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[ModelGetEventMetadataResponse]
    """

    kwargs = _get_kwargs(
        event_ticker=event_ticker,
    )

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

    return _build_response(client=client, response=response)

Get Events

Synchronous API Call

kalshi_py.api.market.get_events.sync(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, with_nested_markets: Union[Unset, bool] = UNSET, status: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET) -> Optional[ModelGetEventsResponse]

Get Events

Endpoint for getting data about all events. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Parameter to specify the number of results per page. Defaults to 100. Maximum value is 200.

UNSET
cursor Union[Unset, str]

Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
with_nested_markets Union[Unset, bool]

Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.

UNSET
status Union[Unset, str]

Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.

UNSET
series_ticker Union[Unset, str]

Filter events by series ticker. Returns only events belonging to the specified series.

UNSET

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[ModelGetEventsResponse]

ModelGetEventsResponse

Source code in kalshi_py/api/market/get_events.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    with_nested_markets: Union[Unset, bool] = UNSET,
    status: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
) -> Optional[ModelGetEventsResponse]:
    """Get Events

      Endpoint for getting data about all events.  An event represents a real-world occurrence that can
    be traded on, such as an election, sports game, or economic indicator release. Events contain one or
    more markets where users can place trades on different outcomes.  This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Parameter to specify the number of results per page. Defaults
            to 100. Maximum value is 200.
        cursor (Union[Unset, str]): Parameter to specify the pagination cursor. Use the cursor
            value returned from the previous response to get the next page of results. Leave empty for
            the first page.
        with_nested_markets (Union[Unset, bool]): Parameter to specify if nested markets should be
            included in the response. When true, each event will include a 'markets' field containing
            a list of Market objects associated with that event.
        status (Union[Unset, str]): Filter by event status. Possible values: 'open', 'closed',
            'settled'. Leave empty to return events with any status.
        series_ticker (Union[Unset, str]): Filter events by series ticker. Returns only events
            belonging to the specified series.

    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:
        ModelGetEventsResponse
    """

    return sync_detailed(
        client=client,
        limit=limit,
        cursor=cursor,
        with_nested_markets=with_nested_markets,
        status=status,
        series_ticker=series_ticker,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_events.asyncio(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, with_nested_markets: Union[Unset, bool] = UNSET, status: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET) -> Optional[ModelGetEventsResponse] async

Get Events

Endpoint for getting data about all events. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Parameter to specify the number of results per page. Defaults to 100. Maximum value is 200.

UNSET
cursor Union[Unset, str]

Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
with_nested_markets Union[Unset, bool]

Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.

UNSET
status Union[Unset, str]

Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.

UNSET
series_ticker Union[Unset, str]

Filter events by series ticker. Returns only events belonging to the specified series.

UNSET

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[ModelGetEventsResponse]

ModelGetEventsResponse

Source code in kalshi_py/api/market/get_events.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    with_nested_markets: Union[Unset, bool] = UNSET,
    status: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
) -> Optional[ModelGetEventsResponse]:
    """Get Events

      Endpoint for getting data about all events.  An event represents a real-world occurrence that can
    be traded on, such as an election, sports game, or economic indicator release. Events contain one or
    more markets where users can place trades on different outcomes.  This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Parameter to specify the number of results per page. Defaults
            to 100. Maximum value is 200.
        cursor (Union[Unset, str]): Parameter to specify the pagination cursor. Use the cursor
            value returned from the previous response to get the next page of results. Leave empty for
            the first page.
        with_nested_markets (Union[Unset, bool]): Parameter to specify if nested markets should be
            included in the response. When true, each event will include a 'markets' field containing
            a list of Market objects associated with that event.
        status (Union[Unset, str]): Filter by event status. Possible values: 'open', 'closed',
            'settled'. Leave empty to return events with any status.
        series_ticker (Union[Unset, str]): Filter events by series ticker. Returns only events
            belonging to the specified series.

    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:
        ModelGetEventsResponse
    """

    return (
        await asyncio_detailed(
            client=client,
            limit=limit,
            cursor=cursor,
            with_nested_markets=with_nested_markets,
            status=status,
            series_ticker=series_ticker,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.market.get_events.sync_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, with_nested_markets: Union[Unset, bool] = UNSET, status: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET) -> Response[ModelGetEventsResponse]

Get Events

Endpoint for getting data about all events. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Parameter to specify the number of results per page. Defaults to 100. Maximum value is 200.

UNSET
cursor Union[Unset, str]

Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
with_nested_markets Union[Unset, bool]

Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.

UNSET
status Union[Unset, str]

Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.

UNSET
series_ticker Union[Unset, str]

Filter events by series ticker. Returns only events belonging to the specified series.

UNSET

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[ModelGetEventsResponse]

Response[ModelGetEventsResponse]

Source code in kalshi_py/api/market/get_events.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    with_nested_markets: Union[Unset, bool] = UNSET,
    status: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
) -> Response[ModelGetEventsResponse]:
    """Get Events

      Endpoint for getting data about all events.  An event represents a real-world occurrence that can
    be traded on, such as an election, sports game, or economic indicator release. Events contain one or
    more markets where users can place trades on different outcomes.  This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Parameter to specify the number of results per page. Defaults
            to 100. Maximum value is 200.
        cursor (Union[Unset, str]): Parameter to specify the pagination cursor. Use the cursor
            value returned from the previous response to get the next page of results. Leave empty for
            the first page.
        with_nested_markets (Union[Unset, bool]): Parameter to specify if nested markets should be
            included in the response. When true, each event will include a 'markets' field containing
            a list of Market objects associated with that event.
        status (Union[Unset, str]): Filter by event status. Possible values: 'open', 'closed',
            'settled'. Leave empty to return events with any status.
        series_ticker (Union[Unset, str]): Filter events by series ticker. Returns only events
            belonging to the specified series.

    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[ModelGetEventsResponse]
    """

    kwargs = _get_kwargs(
        limit=limit,
        cursor=cursor,
        with_nested_markets=with_nested_markets,
        status=status,
        series_ticker=series_ticker,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_events.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, with_nested_markets: Union[Unset, bool] = UNSET, status: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET) -> Response[ModelGetEventsResponse] async

Get Events

Endpoint for getting data about all events. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release. Events contain one or more markets where users can place trades on different outcomes. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Parameter to specify the number of results per page. Defaults to 100. Maximum value is 200.

UNSET
cursor Union[Unset, str]

Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
with_nested_markets Union[Unset, bool]

Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.

UNSET
status Union[Unset, str]

Filter by event status. Possible values: 'open', 'closed', 'settled'. Leave empty to return events with any status.

UNSET
series_ticker Union[Unset, str]

Filter events by series ticker. Returns only events belonging to the specified series.

UNSET

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[ModelGetEventsResponse]

Response[ModelGetEventsResponse]

Source code in kalshi_py/api/market/get_events.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    with_nested_markets: Union[Unset, bool] = UNSET,
    status: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
) -> Response[ModelGetEventsResponse]:
    """Get Events

      Endpoint for getting data about all events.  An event represents a real-world occurrence that can
    be traded on, such as an election, sports game, or economic indicator release. Events contain one or
    more markets where users can place trades on different outcomes.  This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-200, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Parameter to specify the number of results per page. Defaults
            to 100. Maximum value is 200.
        cursor (Union[Unset, str]): Parameter to specify the pagination cursor. Use the cursor
            value returned from the previous response to get the next page of results. Leave empty for
            the first page.
        with_nested_markets (Union[Unset, bool]): Parameter to specify if nested markets should be
            included in the response. When true, each event will include a 'markets' field containing
            a list of Market objects associated with that event.
        status (Union[Unset, str]): Filter by event status. Possible values: 'open', 'closed',
            'settled'. Leave empty to return events with any status.
        series_ticker (Union[Unset, str]): Filter events by series ticker. Returns only events
            belonging to the specified series.

    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[ModelGetEventsResponse]
    """

    kwargs = _get_kwargs(
        limit=limit,
        cursor=cursor,
        with_nested_markets=with_nested_markets,
        status=status,
        series_ticker=series_ticker,
    )

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

    return _build_response(client=client, response=response)

Get Market

Synchronous API Call

kalshi_py.api.market.get_market.sync(ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetMarketResponse]

Get Market

Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required

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[ModelGetMarketResponse]

ModelGetMarketResponse

Source code in kalshi_py/api/market/get_market.py
def sync(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetMarketResponse]:
    r"""Get Market

      Endpoint for getting data about a specific market by its ticker. A market represents a specific
    binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets
    have yes/no positions, current prices, volume, and settlement rules.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market

    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:
        ModelGetMarketResponse
    """

    return sync_detailed(
        ticker=ticker,
        client=client,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_market.asyncio(ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Optional[ModelGetMarketResponse] async

Get Market

Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required

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[ModelGetMarketResponse]

ModelGetMarketResponse

Source code in kalshi_py/api/market/get_market.py
async def asyncio(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Optional[ModelGetMarketResponse]:
    r"""Get Market

      Endpoint for getting data about a specific market by its ticker. A market represents a specific
    binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets
    have yes/no positions, current prices, volume, and settlement rules.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market

    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:
        ModelGetMarketResponse
    """

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

Synchronous Detailed Response

kalshi_py.api.market.get_market.sync_detailed(ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetMarketResponse]

Get Market

Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required

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[ModelGetMarketResponse]

Response[ModelGetMarketResponse]

Source code in kalshi_py/api/market/get_market.py
def sync_detailed(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetMarketResponse]:
    r"""Get Market

      Endpoint for getting data about a specific market by its ticker. A market represents a specific
    binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets
    have yes/no positions, current prices, volume, and settlement rules.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market

    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[ModelGetMarketResponse]
    """

    kwargs = _get_kwargs(
        ticker=ticker,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_market.asyncio_detailed(ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Response[ModelGetMarketResponse] async

Get Market

Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required

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[ModelGetMarketResponse]

Response[ModelGetMarketResponse]

Source code in kalshi_py/api/market/get_market.py
async def asyncio_detailed(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[ModelGetMarketResponse]:
    r"""Get Market

      Endpoint for getting data about a specific market by its ticker. A market represents a specific
    binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets
    have yes/no positions, current prices, volume, and settlement rules.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market

    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[ModelGetMarketResponse]
    """

    kwargs = _get_kwargs(
        ticker=ticker,
    )

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

    return _build_response(client=client, response=response)

Get Market Candlesticks

Synchronous API Call

kalshi_py.api.market.get_market_candlesticks.sync(series_ticker: str, ticker: str, *, client: Union[AuthenticatedClient, Client], start_ts: int, end_ts: int, period_interval: int) -> Optional[ModelGetMarketCandlesticksResponse]

Get Market Candlesticks

Endpoint for getting historical candlestick data for a specific market. Candlesticks provide OHLC (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick represents the price movement during that period, including opening and closing prices, as well as the highest and lowest prices reached. The period_interval determines the time length of each candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts parameters define the time range for the data.

Parameters:

Name Type Description Default
series_ticker str

Series ticker - the series that contains the target market

required
ticker str

Market ticker - unique identifier for the specific market

required
start_ts int

Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.

required
end_ts int

End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.

required
period_interval int

Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).

required

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[ModelGetMarketCandlesticksResponse]

ModelGetMarketCandlesticksResponse

Source code in kalshi_py/api/market/get_market_candlesticks.py
def sync(
    series_ticker: str,
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    start_ts: int,
    end_ts: int,
    period_interval: int,
) -> Optional[ModelGetMarketCandlesticksResponse]:
    """Get Market Candlesticks

      Endpoint for getting historical candlestick data for a specific market.  Candlesticks provide OHLC
    (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick
    represents the price movement during that period, including opening and closing prices, as well as
    the highest and lowest prices reached.  The period_interval determines the time length of each
    candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts
    parameters define the time range for the data.

    Args:
        series_ticker (str): Series ticker - the series that contains the target market
        ticker (str): Market ticker - unique identifier for the specific market
        start_ts (int): Start timestamp (Unix timestamp). Candlesticks will include those ending
            on or after this time.
        end_ts (int): End timestamp (Unix timestamp). Candlesticks will include those ending on or
            before this time.
        period_interval (int): Time period length of each candlestick in minutes. Valid values: 1
            (1 minute), 60 (1 hour), 1440 (1 day).

    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:
        ModelGetMarketCandlesticksResponse
    """

    return sync_detailed(
        series_ticker=series_ticker,
        ticker=ticker,
        client=client,
        start_ts=start_ts,
        end_ts=end_ts,
        period_interval=period_interval,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_market_candlesticks.asyncio(series_ticker: str, ticker: str, *, client: Union[AuthenticatedClient, Client], start_ts: int, end_ts: int, period_interval: int) -> Optional[ModelGetMarketCandlesticksResponse] async

Get Market Candlesticks

Endpoint for getting historical candlestick data for a specific market. Candlesticks provide OHLC (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick represents the price movement during that period, including opening and closing prices, as well as the highest and lowest prices reached. The period_interval determines the time length of each candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts parameters define the time range for the data.

Parameters:

Name Type Description Default
series_ticker str

Series ticker - the series that contains the target market

required
ticker str

Market ticker - unique identifier for the specific market

required
start_ts int

Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.

required
end_ts int

End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.

required
period_interval int

Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).

required

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[ModelGetMarketCandlesticksResponse]

ModelGetMarketCandlesticksResponse

Source code in kalshi_py/api/market/get_market_candlesticks.py
async def asyncio(
    series_ticker: str,
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    start_ts: int,
    end_ts: int,
    period_interval: int,
) -> Optional[ModelGetMarketCandlesticksResponse]:
    """Get Market Candlesticks

      Endpoint for getting historical candlestick data for a specific market.  Candlesticks provide OHLC
    (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick
    represents the price movement during that period, including opening and closing prices, as well as
    the highest and lowest prices reached.  The period_interval determines the time length of each
    candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts
    parameters define the time range for the data.

    Args:
        series_ticker (str): Series ticker - the series that contains the target market
        ticker (str): Market ticker - unique identifier for the specific market
        start_ts (int): Start timestamp (Unix timestamp). Candlesticks will include those ending
            on or after this time.
        end_ts (int): End timestamp (Unix timestamp). Candlesticks will include those ending on or
            before this time.
        period_interval (int): Time period length of each candlestick in minutes. Valid values: 1
            (1 minute), 60 (1 hour), 1440 (1 day).

    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:
        ModelGetMarketCandlesticksResponse
    """

    return (
        await asyncio_detailed(
            series_ticker=series_ticker,
            ticker=ticker,
            client=client,
            start_ts=start_ts,
            end_ts=end_ts,
            period_interval=period_interval,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.market.get_market_candlesticks.sync_detailed(series_ticker: str, ticker: str, *, client: Union[AuthenticatedClient, Client], start_ts: int, end_ts: int, period_interval: int) -> Response[ModelGetMarketCandlesticksResponse]

Get Market Candlesticks

Endpoint for getting historical candlestick data for a specific market. Candlesticks provide OHLC (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick represents the price movement during that period, including opening and closing prices, as well as the highest and lowest prices reached. The period_interval determines the time length of each candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts parameters define the time range for the data.

Parameters:

Name Type Description Default
series_ticker str

Series ticker - the series that contains the target market

required
ticker str

Market ticker - unique identifier for the specific market

required
start_ts int

Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.

required
end_ts int

End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.

required
period_interval int

Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).

required

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[ModelGetMarketCandlesticksResponse]

Response[ModelGetMarketCandlesticksResponse]

Source code in kalshi_py/api/market/get_market_candlesticks.py
def sync_detailed(
    series_ticker: str,
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    start_ts: int,
    end_ts: int,
    period_interval: int,
) -> Response[ModelGetMarketCandlesticksResponse]:
    """Get Market Candlesticks

      Endpoint for getting historical candlestick data for a specific market.  Candlesticks provide OHLC
    (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick
    represents the price movement during that period, including opening and closing prices, as well as
    the highest and lowest prices reached.  The period_interval determines the time length of each
    candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts
    parameters define the time range for the data.

    Args:
        series_ticker (str): Series ticker - the series that contains the target market
        ticker (str): Market ticker - unique identifier for the specific market
        start_ts (int): Start timestamp (Unix timestamp). Candlesticks will include those ending
            on or after this time.
        end_ts (int): End timestamp (Unix timestamp). Candlesticks will include those ending on or
            before this time.
        period_interval (int): Time period length of each candlestick in minutes. Valid values: 1
            (1 minute), 60 (1 hour), 1440 (1 day).

    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[ModelGetMarketCandlesticksResponse]
    """

    kwargs = _get_kwargs(
        series_ticker=series_ticker,
        ticker=ticker,
        start_ts=start_ts,
        end_ts=end_ts,
        period_interval=period_interval,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_market_candlesticks.asyncio_detailed(series_ticker: str, ticker: str, *, client: Union[AuthenticatedClient, Client], start_ts: int, end_ts: int, period_interval: int) -> Response[ModelGetMarketCandlesticksResponse] async

Get Market Candlesticks

Endpoint for getting historical candlestick data for a specific market. Candlesticks provide OHLC (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick represents the price movement during that period, including opening and closing prices, as well as the highest and lowest prices reached. The period_interval determines the time length of each candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts parameters define the time range for the data.

Parameters:

Name Type Description Default
series_ticker str

Series ticker - the series that contains the target market

required
ticker str

Market ticker - unique identifier for the specific market

required
start_ts int

Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.

required
end_ts int

End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.

required
period_interval int

Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).

required

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[ModelGetMarketCandlesticksResponse]

Response[ModelGetMarketCandlesticksResponse]

Source code in kalshi_py/api/market/get_market_candlesticks.py
async def asyncio_detailed(
    series_ticker: str,
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    start_ts: int,
    end_ts: int,
    period_interval: int,
) -> Response[ModelGetMarketCandlesticksResponse]:
    """Get Market Candlesticks

      Endpoint for getting historical candlestick data for a specific market.  Candlesticks provide OHLC
    (Open, High, Low, Close) price data aggregated over specific time intervals. Each candlestick
    represents the price movement during that period, including opening and closing prices, as well as
    the highest and lowest prices reached.  The period_interval determines the time length of each
    candlestick and must be one of: 1 (1 minute), 60 (1 hour), or 1440 (1 day). The start_ts and end_ts
    parameters define the time range for the data.

    Args:
        series_ticker (str): Series ticker - the series that contains the target market
        ticker (str): Market ticker - unique identifier for the specific market
        start_ts (int): Start timestamp (Unix timestamp). Candlesticks will include those ending
            on or after this time.
        end_ts (int): End timestamp (Unix timestamp). Candlesticks will include those ending on or
            before this time.
        period_interval (int): Time period length of each candlestick in minutes. Valid values: 1
            (1 minute), 60 (1 hour), 1440 (1 day).

    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[ModelGetMarketCandlesticksResponse]
    """

    kwargs = _get_kwargs(
        series_ticker=series_ticker,
        ticker=ticker,
        start_ts=start_ts,
        end_ts=end_ts,
        period_interval=period_interval,
    )

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

    return _build_response(client=client, response=response)

Get Market Orderbook

Synchronous API Call

kalshi_py.api.market.get_market_orderbook.sync(ticker: str, *, client: Union[AuthenticatedClient, Client], depth: Union[Unset, int] = UNSET) -> Optional[ModelGetMarketOrderbookResponse]

Get Market Order Book

Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required
depth Union[Unset, int]

Maximum number of price levels to return per side (yes bids/no bids). Defaults to all levels. Maximum value is 100.

UNSET

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[ModelGetMarketOrderbookResponse]

ModelGetMarketOrderbookResponse

Source code in kalshi_py/api/market/get_market_orderbook.py
def sync(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    depth: Union[Unset, int] = UNSET,
) -> Optional[ModelGetMarketOrderbookResponse]:
    """Get Market Order Book

      Endpoint for getting the current order book for a specific market.  The order book shows all active
    bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no
    asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an
    ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with
    identical contract sizes.  Each side shows price levels with their corresponding quantities and
    order counts, organized from best to worst prices.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market
        depth (Union[Unset, int]): Maximum number of price levels to return per side (yes bids/no
            bids). Defaults to all levels. Maximum value is 100.

    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:
        ModelGetMarketOrderbookResponse
    """

    return sync_detailed(
        ticker=ticker,
        client=client,
        depth=depth,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_market_orderbook.asyncio(ticker: str, *, client: Union[AuthenticatedClient, Client], depth: Union[Unset, int] = UNSET) -> Optional[ModelGetMarketOrderbookResponse] async

Get Market Order Book

Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required
depth Union[Unset, int]

Maximum number of price levels to return per side (yes bids/no bids). Defaults to all levels. Maximum value is 100.

UNSET

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[ModelGetMarketOrderbookResponse]

ModelGetMarketOrderbookResponse

Source code in kalshi_py/api/market/get_market_orderbook.py
async def asyncio(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    depth: Union[Unset, int] = UNSET,
) -> Optional[ModelGetMarketOrderbookResponse]:
    """Get Market Order Book

      Endpoint for getting the current order book for a specific market.  The order book shows all active
    bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no
    asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an
    ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with
    identical contract sizes.  Each side shows price levels with their corresponding quantities and
    order counts, organized from best to worst prices.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market
        depth (Union[Unset, int]): Maximum number of price levels to return per side (yes bids/no
            bids). Defaults to all levels. Maximum value is 100.

    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:
        ModelGetMarketOrderbookResponse
    """

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

Synchronous Detailed Response

kalshi_py.api.market.get_market_orderbook.sync_detailed(ticker: str, *, client: Union[AuthenticatedClient, Client], depth: Union[Unset, int] = UNSET) -> Response[ModelGetMarketOrderbookResponse]

Get Market Order Book

Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required
depth Union[Unset, int]

Maximum number of price levels to return per side (yes bids/no bids). Defaults to all levels. Maximum value is 100.

UNSET

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[ModelGetMarketOrderbookResponse]

Response[ModelGetMarketOrderbookResponse]

Source code in kalshi_py/api/market/get_market_orderbook.py
def sync_detailed(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    depth: Union[Unset, int] = UNSET,
) -> Response[ModelGetMarketOrderbookResponse]:
    """Get Market Order Book

      Endpoint for getting the current order book for a specific market.  The order book shows all active
    bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no
    asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an
    ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with
    identical contract sizes.  Each side shows price levels with their corresponding quantities and
    order counts, organized from best to worst prices.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market
        depth (Union[Unset, int]): Maximum number of price levels to return per side (yes bids/no
            bids). Defaults to all levels. Maximum value is 100.

    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[ModelGetMarketOrderbookResponse]
    """

    kwargs = _get_kwargs(
        ticker=ticker,
        depth=depth,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_market_orderbook.asyncio_detailed(ticker: str, *, client: Union[AuthenticatedClient, Client], depth: Union[Unset, int] = UNSET) -> Response[ModelGetMarketOrderbookResponse] async

Get Market Order Book

Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.

Parameters:

Name Type Description Default
ticker str

Market ticker - unique identifier for the specific market

required
depth Union[Unset, int]

Maximum number of price levels to return per side (yes bids/no bids). Defaults to all levels. Maximum value is 100.

UNSET

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[ModelGetMarketOrderbookResponse]

Response[ModelGetMarketOrderbookResponse]

Source code in kalshi_py/api/market/get_market_orderbook.py
async def asyncio_detailed(
    ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
    depth: Union[Unset, int] = UNSET,
) -> Response[ModelGetMarketOrderbookResponse]:
    """Get Market Order Book

      Endpoint for getting the current order book for a specific market.  The order book shows all active
    bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no
    asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an
    ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with
    identical contract sizes.  Each side shows price levels with their corresponding quantities and
    order counts, organized from best to worst prices.

    Args:
        ticker (str): Market ticker - unique identifier for the specific market
        depth (Union[Unset, int]): Maximum number of price levels to return per side (yes bids/no
            bids). Defaults to all levels. Maximum value is 100.

    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[ModelGetMarketOrderbookResponse]
    """

    kwargs = _get_kwargs(
        ticker=ticker,
        depth=depth,
    )

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

    return _build_response(client=client, response=response)

Get Markets

Synchronous API Call

kalshi_py.api.market.get_markets.sync(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET, max_close_ts: Union[Unset, int] = UNSET, min_close_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, tickers: Union[Unset, str] = UNSET) -> Optional[ModelGetMarketsResponse]

Get Markets

Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
event_ticker Union[Unset, str]

Filter markets by event ticker. Returns only markets belonging to the specified event.

UNSET
series_ticker Union[Unset, str]

Filter markets by series ticker. Returns only markets belonging to events in the specified series.

UNSET
max_close_ts Union[Unset, int]

Filter markets that close before this Unix timestamp.

UNSET
min_close_ts Union[Unset, int]

Filter markets that close after this Unix timestamp.

UNSET
status Union[Unset, str]

Filter by market status. Comma-separated list. Possible values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.

UNSET
tickers Union[Unset, str]

Filter by specific market tickers. Comma-separated list of market tickers to retrieve.

UNSET

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[ModelGetMarketsResponse]

ModelGetMarketsResponse

Source code in kalshi_py/api/market/get_markets.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    event_ticker: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
    max_close_ts: Union[Unset, int] = UNSET,
    min_close_ts: Union[Unset, int] = UNSET,
    status: Union[Unset, str] = UNSET,
    tickers: Union[Unset, str] = UNSET,
) -> Optional[ModelGetMarketsResponse]:
    r"""Get Markets

      Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary
    outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have
    yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        event_ticker (Union[Unset, str]): Filter markets by event ticker. Returns only markets
            belonging to the specified event.
        series_ticker (Union[Unset, str]): Filter markets by series ticker. Returns only markets
            belonging to events in the specified series.
        max_close_ts (Union[Unset, int]): Filter markets that close before this Unix timestamp.
        min_close_ts (Union[Unset, int]): Filter markets that close after this Unix timestamp.
        status (Union[Unset, str]): Filter by market status. Comma-separated list. Possible
            values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any
            status.
        tickers (Union[Unset, str]): Filter by specific market tickers. Comma-separated list of
            market tickers to retrieve.

    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:
        ModelGetMarketsResponse
    """

    return sync_detailed(
        client=client,
        limit=limit,
        cursor=cursor,
        event_ticker=event_ticker,
        series_ticker=series_ticker,
        max_close_ts=max_close_ts,
        min_close_ts=min_close_ts,
        status=status,
        tickers=tickers,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_markets.asyncio(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET, max_close_ts: Union[Unset, int] = UNSET, min_close_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, tickers: Union[Unset, str] = UNSET) -> Optional[ModelGetMarketsResponse] async

Get Markets

Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
event_ticker Union[Unset, str]

Filter markets by event ticker. Returns only markets belonging to the specified event.

UNSET
series_ticker Union[Unset, str]

Filter markets by series ticker. Returns only markets belonging to events in the specified series.

UNSET
max_close_ts Union[Unset, int]

Filter markets that close before this Unix timestamp.

UNSET
min_close_ts Union[Unset, int]

Filter markets that close after this Unix timestamp.

UNSET
status Union[Unset, str]

Filter by market status. Comma-separated list. Possible values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.

UNSET
tickers Union[Unset, str]

Filter by specific market tickers. Comma-separated list of market tickers to retrieve.

UNSET

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[ModelGetMarketsResponse]

ModelGetMarketsResponse

Source code in kalshi_py/api/market/get_markets.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    event_ticker: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
    max_close_ts: Union[Unset, int] = UNSET,
    min_close_ts: Union[Unset, int] = UNSET,
    status: Union[Unset, str] = UNSET,
    tickers: Union[Unset, str] = UNSET,
) -> Optional[ModelGetMarketsResponse]:
    r"""Get Markets

      Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary
    outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have
    yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        event_ticker (Union[Unset, str]): Filter markets by event ticker. Returns only markets
            belonging to the specified event.
        series_ticker (Union[Unset, str]): Filter markets by series ticker. Returns only markets
            belonging to events in the specified series.
        max_close_ts (Union[Unset, int]): Filter markets that close before this Unix timestamp.
        min_close_ts (Union[Unset, int]): Filter markets that close after this Unix timestamp.
        status (Union[Unset, str]): Filter by market status. Comma-separated list. Possible
            values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any
            status.
        tickers (Union[Unset, str]): Filter by specific market tickers. Comma-separated list of
            market tickers to retrieve.

    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:
        ModelGetMarketsResponse
    """

    return (
        await asyncio_detailed(
            client=client,
            limit=limit,
            cursor=cursor,
            event_ticker=event_ticker,
            series_ticker=series_ticker,
            max_close_ts=max_close_ts,
            min_close_ts=min_close_ts,
            status=status,
            tickers=tickers,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.market.get_markets.sync_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET, max_close_ts: Union[Unset, int] = UNSET, min_close_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, tickers: Union[Unset, str] = UNSET) -> Response[ModelGetMarketsResponse]

Get Markets

Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
event_ticker Union[Unset, str]

Filter markets by event ticker. Returns only markets belonging to the specified event.

UNSET
series_ticker Union[Unset, str]

Filter markets by series ticker. Returns only markets belonging to events in the specified series.

UNSET
max_close_ts Union[Unset, int]

Filter markets that close before this Unix timestamp.

UNSET
min_close_ts Union[Unset, int]

Filter markets that close after this Unix timestamp.

UNSET
status Union[Unset, str]

Filter by market status. Comma-separated list. Possible values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.

UNSET
tickers Union[Unset, str]

Filter by specific market tickers. Comma-separated list of market tickers to retrieve.

UNSET

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[ModelGetMarketsResponse]

Response[ModelGetMarketsResponse]

Source code in kalshi_py/api/market/get_markets.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    event_ticker: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
    max_close_ts: Union[Unset, int] = UNSET,
    min_close_ts: Union[Unset, int] = UNSET,
    status: Union[Unset, str] = UNSET,
    tickers: Union[Unset, str] = UNSET,
) -> Response[ModelGetMarketsResponse]:
    r"""Get Markets

      Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary
    outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have
    yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        event_ticker (Union[Unset, str]): Filter markets by event ticker. Returns only markets
            belonging to the specified event.
        series_ticker (Union[Unset, str]): Filter markets by series ticker. Returns only markets
            belonging to events in the specified series.
        max_close_ts (Union[Unset, int]): Filter markets that close before this Unix timestamp.
        min_close_ts (Union[Unset, int]): Filter markets that close after this Unix timestamp.
        status (Union[Unset, str]): Filter by market status. Comma-separated list. Possible
            values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any
            status.
        tickers (Union[Unset, str]): Filter by specific market tickers. Comma-separated list of
            market tickers to retrieve.

    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[ModelGetMarketsResponse]
    """

    kwargs = _get_kwargs(
        limit=limit,
        cursor=cursor,
        event_ticker=event_ticker,
        series_ticker=series_ticker,
        max_close_ts=max_close_ts,
        min_close_ts=min_close_ts,
        status=status,
        tickers=tickers,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_markets.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, event_ticker: Union[Unset, str] = UNSET, series_ticker: Union[Unset, str] = UNSET, max_close_ts: Union[Unset, int] = UNSET, min_close_ts: Union[Unset, int] = UNSET, status: Union[Unset, str] = UNSET, tickers: Union[Unset, str] = UNSET) -> Response[ModelGetMarketsResponse] async

Get Markets

Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
event_ticker Union[Unset, str]

Filter markets by event ticker. Returns only markets belonging to the specified event.

UNSET
series_ticker Union[Unset, str]

Filter markets by series ticker. Returns only markets belonging to events in the specified series.

UNSET
max_close_ts Union[Unset, int]

Filter markets that close before this Unix timestamp.

UNSET
min_close_ts Union[Unset, int]

Filter markets that close after this Unix timestamp.

UNSET
status Union[Unset, str]

Filter by market status. Comma-separated list. Possible values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.

UNSET
tickers Union[Unset, str]

Filter by specific market tickers. Comma-separated list of market tickers to retrieve.

UNSET

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[ModelGetMarketsResponse]

Response[ModelGetMarketsResponse]

Source code in kalshi_py/api/market/get_markets.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    event_ticker: Union[Unset, str] = UNSET,
    series_ticker: Union[Unset, str] = UNSET,
    max_close_ts: Union[Unset, int] = UNSET,
    min_close_ts: Union[Unset, int] = UNSET,
    status: Union[Unset, str] = UNSET,
    tickers: Union[Unset, str] = UNSET,
) -> Response[ModelGetMarketsResponse]:
    r"""Get Markets

      Endpoint for listing and discovering markets on Kalshi. A market represents a specific binary
    outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have
    yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated
    response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response
    includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get
    the next page. An empty cursor indicates no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        event_ticker (Union[Unset, str]): Filter markets by event ticker. Returns only markets
            belonging to the specified event.
        series_ticker (Union[Unset, str]): Filter markets by series ticker. Returns only markets
            belonging to events in the specified series.
        max_close_ts (Union[Unset, int]): Filter markets that close before this Unix timestamp.
        min_close_ts (Union[Unset, int]): Filter markets that close after this Unix timestamp.
        status (Union[Unset, str]): Filter by market status. Comma-separated list. Possible
            values: 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any
            status.
        tickers (Union[Unset, str]): Filter by specific market tickers. Comma-separated list of
            market tickers to retrieve.

    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[ModelGetMarketsResponse]
    """

    kwargs = _get_kwargs(
        limit=limit,
        cursor=cursor,
        event_ticker=event_ticker,
        series_ticker=series_ticker,
        max_close_ts=max_close_ts,
        min_close_ts=min_close_ts,
        status=status,
        tickers=tickers,
    )

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

    return _build_response(client=client, response=response)

Get Series

Synchronous Detailed Response

kalshi_py.api.market.get_series.sync_detailed(series_ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Response[Any]

Get Series

Endpoint for getting data about a specific series by its ticker. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement sources, and metadata that will be applied to each recurring event instance within that series.

Parameters:

Name Type Description Default
series_ticker str

Series ticker - unique identifier for the specific series

required

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[Any]

Response[Any]

Source code in kalshi_py/api/market/get_series.py
def sync_detailed(
    series_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
    r"""Get Series

      Endpoint for getting data about a specific series by its ticker.  A series represents a template
    for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly
    Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement
    sources, and metadata that will be applied to each recurring event instance within that series.

    Args:
        series_ticker (str): Series ticker - unique identifier for the specific series

    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[Any]
    """

    kwargs = _get_kwargs(
        series_ticker=series_ticker,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_series.asyncio_detailed(series_ticker: str, *, client: Union[AuthenticatedClient, Client]) -> Response[Any] async

Get Series

Endpoint for getting data about a specific series by its ticker. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement sources, and metadata that will be applied to each recurring event instance within that series.

Parameters:

Name Type Description Default
series_ticker str

Series ticker - unique identifier for the specific series

required

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[Any]

Response[Any]

Source code in kalshi_py/api/market/get_series.py
async def asyncio_detailed(
    series_ticker: str,
    *,
    client: Union[AuthenticatedClient, Client],
) -> Response[Any]:
    r"""Get Series

      Endpoint for getting data about a specific series by its ticker.  A series represents a template
    for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly
    Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement
    sources, and metadata that will be applied to each recurring event instance within that series.

    Args:
        series_ticker (str): Series ticker - unique identifier for the specific series

    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[Any]
    """

    kwargs = _get_kwargs(
        series_ticker=series_ticker,
    )

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

    return _build_response(client=client, response=response)

Get Series List

Synchronous Detailed Response

kalshi_py.api.market.get_series_list.sync_detailed(*, client: Union[AuthenticatedClient, Client], category: str, include_product_metadata: Union[Unset, bool] = UNSET) -> Response[Any]

Get Series List

Endpoint for getting data about multiple series with specified filters. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and discover available series templates by category.

Parameters:

Name Type Description Default
category str

Filter series by category. Returns only series belonging to the specified category.

required
include_product_metadata Union[Unset, bool]

Include additional product metadata in the response for each series.

UNSET

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[Any]

Response[Any]

Source code in kalshi_py/api/market/get_series_list.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    category: str,
    include_product_metadata: Union[Unset, bool] = UNSET,
) -> Response[Any]:
    r"""Get Series List

      Endpoint for getting data about multiple series with specified filters.  A series represents a
    template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\",
    \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and
    discover available series templates by category.

    Args:
        category (str): Filter series by category. Returns only series belonging to the specified
            category.
        include_product_metadata (Union[Unset, bool]): Include additional product metadata in the
            response for each series.

    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[Any]
    """

    kwargs = _get_kwargs(
        category=category,
        include_product_metadata=include_product_metadata,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_series_list.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], category: str, include_product_metadata: Union[Unset, bool] = UNSET) -> Response[Any] async

Get Series List

Endpoint for getting data about multiple series with specified filters. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and discover available series templates by category.

Parameters:

Name Type Description Default
category str

Filter series by category. Returns only series belonging to the specified category.

required
include_product_metadata Union[Unset, bool]

Include additional product metadata in the response for each series.

UNSET

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[Any]

Response[Any]

Source code in kalshi_py/api/market/get_series_list.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    category: str,
    include_product_metadata: Union[Unset, bool] = UNSET,
) -> Response[Any]:
    r"""Get Series List

      Endpoint for getting data about multiple series with specified filters.  A series represents a
    template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\",
    \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and
    discover available series templates by category.

    Args:
        category (str): Filter series by category. Returns only series belonging to the specified
            category.
        include_product_metadata (Union[Unset, bool]): Include additional product metadata in the
            response for each series.

    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[Any]
    """

    kwargs = _get_kwargs(
        category=category,
        include_product_metadata=include_product_metadata,
    )

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

    return _build_response(client=client, response=response)

Get Trades

Synchronous API Call

kalshi_py.api.market.get_trades.sync(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET) -> Optional[ModelPublicTradesGetResponse]

Get Trades

Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
ticker Union[Unset, str]

Filter trades by market ticker. Returns only trades for the specified market.

UNSET
min_ts Union[Unset, int]

Filter trades that occurred after this Unix timestamp.

UNSET
max_ts Union[Unset, int]

Filter trades that occurred before this Unix timestamp.

UNSET

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[ModelPublicTradesGetResponse]

ModelPublicTradesGetResponse

Source code in kalshi_py/api/market/get_trades.py
def sync(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    ticker: Union[Unset, str] = UNSET,
    min_ts: Union[Unset, int] = UNSET,
    max_ts: Union[Unset, int] = UNSET,
) -> Optional[ModelPublicTradesGetResponse]:
    """Get Trades

      Endpoint for getting all trades for all markets.  A trade represents a completed transaction
    between two users on a specific market. Each trade includes the market ticker, price, quantity, and
    timestamp information.  This endpoint returns a paginated response. Use the 'limit' parameter to
    control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this
    value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates
    no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        ticker (Union[Unset, str]): Filter trades by market ticker. Returns only trades for the
            specified market.
        min_ts (Union[Unset, int]): Filter trades that occurred after this Unix timestamp.
        max_ts (Union[Unset, int]): Filter trades that occurred before this Unix timestamp.

    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:
        ModelPublicTradesGetResponse
    """

    return sync_detailed(
        client=client,
        limit=limit,
        cursor=cursor,
        ticker=ticker,
        min_ts=min_ts,
        max_ts=max_ts,
    ).parsed

Asynchronous API Call

kalshi_py.api.market.get_trades.asyncio(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET) -> Optional[ModelPublicTradesGetResponse] async

Get Trades

Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
ticker Union[Unset, str]

Filter trades by market ticker. Returns only trades for the specified market.

UNSET
min_ts Union[Unset, int]

Filter trades that occurred after this Unix timestamp.

UNSET
max_ts Union[Unset, int]

Filter trades that occurred before this Unix timestamp.

UNSET

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[ModelPublicTradesGetResponse]

ModelPublicTradesGetResponse

Source code in kalshi_py/api/market/get_trades.py
async def asyncio(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    ticker: Union[Unset, str] = UNSET,
    min_ts: Union[Unset, int] = UNSET,
    max_ts: Union[Unset, int] = UNSET,
) -> Optional[ModelPublicTradesGetResponse]:
    """Get Trades

      Endpoint for getting all trades for all markets.  A trade represents a completed transaction
    between two users on a specific market. Each trade includes the market ticker, price, quantity, and
    timestamp information.  This endpoint returns a paginated response. Use the 'limit' parameter to
    control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this
    value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates
    no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        ticker (Union[Unset, str]): Filter trades by market ticker. Returns only trades for the
            specified market.
        min_ts (Union[Unset, int]): Filter trades that occurred after this Unix timestamp.
        max_ts (Union[Unset, int]): Filter trades that occurred before this Unix timestamp.

    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:
        ModelPublicTradesGetResponse
    """

    return (
        await asyncio_detailed(
            client=client,
            limit=limit,
            cursor=cursor,
            ticker=ticker,
            min_ts=min_ts,
            max_ts=max_ts,
        )
    ).parsed

Synchronous Detailed Response

kalshi_py.api.market.get_trades.sync_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET) -> Response[ModelPublicTradesGetResponse]

Get Trades

Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
ticker Union[Unset, str]

Filter trades by market ticker. Returns only trades for the specified market.

UNSET
min_ts Union[Unset, int]

Filter trades that occurred after this Unix timestamp.

UNSET
max_ts Union[Unset, int]

Filter trades that occurred before this Unix timestamp.

UNSET

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[ModelPublicTradesGetResponse]

Response[ModelPublicTradesGetResponse]

Source code in kalshi_py/api/market/get_trades.py
def sync_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    ticker: Union[Unset, str] = UNSET,
    min_ts: Union[Unset, int] = UNSET,
    max_ts: Union[Unset, int] = UNSET,
) -> Response[ModelPublicTradesGetResponse]:
    """Get Trades

      Endpoint for getting all trades for all markets.  A trade represents a completed transaction
    between two users on a specific market. Each trade includes the market ticker, price, quantity, and
    timestamp information.  This endpoint returns a paginated response. Use the 'limit' parameter to
    control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this
    value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates
    no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        ticker (Union[Unset, str]): Filter trades by market ticker. Returns only trades for the
            specified market.
        min_ts (Union[Unset, int]): Filter trades that occurred after this Unix timestamp.
        max_ts (Union[Unset, int]): Filter trades that occurred before this Unix timestamp.

    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[ModelPublicTradesGetResponse]
    """

    kwargs = _get_kwargs(
        limit=limit,
        cursor=cursor,
        ticker=ticker,
        min_ts=min_ts,
        max_ts=max_ts,
    )

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

    return _build_response(client=client, response=response)

Asynchronous Detailed Response

kalshi_py.api.market.get_trades.asyncio_detailed(*, client: Union[AuthenticatedClient, Client], limit: Union[Unset, int] = UNSET, cursor: Union[Unset, str] = UNSET, ticker: Union[Unset, str] = UNSET, min_ts: Union[Unset, int] = UNSET, max_ts: Union[Unset, int] = UNSET) -> Response[ModelPublicTradesGetResponse] async

Get Trades

Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.

Parameters:

Name Type Description Default
limit Union[Unset, int]

Number of results per page. Defaults to 100. Maximum value is 1000.

UNSET
cursor Union[Unset, str]

Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.

UNSET
ticker Union[Unset, str]

Filter trades by market ticker. Returns only trades for the specified market.

UNSET
min_ts Union[Unset, int]

Filter trades that occurred after this Unix timestamp.

UNSET
max_ts Union[Unset, int]

Filter trades that occurred before this Unix timestamp.

UNSET

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[ModelPublicTradesGetResponse]

Response[ModelPublicTradesGetResponse]

Source code in kalshi_py/api/market/get_trades.py
async def asyncio_detailed(
    *,
    client: Union[AuthenticatedClient, Client],
    limit: Union[Unset, int] = UNSET,
    cursor: Union[Unset, str] = UNSET,
    ticker: Union[Unset, str] = UNSET,
    min_ts: Union[Unset, int] = UNSET,
    max_ts: Union[Unset, int] = UNSET,
) -> Response[ModelPublicTradesGetResponse]:
    """Get Trades

      Endpoint for getting all trades for all markets.  A trade represents a completed transaction
    between two users on a specific market. Each trade includes the market ticker, price, quantity, and
    timestamp information.  This endpoint returns a paginated response. Use the 'limit' parameter to
    control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this
    value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates
    no more pages are available.

    Args:
        limit (Union[Unset, int]): Number of results per page. Defaults to 100. Maximum value is
            1000.
        cursor (Union[Unset, str]): Pagination cursor. Use the cursor value returned from the
            previous response to get the next page of results. Leave empty for the first page.
        ticker (Union[Unset, str]): Filter trades by market ticker. Returns only trades for the
            specified market.
        min_ts (Union[Unset, int]): Filter trades that occurred after this Unix timestamp.
        max_ts (Union[Unset, int]): Filter trades that occurred before this Unix timestamp.

    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[ModelPublicTradesGetResponse]
    """

    kwargs = _get_kwargs(
        limit=limit,
        cursor=cursor,
        ticker=ticker,
        min_ts=min_ts,
        max_ts=max_ts,
    )

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

    return _build_response(client=client, response=response)