/* tslint:disable */ /* eslint-disable */ /** * Kalshi Trade API Manual Endpoints * Manually defined OpenAPI spec for endpoints being migrated to spec-first approach * * The version of the OpenAPI document: 3.36.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import type { GetEventLiveDataResponse } from '../models'; // @ts-ignore import type { GetGameStatsResponse } from '../models'; // @ts-ignore import type { GetLiveDataResponse } from '../models'; // @ts-ignore import type { GetLiveDatasResponse } from '../models'; // @ts-ignore import type { GetWeatherIndexCalibrationsResponse } from '../models'; // @ts-ignore import type { GetWeatherIndexResponse } from '../models'; /** * LiveDataApi - axios parameter creator */ export const LiveDataApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get live data for an event by its event ticker. Serves event-keyed live data such as crypto price charts, commodity price timeseries, and weather observations. The `type` field in the response names the schema of the `details` object. * @summary Get Event Live Data * @param {string} eventTicker Event ticker * @param {string} [range] Optional chart range hint (e.g. `15min`, `1h`, `1d`). When the underlying live data type supports it, restricts the returned timeseries to the requested window. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getEventLiveData: async (eventTicker: string, range?: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'eventTicker' is not null or undefined assertParamExists('getEventLiveData', 'eventTicker', eventTicker) const localVarPath = `/live_data/events/{event_ticker}` .replace(`{${"event_ticker"}}`, encodeURIComponent(String(eventTicker))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (range !== undefined) { localVarQueryParameter['range'] = range; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get play-by-play game statistics for a specific milestone. Supported sports: Pro Football, College Football, Pro Basketball, College Men\'s Basketball, College Women\'s Basketball, WNBA, Soccer, Pro Hockey, and Pro Baseball. Returns null for unsupported milestone types or milestones without a Sportradar ID. * @summary Get Game Stats * @param {string} milestoneId Milestone ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGameStats: async (milestoneId: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'milestoneId' is not null or undefined assertParamExists('getGameStats', 'milestoneId', milestoneId) const localVarPath = `/live_data/milestone/{milestone_id}/game_stats` .replace(`{${"milestone_id"}}`, encodeURIComponent(String(milestoneId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get live data for a specific milestone. This is the legacy endpoint that requires a type path parameter. Prefer using `/live_data/milestone/{milestone_id}` instead. * @summary Get Live Data (with type) * @param {string} type Type of live data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveData: async (type: string, milestoneId: string, includePlayerStats?: boolean, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'type' is not null or undefined assertParamExists('getLiveData', 'type', type) // verify required parameter 'milestoneId' is not null or undefined assertParamExists('getLiveData', 'milestoneId', milestoneId) const localVarPath = `/live_data/{type}/milestone/{milestone_id}` .replace(`{${"type"}}`, encodeURIComponent(String(type))) .replace(`{${"milestone_id"}}`, encodeURIComponent(String(milestoneId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (includePlayerStats !== undefined) { localVarQueryParameter['include_player_stats'] = includePlayerStats; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get live data for a specific milestone. The response\'s `live_data.details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `live_data.details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Live Data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveDataByMilestone: async (milestoneId: string, includePlayerStats?: boolean, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'milestoneId' is not null or undefined assertParamExists('getLiveDataByMilestone', 'milestoneId', milestoneId) const localVarPath = `/live_data/milestone/{milestone_id}` .replace(`{${"milestone_id"}}`, encodeURIComponent(String(milestoneId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (includePlayerStats !== undefined) { localVarQueryParameter['include_player_stats'] = includePlayerStats; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get live data for multiple milestones. Each entry\'s `details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Multiple Live Data * @param {Array} milestoneIds Array of milestone IDs * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveDatas: async (milestoneIds: Array, includePlayerStats?: boolean, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'milestoneIds' is not null or undefined assertParamExists('getLiveDatas', 'milestoneIds', milestoneIds) const localVarPath = `/live_data/batch`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (milestoneIds) { localVarQueryParameter['milestone_ids'] = milestoneIds; } if (includePlayerStats !== undefined) { localVarQueryParameter['include_player_stats'] = includePlayerStats; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get the Kalshi-computed city temperature index: the canonical minute-resolution series behind hourly temperature markets. City-keyed and independent of any event — the series exists whenever the city\'s index is configured. Values are Fahrenheit rounded to 0.01. Minutes where the index quorum failed carry no value and are never returned as points, so gaps in the series are real gaps. With `detailed=true` each point additionally carries every member station\'s reported reading and quality-control disposition — the pre-incorporation breakdown. * @summary Get Weather Index * @param {string} city Index city ID (e.g. `miami`) * @param {number} [from] Window start, unix milliseconds (inclusive). Defaults to `to` minus 24 hours. Must be paired with `to` unless `last_sec` is used. * @param {number} [to] Window end, unix milliseconds (inclusive). Defaults to now. * @param {number} [lastSec] Trailing window in seconds; equivalent to `from=now-last_sec`, `to=now`. Mutually exclusive with `from`/`to`. * @param {boolean} [detailed] Include per-station audit readings on every point. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWeatherIndex: async (city: string, from?: number, to?: number, lastSec?: number, detailed?: boolean, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'city' is not null or undefined assertParamExists('getWeatherIndex', 'city', city) const localVarPath = `/live_data/weather/{city}` .replace(`{${"city"}}`, encodeURIComponent(String(city))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (from !== undefined) { localVarQueryParameter['from'] = from; } if (to !== undefined) { localVarQueryParameter['to'] = to; } if (lastSec !== undefined) { localVarQueryParameter['last_sec'] = lastSec; } if (detailed !== undefined) { localVarQueryParameter['detailed'] = detailed; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get a city\'s published weather-index configuration timeline: the launch configuration plus every weekly offset calibration and methodology update, ascending by effective time. Each record carries the station weights, station offsets (Celsius), and the city reference used to compute index values from the record\'s effective time until the next record — everything needed to reproduce published index values for minutes computed under that configuration version. Offsets are re-estimated weekly after each complete UTC week; weights never change through calibration. The timeline is append-only and complete: it is never trimmed. * @summary Get Weather Index Calibrations * @param {string} city Index city ID (e.g. `miami`) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWeatherIndexCalibrations: async (city: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'city' is not null or undefined assertParamExists('getWeatherIndexCalibrations', 'city', city) const localVarPath = `/live_data/weather/{city}/calibrations` .replace(`{${"city"}}`, encodeURIComponent(String(city))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * LiveDataApi - functional programming interface */ export const LiveDataApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = LiveDataApiAxiosParamCreator(configuration) return { /** * Get live data for an event by its event ticker. Serves event-keyed live data such as crypto price charts, commodity price timeseries, and weather observations. The `type` field in the response names the schema of the `details` object. * @summary Get Event Live Data * @param {string} eventTicker Event ticker * @param {string} [range] Optional chart range hint (e.g. `15min`, `1h`, `1d`). When the underlying live data type supports it, restricts the returned timeseries to the requested window. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getEventLiveData(eventTicker: string, range?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getEventLiveData(eventTicker, range, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get play-by-play game statistics for a specific milestone. Supported sports: Pro Football, College Football, Pro Basketball, College Men\'s Basketball, College Women\'s Basketball, WNBA, Soccer, Pro Hockey, and Pro Baseball. Returns null for unsupported milestone types or milestones without a Sportradar ID. * @summary Get Game Stats * @param {string} milestoneId Milestone ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getGameStats(milestoneId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getGameStats(milestoneId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get live data for a specific milestone. This is the legacy endpoint that requires a type path parameter. Prefer using `/live_data/milestone/{milestone_id}` instead. * @summary Get Live Data (with type) * @param {string} type Type of live data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLiveData(type: string, milestoneId: string, includePlayerStats?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getLiveData(type, milestoneId, includePlayerStats, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get live data for a specific milestone. The response\'s `live_data.details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `live_data.details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Live Data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLiveDataByMilestone(milestoneId: string, includePlayerStats?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getLiveDataByMilestone(milestoneId, includePlayerStats, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get live data for multiple milestones. Each entry\'s `details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Multiple Live Data * @param {Array} milestoneIds Array of milestone IDs * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLiveDatas(milestoneIds: Array, includePlayerStats?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getLiveDatas(milestoneIds, includePlayerStats, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get the Kalshi-computed city temperature index: the canonical minute-resolution series behind hourly temperature markets. City-keyed and independent of any event — the series exists whenever the city\'s index is configured. Values are Fahrenheit rounded to 0.01. Minutes where the index quorum failed carry no value and are never returned as points, so gaps in the series are real gaps. With `detailed=true` each point additionally carries every member station\'s reported reading and quality-control disposition — the pre-incorporation breakdown. * @summary Get Weather Index * @param {string} city Index city ID (e.g. `miami`) * @param {number} [from] Window start, unix milliseconds (inclusive). Defaults to `to` minus 24 hours. Must be paired with `to` unless `last_sec` is used. * @param {number} [to] Window end, unix milliseconds (inclusive). Defaults to now. * @param {number} [lastSec] Trailing window in seconds; equivalent to `from=now-last_sec`, `to=now`. Mutually exclusive with `from`/`to`. * @param {boolean} [detailed] Include per-station audit readings on every point. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWeatherIndex(city: string, from?: number, to?: number, lastSec?: number, detailed?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWeatherIndex(city, from, to, lastSec, detailed, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get a city\'s published weather-index configuration timeline: the launch configuration plus every weekly offset calibration and methodology update, ascending by effective time. Each record carries the station weights, station offsets (Celsius), and the city reference used to compute index values from the record\'s effective time until the next record — everything needed to reproduce published index values for minutes computed under that configuration version. Offsets are re-estimated weekly after each complete UTC week; weights never change through calibration. The timeline is append-only and complete: it is never trimmed. * @summary Get Weather Index Calibrations * @param {string} city Index city ID (e.g. `miami`) * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWeatherIndexCalibrations(city: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWeatherIndexCalibrations(city, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * LiveDataApi - factory interface */ export const LiveDataApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = LiveDataApiFp(configuration) return { /** * Get live data for an event by its event ticker. Serves event-keyed live data such as crypto price charts, commodity price timeseries, and weather observations. The `type` field in the response names the schema of the `details` object. * @summary Get Event Live Data * @param {string} eventTicker Event ticker * @param {string} [range] Optional chart range hint (e.g. `15min`, `1h`, `1d`). When the underlying live data type supports it, restricts the returned timeseries to the requested window. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getEventLiveData(eventTicker: string, range?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getEventLiveData(eventTicker, range, options).then((request) => request(axios, basePath)); }, /** * Get play-by-play game statistics for a specific milestone. Supported sports: Pro Football, College Football, Pro Basketball, College Men\'s Basketball, College Women\'s Basketball, WNBA, Soccer, Pro Hockey, and Pro Baseball. Returns null for unsupported milestone types or milestones without a Sportradar ID. * @summary Get Game Stats * @param {string} milestoneId Milestone ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGameStats(milestoneId: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getGameStats(milestoneId, options).then((request) => request(axios, basePath)); }, /** * Get live data for a specific milestone. This is the legacy endpoint that requires a type path parameter. Prefer using `/live_data/milestone/{milestone_id}` instead. * @summary Get Live Data (with type) * @param {string} type Type of live data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveData(type: string, milestoneId: string, includePlayerStats?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getLiveData(type, milestoneId, includePlayerStats, options).then((request) => request(axios, basePath)); }, /** * Get live data for a specific milestone. The response\'s `live_data.details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `live_data.details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Live Data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveDataByMilestone(milestoneId: string, includePlayerStats?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getLiveDataByMilestone(milestoneId, includePlayerStats, options).then((request) => request(axios, basePath)); }, /** * Get live data for multiple milestones. Each entry\'s `details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Multiple Live Data * @param {Array} milestoneIds Array of milestone IDs * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLiveDatas(milestoneIds: Array, includePlayerStats?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getLiveDatas(milestoneIds, includePlayerStats, options).then((request) => request(axios, basePath)); }, /** * Get the Kalshi-computed city temperature index: the canonical minute-resolution series behind hourly temperature markets. City-keyed and independent of any event — the series exists whenever the city\'s index is configured. Values are Fahrenheit rounded to 0.01. Minutes where the index quorum failed carry no value and are never returned as points, so gaps in the series are real gaps. With `detailed=true` each point additionally carries every member station\'s reported reading and quality-control disposition — the pre-incorporation breakdown. * @summary Get Weather Index * @param {string} city Index city ID (e.g. `miami`) * @param {number} [from] Window start, unix milliseconds (inclusive). Defaults to `to` minus 24 hours. Must be paired with `to` unless `last_sec` is used. * @param {number} [to] Window end, unix milliseconds (inclusive). Defaults to now. * @param {number} [lastSec] Trailing window in seconds; equivalent to `from=now-last_sec`, `to=now`. Mutually exclusive with `from`/`to`. * @param {boolean} [detailed] Include per-station audit readings on every point. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWeatherIndex(city: string, from?: number, to?: number, lastSec?: number, detailed?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWeatherIndex(city, from, to, lastSec, detailed, options).then((request) => request(axios, basePath)); }, /** * Get a city\'s published weather-index configuration timeline: the launch configuration plus every weekly offset calibration and methodology update, ascending by effective time. Each record carries the station weights, station offsets (Celsius), and the city reference used to compute index values from the record\'s effective time until the next record — everything needed to reproduce published index values for minutes computed under that configuration version. Offsets are re-estimated weekly after each complete UTC week; weights never change through calibration. The timeline is append-only and complete: it is never trimmed. * @summary Get Weather Index Calibrations * @param {string} city Index city ID (e.g. `miami`) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWeatherIndexCalibrations(city: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getWeatherIndexCalibrations(city, options).then((request) => request(axios, basePath)); }, }; }; /** * LiveDataApi - object-oriented interface */ export class LiveDataApi extends BaseAPI { /** * Get live data for an event by its event ticker. Serves event-keyed live data such as crypto price charts, commodity price timeseries, and weather observations. The `type` field in the response names the schema of the `details` object. * @summary Get Event Live Data * @param {string} eventTicker Event ticker * @param {string} [range] Optional chart range hint (e.g. `15min`, `1h`, `1d`). When the underlying live data type supports it, restricts the returned timeseries to the requested window. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getEventLiveData(eventTicker: string, range?: string, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getEventLiveData(eventTicker, range, options).then((request) => request(this.axios, this.basePath)); } /** * Get play-by-play game statistics for a specific milestone. Supported sports: Pro Football, College Football, Pro Basketball, College Men\'s Basketball, College Women\'s Basketball, WNBA, Soccer, Pro Hockey, and Pro Baseball. Returns null for unsupported milestone types or milestones without a Sportradar ID. * @summary Get Game Stats * @param {string} milestoneId Milestone ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getGameStats(milestoneId: string, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getGameStats(milestoneId, options).then((request) => request(this.axios, this.basePath)); } /** * Get live data for a specific milestone. This is the legacy endpoint that requires a type path parameter. Prefer using `/live_data/milestone/{milestone_id}` instead. * @summary Get Live Data (with type) * @param {string} type Type of live data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getLiveData(type: string, milestoneId: string, includePlayerStats?: boolean, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getLiveData(type, milestoneId, includePlayerStats, options).then((request) => request(this.axios, this.basePath)); } /** * Get live data for a specific milestone. The response\'s `live_data.details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `live_data.details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Live Data * @param {string} milestoneId Milestone ID * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getLiveDataByMilestone(milestoneId: string, includePlayerStats?: boolean, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getLiveDataByMilestone(milestoneId, includePlayerStats, options).then((request) => request(this.axios, this.basePath)); } /** * Get live data for multiple milestones. Each entry\'s `details.status` is updated far more often than the milestone\'s own `details.status` and is the preferred source for game status. It is not guaranteed to be current: if the provider feed falls behind, a cached board may still be served, with `details.live_data_delayed` set to `true` only once it is significantly stale (some feeds never set it), so a missing flag does not by itself mean the data is current. * @summary Get Multiple Live Data * @param {Array} milestoneIds Array of milestone IDs * @param {boolean} [includePlayerStats] When true, includes player-level statistics in the live data response. Supported for Pro Football, Pro Basketball, and College Men\'s Basketball milestones that have player ID mappings configured. Has no effect for other sports or milestones without player mappings. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getLiveDatas(milestoneIds: Array, includePlayerStats?: boolean, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getLiveDatas(milestoneIds, includePlayerStats, options).then((request) => request(this.axios, this.basePath)); } /** * Get the Kalshi-computed city temperature index: the canonical minute-resolution series behind hourly temperature markets. City-keyed and independent of any event — the series exists whenever the city\'s index is configured. Values are Fahrenheit rounded to 0.01. Minutes where the index quorum failed carry no value and are never returned as points, so gaps in the series are real gaps. With `detailed=true` each point additionally carries every member station\'s reported reading and quality-control disposition — the pre-incorporation breakdown. * @summary Get Weather Index * @param {string} city Index city ID (e.g. `miami`) * @param {number} [from] Window start, unix milliseconds (inclusive). Defaults to `to` minus 24 hours. Must be paired with `to` unless `last_sec` is used. * @param {number} [to] Window end, unix milliseconds (inclusive). Defaults to now. * @param {number} [lastSec] Trailing window in seconds; equivalent to `from=now-last_sec`, `to=now`. Mutually exclusive with `from`/`to`. * @param {boolean} [detailed] Include per-station audit readings on every point. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getWeatherIndex(city: string, from?: number, to?: number, lastSec?: number, detailed?: boolean, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getWeatherIndex(city, from, to, lastSec, detailed, options).then((request) => request(this.axios, this.basePath)); } /** * Get a city\'s published weather-index configuration timeline: the launch configuration plus every weekly offset calibration and methodology update, ascending by effective time. Each record carries the station weights, station offsets (Celsius), and the city reference used to compute index values from the record\'s effective time until the next record — everything needed to reproduce published index values for minutes computed under that configuration version. Offsets are re-estimated weekly after each complete UTC week; weights never change through calibration. The timeline is append-only and complete: it is never trimmed. * @summary Get Weather Index Calibrations * @param {string} city Index city ID (e.g. `miami`) * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getWeatherIndexCalibrations(city: string, options?: RawAxiosRequestConfig) { return LiveDataApiFp(this.configuration).getWeatherIndexCalibrations(city, options).then((request) => request(this.axios, this.basePath)); } }