I’m getting started with the Alpaca API. I’ve created a paper account about an hour ago and I’m trying to setup a simple python script. I’ve been getting an the
401 Client Error: Unauthorized for url and the
access key verification failed : access key not found (Code = 40110000) errors, and I cannot figure out why. My code is straight forward:
import alpaca_trade_api as tradeapi base_url = 'https://paper-api.alpaca.markets' api_key_id = 'api_key_id' api_secret = 'api_secret' api = tradeapi.REST( key_id=api_key_id, secret_key=api_secret, base_url=base_url, api_version='v2' ) account = api.get_account() print(account)
I’m not a US resident, but as far as I can tell, this should work for a paper account, shouldn’t it?