Coding in Python3, Google Colab, Chrome browser
Hey all, as indicated in the title, I’m just getting started and a relative noob. I followed the Google Colab template with the following code:
import alpaca_trade_api as alpaca
api = alpaca.REST(‘API_KEY_ID’, ‘API_SECRET_KEY’, ‘https://api.alpaca.markets/’)
BUT, when I run the code, I get the following error message:
HTTPError Traceback (most recent call last)
----> 1 api.get_account()
/usr/local/lib/python3.6/dist-packages/requests/models.py in raise_for_status(self)
939 if http_error_msg:
–> 940 raise HTTPError(http_error_msg, response=self)
942 def close(self):
HTTPError: 404 Client Error: Not Found for url: https://api.alpaca.markets//v2/account
I double-checked the keys and the URL, and I didn’t get an error message before running the api.get_account() command.
Multiple things about this confuse me, but at the top of the list is the URL… /v2/account? I read the documentation, and shouldn’t the endpoint be /v1/account? I don’t see a way to change the endpoint either.
I should also mention that I’ve put in a transfer request to fund my account, but the money isn’t actually in the account yet, so I’m not sure if that’s what’s causing this error message. I assumed the command would still work and I’d just get back output saying something to the effect of no money, no open orders, no positions, etc.
Thanks in advance!