Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Informing user about subscription #231

Open
brianhumphreys opened this issue Nov 8, 2021 · 2 comments
Open

Informing user about subscription #231

brianhumphreys opened this issue Nov 8, 2021 · 2 comments

Comments

@brianhumphreys
Copy link

Hey Alpaca Team,
Not a big issue here but would be nice as an addition to new users. When running the example code, I got the following error message with no other context.

Traceback (most recent call last):
  File "/Users/brianhumphreys/.pyenv/versions/3.7.3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/Users/brianhumphreys/.pyenv/versions/3.7.3/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/brianhumphreys/.pyenv/versions/3.7.3/lib/python3.7/site-packages/alpaca_backtrader_api/alpacastore.py", line 430, in _t_candles
    ].dropna(subset=['high'])
  File "/Users/brianhumphreys/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/Users/brianhumphreys/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pandas/core/frame.py", line 5953, in dropna
    raise KeyError(list(np.compress(check, subset)))
KeyError: ['high']

I had to fork and investigate to figure out that I was getting an error message:
{'code': 42210000, 'message': 'your subscription does not permit querying data from the past 15 minutes'}

when attempting to hit the endpoint https://data.alpaca.markets/stocks/AAPL/bars.

It would be nice to bubble this error up to inform the user without requiring them to investigate. Also, it would be helpful to just mention the required subscription tier in the README.md :)

@tspeterkim
Copy link

How did you get it to display the underlying error message?

@Shu244
Copy link

Shu244 commented Jan 18, 2022

The error message originates from the alpaca-trade-api package in the rest.py file line 621 (for alpaca-trade-api version 1.4.3). You can view the exact line using this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants