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