All URIs are relative to https://api.elections.kalshi.com/trade-api/v2
MethodHTTP requestDescription
getEventGET /events/Get Event
getEventMetadataGET /events//metadataGet Event Metadata
getEventsGET /eventsGet Events

getEvent

GetEventResponse getEvent()
Get 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.

Example

import {
    EventsApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new EventsApi(configuration);

let eventTicker: string; //Event ticker (default to undefined)
let withNestedMarkets: boolean; //If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response. (optional) (default to false)

const { status, data } = await apiInstance.getEvent(
    eventTicker,
    withNestedMarkets
);

Parameters

NameTypeDescriptionNotes
eventTicker[string]Event tickerdefaults to undefined
withNestedMarkets[boolean]If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.(optional) defaults to false

Return type

GetEventResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Event retrieved successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getEventMetadata

GetEventMetadataResponse getEventMetadata()
Get metadata about an event by its ticker

Example

import {
    EventsApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new EventsApi(configuration);

let eventTicker: string; //Event ticker (default to undefined)

const { status, data } = await apiInstance.getEventMetadata(
    eventTicker
);

Parameters

NameTypeDescriptionNotes
eventTicker[string]Event tickerdefaults to undefined

Return type

GetEventMetadataResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Event metadata retrieved successfully-
401Unauthorized - authentication required-
404Resource not found-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]

getEvents

GetEventsResponse getEvents()
Get 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.

Example

import {
    EventsApi,
    Configuration
} from '@kalshi/trading-api';

const configuration = new Configuration();
const apiInstance = new EventsApi(configuration);

let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
let 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) (default to undefined)
let withNestedMarkets: boolean; //If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response. (optional) (default to false)
let status: string; //Filter by status. Possible values depend on the endpoint. (optional) (default to undefined)
let seriesTicker: string; //Filter by series ticker (optional) (default to undefined)
let minCloseTs: number; //Filter items that close after this Unix timestamp (optional) (default to undefined)

const { status, data } = await apiInstance.getEvents(
    limit,
    cursor,
    withNestedMarkets,
    status,
    seriesTicker,
    minCloseTs
);

Parameters

NameTypeDescriptionNotes
limit[number]Number of results per page. Defaults to 100. Maximum value is 200.(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
withNestedMarkets[boolean]If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response.(optional) defaults to false
status[string]Filter by status. Possible values depend on the endpoint.(optional) defaults to undefined
seriesTicker[string]Filter by series ticker(optional) defaults to undefined
minCloseTs[number]Filter items that close after this Unix timestamp(optional) defaults to undefined

Return type

GetEventsResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Events retrieved successfully-
400Bad request - invalid input-
401Unauthorized - authentication required-
500Internal server error-
[Back to top] [Back to API list] [Back to Model list] [Back to README]