# MarketApi

All URIs are relative to *https://api.elections.kalshi.com/trade-api/v2*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**batchGetMarketCandlesticks**](#batchgetmarketcandlesticks) | **GET** /markets/candlesticks | Batch Get Market Candlesticks|
|[**getMarket**](#getmarket) | **GET** /markets/{ticker} | Get Market|
|[**getMarketCandlesticks**](#getmarketcandlesticks) | **GET** /series/{series_ticker}/markets/{ticker}/candlesticks | Get Market Candlesticks|
|[**getMarketOrderbook**](#getmarketorderbook) | **GET** /markets/{ticker}/orderbook | Get Market Orderbook|
|[**getMarketOrderbooks**](#getmarketorderbooks) | **GET** /markets/orderbooks | Get Multiple Market Orderbooks|
|[**getMarkets**](#getmarkets) | **GET** /markets | Get Markets|
|[**getSeries**](#getseries) | **GET** /series/{series_ticker} | Get Series|
|[**getSeriesList**](#getserieslist) | **GET** /series | Get Series List|
|[**getTrades**](#gettrades) | **GET** /markets/trades | Get Trades|

# **batchGetMarketCandlesticks**
> BatchGetMarketCandlesticksResponse batchGetMarketCandlesticks()

Endpoint for retrieving candlestick data for multiple markets.  - Accepts up to 100 market tickers per request - Returns up to 10,000 candlesticks total across all markets - Returns candlesticks grouped by market_id - Optionally includes a synthetic initial candlestick for price continuity (see `include_latest_before_start` parameter) 

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **marketTickers** | [**string**] | Comma-separated list of market tickers (maximum 100) | defaults to undefined|
| **startTs** | [**number**] | Start timestamp in Unix seconds | defaults to undefined|
| **endTs** | [**number**] | End timestamp in Unix seconds | defaults to undefined|
| **periodInterval** | [**number**] | Candlestick period interval in minutes | defaults to undefined|
| **includeLatestBeforeStart** | [**boolean**] | If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and &#x60;previous_price&#x60; to the close price from the real candlestick  | (optional) defaults to false|


### Return type

**BatchGetMarketCandlesticksResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Market candlesticks retrieved successfully |  -  |
|**400** | Bad request |  -  |
|**401** | Unauthorized |  -  |
|**500** | Internal server error |  -  |

# **getMarket**
> GetMarketResponse getMarket()

 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  | Notes|
|------------- | ------------- | ------------- | -------------|
| **ticker** | [**string**] | Market ticker | defaults to undefined|


### Return type

**GetMarketResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Market retrieved successfully |  -  |
|**401** | Unauthorized |  -  |
|**404** | Not found |  -  |
|**500** | Internal server error |  -  |

# **getMarketCandlesticks**
> GetMarketCandlesticksResponse getMarketCandlesticks()

Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day). Candlesticks for markets that settled before the historical cutoff are only available via `GET /historical/markets/{ticker}/candlesticks`. See [Historical Data](https://kalshi.com/docs/getting_started/historical_data) for details. 

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **seriesTicker** | [**string**] | Series ticker - the series that contains the target market | defaults to undefined|
| **ticker** | [**string**] | Market ticker - unique identifier for the specific market | defaults to undefined|
| **startTs** | [**number**] | Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. | defaults to undefined|
| **endTs** | [**number**] | End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. | defaults to undefined|
| **periodInterval** | [**1 | 60 | 1440**]**Array<1 &#124; 60 &#124; 1440>** | Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). | defaults to undefined|
| **includeLatestBeforeStart** | [**boolean**] | If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and &#x60;previous_price&#x60; to the close price from the real candlestick  | (optional) defaults to false|


### Return type

**GetMarketCandlesticksResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Candlesticks retrieved successfully |  -  |
|**400** | Bad request |  -  |
|**404** | Not found |  -  |
|**500** | Internal server error |  -  |

# **getMarketOrderbook**
> GetMarketOrderbookResponse getMarketOrderbook()

 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  | Notes|
|------------- | ------------- | ------------- | -------------|
| **ticker** | [**string**] | Market ticker | defaults to undefined|
| **depth** | [**number**] | Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth) | (optional) defaults to 0|


### Return type

**GetMarketOrderbookResponse**

### Authorization

[kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Orderbook retrieved successfully |  -  |
|**401** | Unauthorized - authentication required |  -  |
|**404** | Resource not found |  -  |
|**500** | Internal server error |  -  |

# **getMarketOrderbooks**
> GetMarketOrderbooksResponse getMarketOrderbooks()

Endpoint for getting the current order books for multiple markets in a single request. 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. Returns one orderbook per requested market ticker.

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **tickers** | **Array&lt;string&gt;** | List of market tickers to fetch orderbooks for | defaults to undefined|


### Return type

**GetMarketOrderbooksResponse**

### Authorization

[kalshiAccessSignature](../README.md#kalshiAccessSignature), [kalshiAccessKey](../README.md#kalshiAccessKey), [kalshiAccessTimestamp](../README.md#kalshiAccessTimestamp)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Orderbooks retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**401** | Unauthorized - authentication required |  -  |
|**500** | Internal server error |  -  |

# **getMarkets**
> GetMarketsResponse getMarkets()

Filter by market status. Possible values: `unopened`, `open`, `closed`, `settled`. Leave empty to return markets with any status.  - Only one `status` filter may be supplied at a time.  - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters.   | Compatible Timestamp Filters | Additional Status Filters| Extra Notes |  |------------------------------|--------------------------|-------------|  | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | |  | min_close_ts, max_close_ts | `closed`, *empty* | |  | min_settled_ts, max_settled_ts | `settled`, *empty* | |  | min_updated_ts | *empty* | Incompatible with all filters besides `mve_filter=exclude` |   Markets that settled before the historical cutoff are only available via `GET /historical/markets`. See [Historical Data](https://kalshi.com/docs/getting_started/historical_data) for details. 

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **limit** | [**number**] | Number of results per page. Defaults to 100. Maximum value is 1000. | (optional) defaults to 100|
| **cursor** | [**string**] | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | (optional) defaults to undefined|
| **eventTicker** | [**string**] | Event ticker to filter by. Only a single event ticker is supported. | (optional) defaults to undefined|
| **seriesTicker** | [**string**] | Filter by series ticker | (optional) defaults to undefined|
| **minCreatedTs** | [**number**] | Filter items that created after this Unix timestamp | (optional) defaults to undefined|
| **maxCreatedTs** | [**number**] | Filter items that created before this Unix timestamp | (optional) defaults to undefined|
| **minUpdatedTs** | [**number**] | Return markets with metadata updated later than this Unix timestamp. Tracks non-trading changes only. Incompatible with any other filters. | (optional) defaults to undefined|
| **maxCloseTs** | [**number**] | Filter items that close before this Unix timestamp | (optional) defaults to undefined|
| **minCloseTs** | [**number**] | Filter items that close after this Unix timestamp | (optional) defaults to undefined|
| **minSettledTs** | [**number**] | Filter items that settled after this Unix timestamp | (optional) defaults to undefined|
| **maxSettledTs** | [**number**] | Filter items that settled before this Unix timestamp | (optional) defaults to undefined|
| **status** | [**&#39;unopened&#39; | &#39;open&#39; | &#39;paused&#39; | &#39;closed&#39; | &#39;settled&#39;**]**Array<&#39;unopened&#39; &#124; &#39;open&#39; &#124; &#39;paused&#39; &#124; &#39;closed&#39; &#124; &#39;settled&#39;>** | Filter by market status. Leave empty to return markets with any status. | (optional) defaults to undefined|
| **tickers** | [**string**] | Filter by specific market tickers. Comma-separated list of market tickers to retrieve. | (optional) defaults to undefined|
| **mveFilter** | [**&#39;only&#39; | &#39;exclude&#39;**]**Array<&#39;only&#39; &#124; &#39;exclude&#39;>** | Filter by multivariate events (combos). \&#39;only\&#39; returns only multivariate events, \&#39;exclude\&#39; excludes multivariate events. | (optional) defaults to undefined|


### Return type

**GetMarketsResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Markets retrieved successfully |  -  |
|**400** | Bad request |  -  |
|**401** | Unauthorized |  -  |
|**500** | Internal server error |  -  |

# **getSeries**
> GetSeriesResponse getSeries()

 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  | Notes|
|------------- | ------------- | ------------- | -------------|
| **seriesTicker** | [**string**] | The ticker of the series to retrieve | defaults to undefined|
| **includeVolume** | [**boolean**] | If true, includes the total volume traded across all events in this series. | (optional) defaults to false|


### Return type

**GetSeriesResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Series retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**500** | Internal server error |  -  |

# **getSeriesList**
> GetSeriesListResponse getSeriesList()

 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  | Notes|
|------------- | ------------- | ------------- | -------------|
| **category** | [**string**] |  | (optional) defaults to undefined|
| **tags** | [**string**] |  | (optional) defaults to undefined|
| **includeProductMetadata** | [**boolean**] |  | (optional) defaults to false|
| **includeVolume** | [**boolean**] | If true, includes the total volume traded across all events in each series. | (optional) defaults to false|
| **minUpdatedTs** | [**number**] | Filter series with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes. | (optional) defaults to undefined|


### Return type

**GetSeriesListResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Series list retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**500** | Internal server error |  -  |

# **getTrades**
> GetTradesResponse getTrades()

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  | Notes|
|------------- | ------------- | ------------- | -------------|
| **limit** | [**number**] | Number of results per page. Defaults to 100. Maximum value is 1000. | (optional) defaults to 100|
| **cursor** | [**string**] | Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. | (optional) defaults to undefined|
| **ticker** | [**string**] | Filter by market ticker | (optional) defaults to undefined|
| **minTs** | [**number**] | Filter items after this Unix timestamp | (optional) defaults to undefined|
| **maxTs** | [**number**] | Filter items before this Unix timestamp | (optional) defaults to undefined|


### Return type

**GetTradesResponse**

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Trades retrieved successfully |  -  |
|**400** | Bad request |  -  |
|**500** | Internal server error |  -  |

