1515from webull .data .request .get_corp_action_request import GetCorpActionRequest
1616from webull .data .request .get_eod_bars_request import GetEodBarsRequest
1717from webull .data .request .get_footprint_request import GetFootprintRequest
18- from webull .data .request .get_historical_bars_request import GetHistoricalBarsRequest
1918from webull .data .request .get_noii_bars_request import GetNoiiBarsRequest
2019from webull .data .request .get_noii_snapshot_request import GetNoiiSnapshotRequest
2120from webull .data .request .get_quotes_request import GetQuotesRequest
@@ -29,6 +28,11 @@ def __init__(self, api_client):
2928
3029 def get_history_bar (self , symbol , category , timespan , count = '200' , real_time_required = None , trading_sessions = None , start_time = None , end_time = None ):
3130 """
31+ .. deprecated::
32+ The endpoint /market-data/stocks/bars/get is no longer available.
33+ Use :meth:`get_batch_history_bar` instead, which calls the batch
34+ endpoint /market-data/stocks/bars/list.
35+
3236 Returns to Instrument in the window aggregated data.
3337 According to the last N K-lines of the stock code, it supports various granularity K-lines such as m1 and m5.
3438 Currently, only the K-line with the previous weight is provided for the daily K-line and above,
@@ -44,17 +48,16 @@ def get_history_bar(self, symbol, category, timespan, count='200', real_time_req
4448 :param start_time: Start timestamp in milliseconds (Long). Optional.
4549 :param end_time: End timestamp in milliseconds (Long). Delayed permission will auto-offset time. Optional.
4650 """
47- history_bar_request = GetHistoricalBarsRequest ()
48- history_bar_request .set_symbol (symbol )
49- history_bar_request .set_category (category )
50- history_bar_request .set_timespan (timespan )
51- history_bar_request .set_count (count )
52- history_bar_request .set_real_time_required (real_time_required )
53- history_bar_request .set_trading_sessions (trading_sessions )
54- history_bar_request .set_start_time (start_time )
55- history_bar_request .set_end_time (end_time )
56- response = self .client .get_response (history_bar_request )
57- return response
51+ return self .get_batch_history_bar (
52+ [symbol ],
53+ category ,
54+ timespan ,
55+ count = count ,
56+ real_time_required = real_time_required ,
57+ trading_sessions = trading_sessions ,
58+ start_time = start_time ,
59+ end_time = end_time ,
60+ )
5861
5962 def get_batch_history_bar (self , symbols , category , timespan , count = '200' , real_time_required = None , trading_sessions = None , start_time = None , end_time = None ):
6063 """
0 commit comments