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

Access key verification failed #115

Closed
aeolus-aircraft opened this issue Oct 3, 2019 · 1 comment
Closed

Access key verification failed #115

aeolus-aircraft opened this issue Oct 3, 2019 · 1 comment

Comments

@aeolus-aircraft
Copy link

I'm new to the API and am starting to build my trading algorithms. I'm having troubles getting access to any of the asset data. I keep getting the error that my get request has failed because my access key code was not found. I've looked through the issues and found a similar one that was resolved by requesting a new key code. This didn't help either.

The relevant sections of my code (at least I think) are as follows:

api = tradeapi.REST('key', 'secret_key', 'https://api.alpaca.markets')
account = api.get_account()

response = requests.api.get(
"https://api.alpaca.markets/v2/assets/AAPL?apiKey=key",

I've tried the url with and without the ?apiKey= included at the end and also with and without the ticker symbol with the same result. I've also tried other requests with the same result.

Thanks for any help!

@ttt733
Copy link
Contributor

ttt733 commented Oct 24, 2019

Hello, I suggest you check your environment variables if you're still encountering a problem like this. (I assume that 'key' and 'secret_key' are replaced with the real values in your code.) If that's not the issue, please try seeing if account is being returned properly. If you'd like to access the assets API, you should use api.list_assets().

@ttt733 ttt733 closed this as completed Oct 24, 2019
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

2 participants