Get_Barset no attribute error

AttributeError Traceback (most recent call last)
Cell In[15], line 15
12 end = pd.Timestamp(‘2022-12-31’, tz=‘America/New_York’).isoformat()
14 # Get historical data
—> 15 bars = api.get_barset(symbol, timeframe, start=start, end=end).df[symbol]
17 # Calculate RSI
18 rsi = ta.momentum.RSIIndicator(bars[‘close’]).rsi()

AttributeError: ‘REST’ object has no attribute ‘get_barset’

Getting this error