request_stock_params = StockBarsRequest(symbol_or_symbols=["AAPL"], timeframe=TimeFrame.Day, start= datetime.date(2022, 7, 1), end= datetime.date(2022, 8, 1))
bars = stock_client.get_stock_bars(request_stock_params)
#bars = client.get_crypto_bars(request_params)
# convert to dataframe
AAPL_data = bars.df
Used this as well:
request_stock_params = StockBarsRequest(symbol_or_symbols=["AAPL"], timeframe=TimeFrame.Day, start="2022-07-01")
bars = stock_client.get_stock_bars(request_stock_params)
#bars = client.get_crypto_bars(request_params)
# convert to dataframe
AAPL_data = bars.df
Got this error:
ValidationError: 2 validation errors for StockBarsRequest
start
invalid type; expected datetime, string, bytes, int or float (type=type_error)
end
invalid type; expected datetime, string, bytes, int or float (type=type_error)
Please help. Did something change, or am I doing something wrong?