kalshi-cpp 0.8.0
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
api.hpp
Go to the documentation of this file.
1// Generated by tools/codegen/generate.py from spec/openapi.yaml. Do not edit.
2#pragma once
3
6
7#include "kalshi/error.hpp"
9#include "kalshi/models.hpp"
10#include "kalshi/rate_limit.hpp"
11
12#include <memory>
13#include <string_view>
14
15namespace kalshi {
16
26public:
28 explicit KalshiClient(HttpClient client);
31 explicit KalshiClient(std::shared_ptr<const HttpTransport> transport);
33
35 KalshiClient& operator=(KalshiClient&&) noexcept;
36 KalshiClient(const KalshiClient&) = delete;
37 KalshiClient& operator=(const KalshiClient&) = delete;
38
39 [[nodiscard]] const HttpTransport& transport() const noexcept;
40
41 // ----- account -----------------------------------------------------------
42
46
50
53 [[nodiscard]] Result<std::vector<AccountApiUsageLevelVolumeProgress>>
55
59
60 // ----- api-keys ----------------------------------------------------------
61
64 [[nodiscard]] Result<GetApiKeysResponse> get_api_keys(const GetApiKeysParams& params = {});
65
69
74
77 [[nodiscard]] Result<void> delete_api_key(std::string_view api_key);
78
79 // ----- communications ----------------------------------------------------
80
84
89
93
96 [[nodiscard]] Result<void>
97 accept_block_trade_proposal(std::string_view block_trade_proposal_id,
99
102 [[nodiscard]] Result<GetRFQsResponse> get_rfqs(const GetRfqsParams& params = {});
103
107
110 [[nodiscard]] Result<RFQ> get_rfq(std::string_view rfq_id);
111
114 [[nodiscard]] Result<void> delete_rfq(std::string_view rfq_id);
115
118 [[nodiscard]] Result<Quote> get_rfq_quote(std::string_view rfq_id, std::string_view quote_id);
119
122 [[nodiscard]] Result<void> delete_rfq_quote(std::string_view rfq_id, std::string_view quote_id);
123
126 [[nodiscard]] Result<void> accept_rfq_quote(std::string_view rfq_id, std::string_view quote_id,
127 const AcceptQuoteRequest& body);
128
131 [[nodiscard]] Result<void> confirm_rfq_quote(std::string_view rfq_id,
132 std::string_view quote_id);
133
138
142
145 [[nodiscard]] Result<RFQBatch> get_rfq_batch(std::string_view rfq_batch_id);
146
149 [[nodiscard]] Result<void> delete_rfq_batch(std::string_view rfq_batch_id);
150
153 [[nodiscard]] Result<RFQBatchBestQuotes>
154 get_rfq_batch_best_quotes(std::string_view rfq_batch_id);
155
159 accept_rfq_batch(std::string_view rfq_batch_id, const AcceptRFQBatchRequest& body);
160
164 get_rfq_batch_quotes(std::string_view rfq_batch_id);
165
168 [[nodiscard]] Result<std::string>
169 create_rfq_batch_quote(std::string_view rfq_batch_id, const CreateRFQBatchQuoteRequest& body);
170
173 [[nodiscard]] Result<void> delete_rfq_batch_quote(std::string_view rfq_batch_id,
174 std::string_view batch_quote_id);
175
178 [[nodiscard]] Result<void> confirm_rfq_batch_quote(std::string_view rfq_batch_id,
179 std::string_view batch_quote_id);
180
183 [[nodiscard]] Result<GetQuotesResponse> get_quotes(const GetQuotesParams& params = {});
184
188
191 [[deprecated("deprecated by Kalshi")]] [[nodiscard]] Result<Quote>
192 get_quote(std::string_view quote_id);
193
196 [[deprecated("deprecated by Kalshi")]] [[nodiscard]] Result<void>
197 delete_quote(std::string_view quote_id);
198
201 [[deprecated("deprecated by Kalshi")]] [[nodiscard]] Result<void>
202 accept_quote(std::string_view quote_id, const AcceptQuoteRequest& body);
203
206 [[deprecated("deprecated by Kalshi")]] [[nodiscard]] Result<void>
207 confirm_quote(std::string_view quote_id);
208
209 // ----- events ------------------------------------------------------------
210
214 get_market_candlesticks_by_event(std::string_view series_ticker, std::string_view ticker,
216
219 [[nodiscard]] Result<GetEventsResponse> get_events(const GetEventsParams& params = {});
220
225
230
233 [[nodiscard]] Result<GetEventResponse> get_event(std::string_view event_ticker,
234 const GetEventParams& params = {});
235
239 get_event_metadata(std::string_view event_ticker);
240
244 get_event_forecast_percentiles_history(std::string_view series_ticker, std::string_view ticker,
246
247 // ----- exchange ----------------------------------------------------------
248
252
257
261
265
266 // ----- fcm ---------------------------------------------------------------
267
271
275
279
283
288
291 [[nodiscard]] Result<void>
293
296 [[nodiscard]] Result<void>
298
303
308
311 [[nodiscard]] Result<GetPositionsResponse>
313
316 [[nodiscard]] Result<std::string>
318
319 // ----- historical --------------------------------------------------------
320
324
328 get_market_candlesticks_historical(std::string_view ticker,
330
333 [[nodiscard]] Result<GetFillsResponse>
335
338 [[nodiscard]] Result<GetOrdersResponse>
340
343 [[nodiscard]] Result<GetPositionsResponse>
345
348 [[nodiscard]] Result<GetTradesResponse>
350
353 [[nodiscard]] Result<GetMarketsResponse>
355
358 [[nodiscard]] Result<Market> get_historical_market(std::string_view ticker);
359
360 // ----- incentive-programs ------------------------------------------------
361
366
367 // ----- live-data ---------------------------------------------------------
368
371 [[nodiscard]] Result<LiveData>
372 get_live_data_by_milestone(std::string_view milestone_id,
373 const GetLiveDataByMilestoneParams& params = {});
374
377 [[nodiscard]] Result<LiveData> get_live_data(std::string_view type,
378 std::string_view milestone_id,
379 const GetLiveDataParams& params = {});
380
384
387 [[nodiscard]] Result<std::optional<PlayByPlay>> get_game_stats(std::string_view milestone_id);
388
391 [[nodiscard]] Result<EventLiveData>
392 get_event_live_data(std::string_view event_ticker, const GetEventLiveDataParams& params = {});
393
397 get_weather_index(std::string_view city, const GetWeatherIndexParams& params = {});
398
402 get_weather_index_calibrations(std::string_view city);
403
404 // ----- market ------------------------------------------------------------
405
409 get_market_candlesticks(std::string_view series_ticker, std::string_view ticker,
410 const GetMarketCandlesticksParams& params);
411
414 [[nodiscard]] Result<GetTradesResponse> get_trades(const GetTradesParams& params = {});
415
418 [[nodiscard]] Result<OrderbookCountFp>
419 get_market_orderbook(std::string_view ticker, const GetMarketOrderbookParams& params = {});
420
425
428 [[nodiscard]] Result<Series> get_series(std::string_view series_ticker,
429 const GetSeriesParams& params = {});
430
433 [[nodiscard]] Result<std::vector<Series>>
435
438 [[nodiscard]] Result<GetMarketsResponse> get_markets(const GetMarketsParams& params = {});
439
442 [[nodiscard]] Result<Market> get_market(std::string_view ticker);
443
448
449 // ----- milestone ---------------------------------------------------------
450
453 [[nodiscard]] Result<Milestone> get_milestone(std::string_view milestone_id);
454
458
459 // ----- multivariate ------------------------------------------------------
460
464 get_multivariate_event_collection(std::string_view collection_ticker);
465
470 std::string_view collection_ticker,
472
477
478 // ----- order-groups ------------------------------------------------------
479
484
489
493 get_order_group(std::string_view order_group_id, const GetOrderGroupParams& params = {});
494
497 [[nodiscard]] Result<void> delete_order_group(std::string_view order_group_id,
498 const DeleteOrderGroupParams& params = {});
499
502 [[nodiscard]] Result<void> reset_order_group(std::string_view order_group_id,
503 const ResetOrderGroupParams& params = {});
504
507 [[nodiscard]] Result<void> trigger_order_group(std::string_view order_group_id,
508 const TriggerOrderGroupParams& params = {});
509
512 [[nodiscard]] Result<void>
513 update_order_group_limit(std::string_view order_group_id,
515 const UpdateOrderGroupLimitParams& params = {});
516
517 // ----- orders ------------------------------------------------------------
518
521 [[nodiscard]] Result<GetOrdersResponse> get_orders(const GetOrdersParams& params = {});
522
525 [[nodiscard]] Result<Order> get_order(std::string_view order_id);
526
531
534 [[nodiscard]] Result<FixedPointCount> get_order_queue_position(std::string_view order_id);
535
539
542 [[nodiscard]] Result<void> cancel_all_orders(const CancelAllOrdersParams& params = {});
543
548
553
558
561 [[nodiscard]] Result<CancelOrderV2Response> cancel_order(std::string_view order_id,
562 const CancelOrderParams& params = {});
563
566 [[nodiscard]] Result<AmendOrderV2Response> amend_order(std::string_view order_id,
567 const AmendOrderV2Request& body,
568 const AmendOrderParams& params = {});
569
573 decrease_order(std::string_view order_id, const DecreaseOrderV2Request& body,
574 const DecreaseOrderParams& params = {});
575
576 // ----- portfolio ---------------------------------------------------------
577
581 get_event_contract_exit_triggers(std::string_view ticker,
582 const GetEventContractExitTriggersParams& params = {});
583
587 set_event_contract_exit_trigger(std::string_view ticker,
589 const SetEventContractExitTriggerParams& params = {});
590
593 [[nodiscard]] Result<void>
594 delete_event_contract_exit_trigger(std::string_view ticker,
595 const DeleteEventContractExitTriggerParams& params = {});
596
599 [[nodiscard]] Result<GetBalanceResponse> get_balance(const GetBalanceParams& params = {});
600
603 [[nodiscard]] Result<std::string>
605
610 const GetIntraExchangeInstanceTransfersParams& params = {});
611
615 get_intra_exchange_instance_transfer(std::string_view transfer_id);
616
620
623 [[nodiscard]] Result<void>
625
629
634
638
641 [[nodiscard]] Result<void>
643
647
652
657
661
666
671
674 [[nodiscard]] Result<GetFillsResponse> get_fills(const GetFillsParams& params = {});
675
679
682 [[nodiscard]] Result<void>
684
685 // ----- search ------------------------------------------------------------
686
691
695
696 // ----- structured-targets ------------------------------------------------
697
702
706 get_structured_target(std::string_view structured_target_id);
707
708private:
709 struct Impl;
710 std::unique_ptr<Impl> impl_;
711};
712
717
718} // namespace kalshi
libcurl transport.
Definition http_client.hpp:96
Request boundary used by KalshiClient.
Definition http_client.hpp:65
Client for the Kalshi Predictions REST API.
Definition api.hpp:25
Result< std::vector< AccountApiUsageLevelVolumeProgress > > get_account_api_usage_level_volume_progress()
Get Account API Usage Level Volume Progress GET /account/api_usage_level/volume_progress
Result< RFQBatch > get_rfq_batch(std::string_view rfq_batch_id)
Get RFQ Batch GET /communications/rfq_batches/{rfq_batch_id}
Result< std::string > propose_block_trade(const ProposeBlockTradeRequest &body)
Propose Block Trade POST /communications/block-trade-proposals
Result< std::vector< RFQBatchQuote > > get_rfq_batch_quotes(std::string_view rfq_batch_id)
Get RFQ Batch Quotes GET /communications/rfq_batches/{rfq_batch_id}/quotes
Result< Quote > get_quote(std::string_view quote_id)
Get Quote GET /communications/quotes/{quote_id}
Result< void > apply_subaccount_transfer(const ApplySubaccountTransferRequest &body)
Transfer Between Subaccounts POST /portfolio/subaccounts/transfer
Result< void > delete_order_group(std::string_view order_group_id, const DeleteOrderGroupParams &params={})
Delete Order Group DELETE /portfolio/order_groups/{order_group_id}
KalshiClient(KalshiClient &&) noexcept
Result< Milestone > get_milestone(std::string_view milestone_id)
Get Milestone GET /milestones/{milestone_id}
Result< void > confirm_quote(std::string_view quote_id)
Confirm Quote PUT /communications/quotes/{quote_id}/confirm
Result< std::vector< FCMSubtrader > > get_fcm_subtraders()
List FCM Subtraders GET /fcm/subtraders
Result< std::string > create_fcm_position_transfer(const CreateFCMPositionTransferRequest &body)
Create FCM Position Transfer POST /fcm/positions/transfers
Result< std::string > get_communications_id()
Get Communications ID GET /communications/id
Result< GetOrdersResponse > get_orders(const GetOrdersParams &params={})
Get Orders GET /portfolio/orders
Result< CreateMarketInMultivariateEventCollectionResponse > create_market_in_multivariate_event_collection(std::string_view collection_ticker, const CreateMarketInMultivariateEventCollectionRequest &body)
Create Market In Multivariate Event Collection POST /multivariate_event_collections/{collection_ticke...
Result< void > update_order_group_limit(std::string_view order_group_id, const UpdateOrderGroupLimitRequest &body, const UpdateOrderGroupLimitParams &params={})
Update Order Group Limit PUT /portfolio/order_groups/{order_group_id}/limit
Result< std::vector< MarketCandlesticksResponse > > batch_get_market_candlesticks(const BatchGetMarketCandlesticksParams &params)
Batch Get Market Candlesticks GET /markets/candlesticks
Result< std::optional< PlayByPlay > > get_game_stats(std::string_view milestone_id)
Get Game Stats GET /live_data/milestone/{milestone_id}/game_stats
Result< GetStructuredTargetsResponse > get_structured_targets(const GetStructuredTargetsParams &params={})
Get Structured Targets GET /structured_targets
Result< GetBlockTradeProposalsResponse > get_block_trade_proposals(const GetBlockTradeProposalsParams &params={})
Get Block Trade Proposals GET /communications/block-trade-proposals
Result< CreateOrderGroupResponse > create_order_group(const CreateOrderGroupRequest &body)
Create Order Group POST /portfolio/order_groups/create
const HttpTransport & transport() const noexcept
Result< std::vector< MarketOrderbookFp > > get_market_orderbooks(const GetMarketOrderbooksParams &params)
Get Multiple Market Orderbooks GET /markets/orderbooks
Result< GetPositionsResponse > get_fcm_positions(const GetFcmPositionsParams &params={})
Get FCM Positions GET /fcm/positions
Result< void > update_subaccount_netting(const UpdateSubaccountNettingRequest &body)
Update Subaccount Netting PUT /portfolio/subaccounts/netting
Result< GetBalanceResponse > get_balance(const GetBalanceParams &params={})
Get Balance GET /portfolio/balance
Result< void > update_fcm_event_contract_daily_cap(const UpdateFCMEventContractDailyCapRequest &body)
Update FCM Subtrader Event Contract Daily Cap PUT /fcm/subtraders/event_contract_daily_cap
Result< GetDepositsResponse > get_deposits(const GetDepositsParams &params={})
Get Deposits GET /portfolio/deposits
Result< GetFcmFillsResponse > get_fcm_fills(const GetFcmFillsParams &params={})
Get FCM Fills GET /fcm/fills
Result< GetFillsResponse > get_fills_historical(const GetFillsHistoricalParams &params={})
Get Historical Fills GET /historical/fills
Result< void > reset_order_group(std::string_view order_group_id, const ResetOrderGroupParams &params={})
Reset Order Group PUT /portfolio/order_groups/{order_group_id}/reset
Result< GetTargetBalanceAllocationResponse > get_target_balance_allocation()
Get Target Balance Allocation GET /portfolio/target_balance_allocation
Result< GetPortfolioRestingOrderTotalValueResponse > get_portfolio_resting_order_total_value()
Get Total Resting Order Value GET /portfolio/summary/total_resting_order_value
Result< IntraExchangeInstanceTransfer > get_intra_exchange_instance_transfer(std::string_view transfer_id)
Get Intra Account Transfer GET /portfolio/intra_exchange_instance_transfers/{transfer_id}
Result< std::vector< std::string > > update_fcm_subtrader_blocked_categories(const UpdateFCMSubtraderBlockedCategoriesRequest &body)
Update FCM Subtrader Blocked Categories PUT /fcm/subtraders/blocked_categories
Result< std::vector< BatchCancelOrdersV2ResponseOrdersItem > > batch_cancel_orders(const BatchCancelOrdersV2Request &body)
Batch Cancel Orders DELETE /portfolio/events/orders/batched
Result< RFQ > get_rfq(std::string_view rfq_id)
Get RFQ GET /communications/rfqs/{rfq_id}
Result< std::string > intra_exchange_instance_transfer(const IntraExchangeInstanceTransferRequest &body)
Intra Account Transfer POST /portfolio/intra_exchange_instance_transfer
Result< GetMilestonesResponse > get_milestones(const GetMilestonesParams &params)
Get Milestones GET /milestones
Result< Schedule > get_exchange_schedule()
Get Exchange Schedule GET /exchange/schedule
KalshiClient(std::shared_ptr< const HttpTransport > transport)
Uses any transport, such as RetryingTransport or a test double.
Result< RFQBatch > create_rfq_batch(const CreateRFQBatchRequest &body)
Create RFQ Batch POST /communications/rfq_batches
Result< GetAccountEndpointCostsResponse > get_account_endpoint_costs()
List Non-Default Endpoint Costs GET /account/endpoint_costs
Result< AmendOrderV2Response > amend_order(std::string_view order_id, const AmendOrderV2Request &body, const AmendOrderParams &params={})
Amend Order POST /portfolio/events/orders/{order_id}/amend
Result< GetEventMetadataResponse > get_event_metadata(std::string_view event_ticker)
Get Event Metadata GET /events/{event_ticker}/metadata
Result< GetIntraExchangeInstanceTransfersResponse > get_intra_exchange_instance_transfers(const GetIntraExchangeInstanceTransfersParams &params={})
Get Intra Account Transfers GET /portfolio/intra_exchange_instance_transfers
Result< std::string > create_rfq_batch_quote(std::string_view rfq_batch_id, const CreateRFQBatchQuoteRequest &body)
Create RFQ Batch Quote POST /communications/rfq_batches/{rfq_batch_id}/quotes
Result< Quote > get_rfq_quote(std::string_view rfq_id, std::string_view quote_id)
Get RFQ Quote GET /communications/rfqs/{rfq_id}/quotes/{quote_id}
Result< GetWeatherIndexCalibrationsResponse > get_weather_index_calibrations(std::string_view city)
Get Weather Index Calibrations GET /live_data/weather/{city}/calibrations
Result< GetMarketsResponse > get_markets(const GetMarketsParams &params={})
Get Markets GET /markets
Result< void > delete_event_contract_exit_trigger(std::string_view ticker, const DeleteEventContractExitTriggerParams &params={})
Cancel Position Exit Trigger DELETE /portfolio/positions/{ticker}/exit_trigger
Result< std::vector< SubaccountBalance > > get_subaccount_balances()
Get All Subaccount Balances GET /portfolio/subaccounts/balances
Result< GetEventCandlesticksResponse > get_market_candlesticks_by_event(std::string_view series_ticker, std::string_view ticker, const GetMarketCandlesticksByEventParams &params)
Get Event Candlesticks GET /series/{series_ticker}/events/{ticker}/candlesticks
Result< LiveData > get_live_data_by_milestone(std::string_view milestone_id, const GetLiveDataByMilestoneParams &params={})
Get Live Data GET /live_data/milestone/{milestone_id}
Result< GetTradesResponse > get_trades_historical(const GetTradesHistoricalParams &params={})
Get Historical Trades GET /historical/trades
Result< GetOrdersResponse > get_historical_orders(const GetHistoricalOrdersParams &params={})
Get Historical Orders GET /historical/orders
Result< GetApiKeysResponse > get_api_keys(const GetApiKeysParams &params={})
Get API Keys GET /api_keys
Result< void > upgrade_account_api_usage_level()
Upgrade Account API Usage Level POST /account/api_usage_level/upgrade
Result< GetFillsResponse > get_fills(const GetFillsParams &params={})
Get Fills GET /portfolio/fills
Result< Market > get_market(std::string_view ticker)
Get Market GET /markets/{ticker}
Result< Market > get_historical_market(std::string_view ticker)
Get Historical Market GET /historical/markets/{ticker}
Result< GetPositionsResponse > get_historical_positions(const GetHistoricalPositionsParams &params={})
Get Historical Positions GET /historical/positions
Result< std::vector< Series > > get_series_list(const GetSeriesListParams &params={})
Get Series List GET /series
Result< GetOrderGroupResponse > get_order_group(std::string_view order_group_id, const GetOrderGroupParams &params={})
Get Order Group GET /portfolio/order_groups/{order_group_id}
Result< GetPositionsResponse > get_positions(const GetPositionsParams &params={})
Get Positions GET /portfolio/positions
Result< void > set_target_balance_allocation(const SetTargetBalanceAllocationRequest &body)
Set Target Balance Allocation POST /portfolio/target_balance_allocation
Result< void > delete_rfq(std::string_view rfq_id)
Delete RFQ DELETE /communications/rfqs/{rfq_id}
Result< void > accept_rfq_quote(std::string_view rfq_id, std::string_view quote_id, const AcceptQuoteRequest &body)
Accept RFQ Quote PUT /communications/rfqs/{rfq_id}/quotes/{quote_id}/accept
Result< GetFCMEventContractDailyCapResponse > get_fcm_event_contract_daily_cap(const GetFcmEventContractDailyCapParams &params={})
Get FCM Subtrader Event Contract Daily Cap GET /fcm/subtraders/event_contract_daily_cap
Result< void > delete_rfq_quote(std::string_view rfq_id, std::string_view quote_id)
Delete RFQ Quote DELETE /communications/rfqs/{rfq_id}/quotes/{quote_id}
Result< void > confirm_rfq_quote(std::string_view rfq_id, std::string_view quote_id)
Confirm RFQ Quote PUT /communications/rfqs/{rfq_id}/quotes/{quote_id}/confirm
Result< void > delete_fcm_event_contract_daily_cap(const DeleteFcmEventContractDailyCapParams &params)
Delete FCM Subtrader Event Contract Daily Cap DELETE /fcm/subtraders/event_contract_daily_cap
Result< void > delete_rfq_batch(std::string_view rfq_batch_id)
Delete RFQ Batch DELETE /communications/rfq_batches/{rfq_batch_id}
Result< GetMarketCandlesticksHistoricalResponse > get_market_candlesticks_historical(std::string_view ticker, const GetMarketCandlesticksHistoricalParams &params)
Get Historical Market Candlesticks GET /historical/markets/{ticker}/candlesticks
Result< DecreaseOrderV2Response > decrease_order(std::string_view order_id, const DecreaseOrderV2Request &body, const DecreaseOrderParams &params={})
Decrease Order POST /portfolio/events/orders/{order_id}/decrease
Result< GetSubaccountTransfersResponse > get_subaccount_transfers(const GetSubaccountTransfersParams &params={})
Get Subaccount Transfers GET /portfolio/subaccounts/transfers
Result< std::string > get_user_data_timestamp()
Get User Data Timestamp GET /exchange/user_data_timestamp
Result< std::vector< std::string > > get_fcm_subtrader_blocked_categories(const GetFcmSubtraderBlockedCategoriesParams &params)
Get FCM Subtrader Blocked Categories GET /fcm/subtraders/blocked_categories
Result< std::optional< std::vector< OrderGroup > > > get_order_groups(const GetOrderGroupsParams &params={})
Get Order Groups GET /portfolio/order_groups
Result< GetFiltersBySportsResponse > get_filters_for_sports()
Get Filters for Sports GET /search/filters_by_sport
Result< std::int64_t > create_subaccount(const CreateSubaccountRequest &body)
Create Subaccount POST /portfolio/subaccounts
Result< GetEventFeeChangesResponse > get_event_fee_changes(const GetEventFeeChangesParams &params={})
Get Event Fee Changes GET /events/fee_changes
Result< GetQuotesResponse > get_quotes(const GetQuotesParams &params={})
Get Quotes GET /communications/quotes
Result< OrderbookCountFp > get_market_orderbook(std::string_view ticker, const GetMarketOrderbookParams &params={})
Get Market Orderbook GET /markets/{ticker}/orderbook
Result< EventContractExitTrigger > set_event_contract_exit_trigger(std::string_view ticker, const SetEventContractExitTriggerRequest &body, const SetEventContractExitTriggerParams &params={})
Set Position Exit Trigger PUT /portfolio/positions/{ticker}/exit_trigger
Result< std::optional< StructuredTarget > > get_structured_target(std::string_view structured_target_id)
Get Structured Target GET /structured_targets/{structured_target_id}
Result< void > delete_quote(std::string_view quote_id)
Delete Quote DELETE /communications/quotes/{quote_id}
Result< std::string > create_quote(const CreateQuoteRequest &body)
Create Quote POST /communications/quotes
Result< CreateApiKeyResponse > create_api_key(const CreateApiKeyRequest &body)
Create API Key POST /api_keys
Result< void > cancel_all_orders(const CancelAllOrdersParams &params={})
Cancel All Orders DELETE /portfolio/events/orders
Result< GetTradesResponse > get_trades(const GetTradesParams &params={})
Get Trades GET /markets/trades
Result< MultivariateEventCollection > get_multivariate_event_collection(std::string_view collection_ticker)
Get Multivariate Event Collection GET /multivariate_event_collections/{collection_ticker}
Result< GetOrdersResponse > get_fcm_orders(const GetFcmOrdersParams &params={})
Get FCM Orders GET /fcm/orders
Result< GetRFQBatchesResponse > get_rfq_batches(const GetRfqBatchesParams &params={})
Get RFQ Batches GET /communications/rfq_batches
Result< GetEventResponse > get_event(std::string_view event_ticker, const GetEventParams &params={})
Get Event GET /events/{event_ticker}
Result< std::vector< OrderQueuePosition > > get_order_queue_positions(const GetOrderQueuePositionsParams &params={})
Get Queue Positions for Orders GET /portfolio/orders/queue_positions
Result< void > trigger_order_group(std::string_view order_group_id, const TriggerOrderGroupParams &params={})
Trigger Order Group PUT /portfolio/order_groups/{order_group_id}/trigger
Result< std::vector< BatchCreateOrdersV2ResponseOrdersItem > > batch_create_orders(const BatchCreateOrdersV2Request &body)
Batch Create Orders POST /portfolio/events/orders/batched
Result< std::vector< SubaccountNettingConfig > > get_subaccount_netting()
Get Subaccount Netting GET /portfolio/subaccounts/netting
Result< void > accept_quote(std::string_view quote_id, const AcceptQuoteRequest &body)
Accept Quote PUT /communications/quotes/{quote_id}/accept
Result< GetMarketsResponse > get_historical_markets(const GetHistoricalMarketsParams &params={})
Get Historical Markets GET /historical/markets
Result< GetCreditHistoryResponse > get_credit_history(const GetCreditHistoryParams &params={})
Get Credit History GET /portfolio/credit_history
Result< Order > get_order(std::string_view order_id)
Get Order GET /portfolio/orders/{order_id}
Result< ExchangeStatus > get_exchange_status()
Get Exchange Status GET /exchange/status
Result< LiveData > get_live_data(std::string_view type, std::string_view milestone_id, const GetLiveDataParams &params={})
Get Live Data (with type) GET /live_data/{type}/milestone/{milestone_id}
Result< std::string > create_rfq(const CreateRFQRequest &body)
Create RFQ POST /communications/rfqs
Result< void > accept_block_trade_proposal(std::string_view block_trade_proposal_id, const AcceptBlockTradeProposalRequest &body)
Accept Block Trade Proposal POST /communications/block-trade-proposals/{block_trade_proposal_id}/acce...
Result< FixedPointCount > get_order_queue_position(std::string_view order_id)
Get Order Queue Position GET /portfolio/orders/{order_id}/queue_position
Result< GetMultivariateEventsResponse > get_multivariate_events(const GetMultivariateEventsParams &params={})
Get Multivariate Events GET /events/multivariate
Result< Series > get_series(std::string_view series_ticker, const GetSeriesParams &params={})
Get Series GET /series/{series_ticker}
Result< GenerateApiKeyResponse > generate_api_key(const GenerateApiKeyRequest &body)
Generate API Key POST /api_keys/generate
Result< GetRFQsResponse > get_rfqs(const GetRfqsParams &params={})
Get RFQs GET /communications/rfqs
Result< GetWithdrawalsResponse > get_withdrawals(const GetWithdrawalsParams &params={})
Get Withdrawals GET /portfolio/withdrawals
Result< GetMultivariateEventCollectionsResponse > get_multivariate_event_collections(const GetMultivariateEventCollectionsParams &params={})
Get Multivariate Event Collections GET /multivariate_event_collections
Result< std::vector< LiveData > > get_live_datas(const GetLiveDatasParams &params)
Get Multiple Live Data GET /live_data/batch
Result< void > delete_rfq_batch_quote(std::string_view rfq_batch_id, std::string_view batch_quote_id)
Delete RFQ Batch Quote DELETE /communications/rfq_batches/{rfq_batch_id}/quotes/{batch_quote_id}
Result< GetSettlementsResponse > get_settlements(const GetSettlementsParams &params={})
Get Settlements GET /portfolio/settlements
Result< GetWeatherIndexResponse > get_weather_index(std::string_view city, const GetWeatherIndexParams &params={})
Get Weather Index GET /live_data/weather/{city}
Result< GetEventContractExitTriggersResponse > get_event_contract_exit_triggers(std::string_view ticker, const GetEventContractExitTriggersParams &params={})
Get Position Exit Triggers GET /portfolio/positions/{ticker}/exit_trigger
Result< std::string > create_fcm_subtrader(const CreateFCMSubtraderRequest &body)
Create FCM Subtrader POST /fcm/subtraders
Result< GetEventsResponse > get_events(const GetEventsParams &params={})
Get Events GET /events
Result< GetIncentiveProgramsResponse > get_incentive_programs(const GetIncentiveProgramsParams &params={})
Get Incentives GET /incentive_programs
Result< std::vector< SeriesFeeChange > > get_series_fee_changes(const GetSeriesFeeChangesParams &params={})
Get Series Fee Changes GET /series/fee_changes
KalshiClient(HttpClient client)
Uses a libcurl client. It signs requests when constructed with a Signer.
Result< void > delete_api_key(std::string_view api_key)
Delete API Key DELETE /api_keys/{api_key}
Result< std::vector< ForecastPercentilesPoint > > get_event_forecast_percentiles_history(std::string_view series_ticker, std::string_view ticker, const GetEventForecastPercentilesHistoryParams &params)
Get Event Forecast Percentile History GET /series/{series_ticker}/events/{ticker}/forecast_percentile...
Result< RFQBatchBestQuotes > get_rfq_batch_best_quotes(std::string_view rfq_batch_id)
Get RFQ Batch Best Quotes GET /communications/rfq_batches/{rfq_batch_id}/best_quotes
Result< AcceptRFQBatchResponse > accept_rfq_batch(std::string_view rfq_batch_id, const AcceptRFQBatchRequest &body)
Accept RFQ Batch PUT /communications/rfq_batches/{rfq_batch_id}/accept
Result< GetAccountApiLimitsResponse > get_account_api_limits()
Get Account API Limits GET /account/limits
Result< EventLiveData > get_event_live_data(std::string_view event_ticker, const GetEventLiveDataParams &params={})
Get Event Live Data GET /live_data/events/{event_ticker}
Result< GetHistoricalCutoffResponse > get_historical_cutoff()
Get Historical Cutoff Timestamps GET /historical/cutoff
Result< void > confirm_rfq_batch_quote(std::string_view rfq_batch_id, std::string_view batch_quote_id)
Confirm RFQ Batch Quote PUT /communications/rfq_batches/{rfq_batch_id}/quotes/{batch_quote_id}/confir...
Result< CancelOrderV2Response > cancel_order(std::string_view order_id, const CancelOrderParams &params={})
Cancel Order DELETE /portfolio/events/orders/{order_id}
Result< CreateOrderV2Response > create_order_with_exit_trigger(const CreateOrderWithExitTriggerRequest &body)
Create Order With TP/SL POST /portfolio/events/orders/with_exit_trigger
Result< GetMarketCandlesticksResponse > get_market_candlesticks(std::string_view series_ticker, std::string_view ticker, const GetMarketCandlesticksParams &params)
Get Market Candlesticks GET /series/{series_ticker}/markets/{ticker}/candlesticks
Result< std::map< std::string, std::vector< std::string > > > get_tags_for_series_categories()
Get Tags for Series Categories GET /search/tags_by_categories
Result< CreateOrderV2Response > create_order(const CreateOrderV2Request &body)
Create Order POST /portfolio/events/orders
Definition api.hpp:15
std::expected< T, Error > Result
Result type for SDK operations.
Definition error.hpp:50
RateLimitConfig rate_limit_config(const GetAccountApiLimitsResponse &limits, const GetAccountEndpointCostsResponse &costs)
Builds a RateLimitedTransport config from get_account_api_limits() and get_account_endpoint_costs().
Definition models.hpp:1005
Definition models.hpp:1018
Query parameters for amend_order.
Definition models.hpp:1113
Definition models.hpp:1203
Definition models.hpp:1265
Definition models.hpp:1359
Definition models.hpp:1458
Query parameters for batch_get_market_candlesticks.
Definition models.hpp:1483
Query parameters for cancel_all_orders.
Definition models.hpp:1623
Query parameters for cancel_order.
Definition models.hpp:1629
Definition models.hpp:1648
Definition models.hpp:1689
Definition models.hpp:1844
Definition models.hpp:1431
Definition models.hpp:1913
Definition models.hpp:1956
Definition models.hpp:1974
Definition models.hpp:2071
Definition models.hpp:2104
Query parameters for decrease_order.
Definition models.hpp:2137
Definition models.hpp:2142
Query parameters for delete_event_contract_exit_trigger.
Definition models.hpp:2163
Query parameters for delete_fcm_event_contract_daily_cap.
Definition models.hpp:2170
Query parameters for delete_order_group.
Definition models.hpp:2176
Definition models.hpp:2440
Definition models.hpp:2465
Definition models.hpp:2483
Query parameters for get_api_keys.
Definition models.hpp:2491
Definition models.hpp:2496
Query parameters for get_balance.
Definition models.hpp:2505
Query parameters for get_block_trade_proposals.
Definition models.hpp:2533
Query parameters for get_credit_history.
Definition models.hpp:2557
Query parameters for get_deposits.
Definition models.hpp:2575
Query parameters for get_event_contract_exit_triggers.
Definition models.hpp:2598
Query parameters for get_event_fee_changes.
Definition models.hpp:2610
Query parameters for get_event_forecast_percentiles_history.
Definition models.hpp:2625
Query parameters for get_event_live_data.
Definition models.hpp:2642
Query parameters for get_event.
Definition models.hpp:2676
Query parameters for get_events.
Definition models.hpp:2691
Query parameters for get_fcm_event_contract_daily_cap.
Definition models.hpp:2806
Query parameters for get_fcm_fills.
Definition models.hpp:2812
Query parameters for get_fcm_orders.
Definition models.hpp:2827
Query parameters for get_fcm_positions.
Definition models.hpp:2849
Query parameters for get_fcm_subtrader_blocked_categories.
Definition models.hpp:2868
Query parameters for get_fills_historical.
Definition models.hpp:2874
Query parameters for get_fills.
Definition models.hpp:2890
Query parameters for get_historical_markets.
Definition models.hpp:2958
Query parameters for get_historical_orders.
Definition models.hpp:2974
Query parameters for get_historical_positions.
Definition models.hpp:2990
Query parameters for get_incentive_programs.
Definition models.hpp:3004
Query parameters for get_intra_exchange_instance_transfers.
Definition models.hpp:3075
Query parameters for get_live_data_by_milestone.
Definition models.hpp:3089
Query parameters for get_live_data.
Definition models.hpp:3095
Query parameters for get_live_datas.
Definition models.hpp:3114
Query parameters for get_market_candlesticks_by_event.
Definition models.hpp:3126
Query parameters for get_market_candlesticks_historical.
Definition models.hpp:3136
Query parameters for get_market_candlesticks.
Definition models.hpp:3188
Query parameters for get_market_orderbook.
Definition models.hpp:3299
Query parameters for get_market_orderbooks.
Definition models.hpp:3317
Query parameters for get_markets.
Definition models.hpp:3336
Query parameters for get_milestones.
Definition models.hpp:3380
Query parameters for get_multivariate_event_collections.
Definition models.hpp:3455
Query parameters for get_multivariate_events.
Definition models.hpp:3476
Query parameters for get_order_group.
Definition models.hpp:3499
Query parameters for get_order_groups.
Definition models.hpp:3516
Query parameters for get_order_queue_positions.
Definition models.hpp:3542
Query parameters for get_orders.
Definition models.hpp:3570
Query parameters for get_positions.
Definition models.hpp:3605
Query parameters for get_quotes.
Definition models.hpp:3661
Query parameters for get_rfq_batches.
Definition models.hpp:3798
Query parameters for get_rfqs.
Definition models.hpp:3811
Query parameters for get_series_fee_changes.
Definition models.hpp:3830
Query parameters for get_series_list.
Definition models.hpp:3853
Query parameters for get_series.
Definition models.hpp:3907
Query parameters for get_settlements.
Definition models.hpp:3917
Query parameters for get_structured_targets.
Definition models.hpp:3989
Query parameters for get_subaccount_transfers.
Definition models.hpp:4037
Query parameters for get_trades_historical.
Definition models.hpp:4083
Query parameters for get_trades.
Definition models.hpp:4099
Query parameters for get_weather_index.
Definition models.hpp:4192
Query parameters for get_withdrawals.
Definition models.hpp:4253
Definition models.hpp:4310
Defaults match Kalshi's Basic tier.
Definition rate_limit.hpp:69
Query parameters for reset_order_group.
Definition models.hpp:4342
Query parameters for set_event_contract_exit_trigger.
Definition models.hpp:4350
Replaces both legs, so a leg you omit is cleared.
Definition models.hpp:4356
Query parameters for trigger_order_group.
Definition models.hpp:4377
Query parameters for update_order_group_limit.
Definition models.hpp:4405
Definition models.hpp:4412
Definition models.hpp:4421