Closed builder173 closed 1 year ago
Yes it is possible to0 use your Broker API keys for Market Data. You need to make sure to set the use_basic_auth
parameter to False
within StockHistoricalData (Relevant Line). This is unlike the Trading/Data API, Broker API uses basic auth.
@haxdds
Thanks, I assume you meant I should set use_basic_auth
to True
since False
is the default?
Although use_basic_auth=True
didn't work on its own, it did work in combination with:
url_override='https://data.sandbox.alpaca.markets'
Question form pre-submit checklist.
Question
The API reference here indicates that the Broker API key can be used to access IEX market data. Does that hold for the python library as well?
I attempted to follow the historical stock price example here using my broker api key/secret.
However I'm getting this error: HTTPError: 403 Client Error: Forbidden for url: https://data.alpaca.markets/v2/stocks/quotes/latest?symbols=SPY%2CGLD%2CTLT
If I add the url_override parameter with value 'https://data.sandbox.alpaca.markets' I get the same error.
I can setup a trading account too if necessary, just don't want to acquire another set of keys if the broker api keys are supposed to work here.
Thanks