I am looking for Python API for getting the historical trade and quote price for a symbol.
I tried below code and its failing.
import alpaca_trade_api as tradeapi
api = tradeapi.REST(key, secret_key, api_version=‘v2’)
api.get(‘AAPL’) ← Failing
api.get.stocks ← AttributeError: ‘function’ object has no attribute ‘stocks’
Basically I am planning to use from:
Fetching Historical Quote data
BTW, below did not give me useful info:
Help on function get in alpaca_trade_api.REST:
alpaca_trade_api.REST.get = get(self, path, data=None)
Not sure what is wrong in my python command.
Your timely input will be greatly appreciated.
Thanks and Regards,