# HistoricalApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**getFillsHistorical**](#getfillshistorical) | **GET** /historical/fills | Get Historical Fills|
|[**getHistoricalCutoff**](#gethistoricalcutoff) | **GET** /historical/cutoff | Get Historical Cutoff Timestamps|
|[**getHistoricalMarket**](#gethistoricalmarket) | **GET** /historical/markets/{ticker} | Get Historical Market|
|[**getHistoricalMarkets**](#gethistoricalmarkets) | **GET** /historical/markets | Get Historical Markets|
|[**getHistoricalOrders**](#gethistoricalorders) | **GET** /historical/orders | Get Historical Orders|
|[**getHistoricalPositions**](#gethistoricalpositions) | **GET** /historical/positions | Get Historical Positions|
|[**getMarketCandlesticksHistorical**](#getmarketcandlestickshistorical) | **GET** /historical/markets/{ticker}/candlesticks | Get Historical Market Candlesticks|
|[**getTradesHistorical**](#gettradeshistorical) | **GET** /historical/trades | Get Historical Trades|

# **getFillsHistorical**
> GetFillsResponse getFillsHistorical()

Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. API keys restricted to a subaccount return only that subaccount\'s fills. If supplied, `subaccount` must match the key\'s restriction. Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope. 

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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|
| **limit** | [**number**] | Number of results per page. Defaults to 100. | (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|
| **subaccount** | [**number**] | Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. | (optional) defaults to undefined|


### Return type

**GetFillsResponse**

### Authorization

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

### HTTP request headers

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


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

# **getHistoricalCutoff**
> GetHistoricalCutoffResponse getHistoricalCutoff()

Returns the archive\'s cutoff timestamps. For positions, the cutoff is the backfill horizon; visibility in the historical API waits for a buffered, whole-event handoff.  ## Cutoff fields - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`. - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`. - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`. - `market_positions_last_updated_ts` : Backfill horizon for settled positions, not a guaranteed archive-visibility boundary. An event moves to `GET /historical/positions` only after its buffered handoff completes. Until then, its settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. Unsettled positions remain available in `GET /portfolio/positions`. 

### Parameters
This endpoint does not have any parameters.


### Return type

**GetHistoricalCutoffResponse**

### Authorization

No authorization required

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Historical cutoff timestamps retrieved successfully |  -  |
|**500** | Internal server error |  -  |

# **getHistoricalMarket**
> GetMarketResponse getHistoricalMarket()

 Endpoint for getting data about a specific market by its ticker from the historical database.

### 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** | Historical market retrieved successfully |  -  |
|**404** | Resource not found |  -  |
|**500** | Internal server error |  -  |

# **getHistoricalMarkets**
> GetMarketsResponse getHistoricalMarkets()

Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive. 

### 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|
| **tickers** | [**string**] | Filter by specific market tickers. Comma-separated list of market tickers to retrieve. | (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|
| **mveFilter** | [**&#39;exclude&#39;**]**Array<&#39;exclude&#39;>** | Filter by multivariate events (combos). By default, MVE markets are included. | (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** | Historical markets retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**500** | Internal server error |  -  |

# **getHistoricalOrders**
> GetOrdersResponse getHistoricalOrders()

Endpoint for getting orders that have been archived to the historical database. API keys restricted to a subaccount return only that subaccount\'s orders. If supplied, `subaccount` must match the key\'s restriction. 

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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|
| **limit** | [**number**] | Number of results per page. Defaults to 100. | (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|
| **subaccount** | [**number**] | Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. | (optional) defaults to undefined|


### Return type

**GetOrdersResponse**

### 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** | Historical orders retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**401** | Unauthorized - authentication required |  -  |
|**500** | Internal server error |  -  |

# **getHistoricalPositions**
> GetPositionsResponse getHistoricalPositions()

Returns settled market positions after their event completes the live-to-historical handoff. Until then, settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. The `market_positions_last_updated_ts` value on `GET /historical/cutoff` is the backfill horizon, not a guarantee that every older position has moved. Unsettled positions are available via `GET /portfolio/positions`.

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **ticker** | [**string**] | Filter by market ticker | (optional) defaults to undefined|
| **eventTicker** | [**string**] | Event ticker to filter by. Only a single event ticker is supported. | (optional) defaults to undefined|
| **subaccount** | [**number**] | Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0. Subaccount-restricted API keys default to their locked subaccount and must omit this parameter or pass their locked subaccount. | (optional) defaults to undefined|
| **limit** | [**number**] | Number of results per page. Defaults to 100. | (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|


### Return type

**GetPositionsResponse**

### 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** | Historical positions retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**401** | Unauthorized - authentication required |  -  |
|**500** | Internal server error |  -  |

# **getMarketCandlesticksHistorical**
> GetMarketCandlesticksHistoricalResponse getMarketCandlesticksHistorical()

 Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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|


### Return type

**GetMarketCandlesticksHistoricalResponse**

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

# **getTradesHistorical**
> GetTradesResponse getTradesHistorical()

 Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. Block trades are included by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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|
| **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|
| **isBlockTrade** | [**boolean**] | Filter trades by whether they are block trades. Omit to return all trades. Set to &#x60;true&#x60; to return only block trades. Set to &#x60;false&#x60; to return only non-block trades.  | (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** | Historical trades retrieved successfully |  -  |
|**400** | Bad request - invalid input |  -  |
|**404** | Resource not found |  -  |
|**500** | Internal server error |  -  |

